Has anyone attempted to capture mod_bt in an RPM?
http://www.crackerjack.net/mod_bt/
From the web page:
mod_bt is a BitTorrent tracker for the Apache webserver. It is written in C and runs as an Apache 2.x module. It is possible for mod_perl or PHP to directly access the tracker's information; no need to download and bdecode scrape URLs. The tracker is fully configured from within Apache's own configuration file.
I tried simply building it from the tarball tonight but it fails trying to build the Apache part, and I think its assumptions about APR are wrong, as it can't find apr.h. (apr-devel is installed, and the file is in /usr/include/apr-0/.)
I'm no expert on building Apache modules and certainly not on how RH has packaged the associated development system, so I'm not sure how to proceed. Is there a "canonical Apache module RPM" that can be used as an example of how modules should be organized in the RPM environment?
Has anyone attempted to capture mod_bt in an RPM?
No.
I tried simply building it from the tarball tonight but it fails trying to build the Apache part, and I think its assumptions about APR are wrong, as it can't find apr.h. (apr-devel is installed, and the file is in /usr/include/apr-0/.)
Try by adding "--with-apr-include=/usr/include/apr-0" to configure.
Regards/Casper
--On Sunday, February 13, 2005 6:05 PM +0100 Casper Pedersen cpedersen@c-note.dk wrote:
Try by adding "--with-apr-include=/usr/include/apr-0" to configure.
Thanks. Alas, that doesn't fix it. Here's the failing command (can't find apr.h):
/usr/sbin/apxs -S CFLAGS="-g -O2 -O2 -Werror -Wall -Wimplicit-function-declaration -Wall -Wno-strict-aliasing -I.. -I../libbtt " -L.. -lbtt `/usr/bin/apr-config --ldflags` -ldb-4.2 `/usr/bin/apr-config --link-ld --libs` -c mod_bt.c
"apr-config --includes" displays the correct directory, so I'd guess apxs is not using that. With that hint it looks like I can add `/usr/bin/apr-config --includes` to the above command. That seems to let that part run to completion.
The next failure happens building php_mod_bt. It looks like multiple headers are defining regex stuff, from both glibc-headers and httpd-devel. I'd guess that the glibc-headers one wants to be suppressed, since the other is included by way of php-devel stuff. I see this happening with the first source file:
make -C php_mod_bt make[3]: Entering directory `/home2/buildmeister/BUILD/mod_bt-0.0.13/src/apache2/php_mod_bt' gcc -g -O2 -O2 -Werror -Wall -Wimplicit-function-declaration -fpic -I/usr/include/httpd -I/usr/include/apr-0 -I/usr/include/php -I/usr/incl¬ ude/php/main -I/usr/include/php/Zend -I/usr/include/php/TSRM -DBT_VERSION="0.0.13" `/usr/bin/apr-config --cppflags --includes` `/usr/bin/php¬ -config --includes` -I../.. -I ../../libbtt -DCOMPILE_DL=1 -c -o php_mod_bt.o php_mod_bt.c
In file included from /usr/include/httpd/httpd.h:43, from php_apache.h:24, from php_mod_bt.c:8: /usr/include/httpd/pcreposix.h:32:1: "REG_ICASE" redefined In file included from /usr/include/php/main/php_regex.h:39, from /usr/include/php/main/php.h:78, from php_mod_bt.c:6: /usr/include/regex.h:277:1: this is the location of the previous definition
--On Sunday, February 13, 2005 2:35 PM -0800 Kenneth Porter shiva@sewingwitch.com wrote:
The next failure happens building php_mod_bt. It looks like multiple headers are defining regex stuff, from both glibc-headers and httpd-devel.
Misdiagnosis. The problem is a conflict between the regex stuff in Apache and PHP headers. To reproduce, make a simple source file and attempt to compile it:
echo > foo.c << EOF #include "php.h" #include "httpd.h" EOF gcc `php-config --includes` `apr-config --includes` -I /usr/include/httpd -c foo.c
Now look at the definition of REG_ICASE is /usr/include/httpd/pcreposix.h and /usr/include/regex.h.
I'm not sure how to address this or who to file this with. For now I'll post it to the mod_bt maintainer.
--On Sunday, February 13, 2005 5:43 PM -0800 Kenneth Porter shiva@sewingwitch.com wrote:
# include "php.h" # include "httpd.h"
As a hack, I suppressed inclusion of Apache's regex file with:
#define _PCREPOSIX_H
This allows things to build. It doesn't look like anything in this module uses regex support so this should work for now.
On Sun, Feb 13, 2005 at 05:43:32PM -0800, Kenneth Porter wrote:
--On Sunday, February 13, 2005 2:35 PM -0800 Kenneth Porter shiva@sewingwitch.com wrote:
The next failure happens building php_mod_bt. It looks like multiple headers are defining regex stuff, from both glibc-headers and httpd-devel.
Misdiagnosis. The problem is a conflict between the regex stuff in Apache and PHP headers. To reproduce, make a simple source file and attempt to compile it:
echo > foo.c << EOF #include "php.h" #include "httpd.h" EOF gcc `php-config --includes` `apr-config --includes` -I /usr/include/httpd -c foo.c
Now look at the definition of REG_ICASE is /usr/include/httpd/pcreposix.h and /usr/include/regex.h.
What versions of php and httpd are you using? You shouldn't get this problem with FC3 or Raw Hide.
joe
--On Monday, February 14, 2005 10:54 AM +0000 Joe Orton jorton@redhat.com wrote:
What versions of php and httpd are you using? You shouldn't get this problem with FC3 or Raw Hide.
FC2, so:
php-devel-4.3.10-2.4 httpd-devel-2.0.51-2.9
Which package changed its definitions to comply with the other?
On Mon, Feb 14, 2005 at 02:38:03PM -0800, Kenneth Porter wrote:
--On Monday, February 14, 2005 10:54 AM +0000 Joe Orton jorton@redhat.com wrote:
What versions of php and httpd are you using? You shouldn't get this problem with FC3 or Raw Hide.
FC2, so:
php-devel-4.3.10-2.4 httpd-devel-2.0.51-2.9
Which package changed its definitions to comply with the other?
PHP will not #include <regex.h> in FC3 and later. If you file a bug against FC2 php I can probably fix it there for future updates.
(the fact that both httpd and PHP think it's a good idea to reimplement the POSIX regex interface in random different ways is an accident waiting to happen; I've fixed it in the httpd 2.1 branch but PHP is another matter)
Regards,
joe
--On Tuesday, February 15, 2005 3:07 PM +0000 Joe Orton jorton@redhat.com wrote:
PHP will not #include <regex.h> in FC3 and later. If you file a bug against FC2 php I can probably fix it there for future updates.
(the fact that both httpd and PHP think it's a good idea to reimplement the POSIX regex interface in random different ways is an accident waiting to happen; I've fixed it in the httpd 2.1 branch but PHP is another matter)
Done: https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=148815
Thanks. Yeah, it looks like anyone wanting to manage Apache from PHP has to keep the code carefully separated in separate modules right now to avoid the header collision.
--On Saturday, February 12, 2005 9:38 PM -0800 Kenneth Porter shiva@sewingwitch.com wrote:
I've created an SRPM for this here:
http://home.sewingwitch.com:8000/Stuff/mod_bt-0.0.13-1.src.rpm
I can load it on my Apache setup but the virtual server isn't listening on the desired port. I'm not sure yet what I'm doing wrong in configuring that but I'm still investigating. The module seems to create its database and issues reasonable shutdown messages when Apache is stopped.
devel@lists.stg.fedoraproject.org