Date: Wed, 11 Jun 2003 16:04:01 +0100 From: Tim Bishop <tim@bishnet.net> To: FreeBSD-gnats-submit@FreeBSD.org Cc: autrijus@autrijus.org Subject: ports/53205: Make rt3 work with Apache2/mod_perl2 Message-ID: <E19Q78r-000CZq-KI@pendennis.ukc.ac.uk> Resent-Message-ID: <200306111510.h5BFAFJk069901@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 53205 >Category: ports >Synopsis: Make rt3 work with Apache2/mod_perl2 >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: change-request >Submitter-Id: current-users >Arrival-Date: Wed Jun 11 08:10:15 PDT 2003 >Closed-Date: >Last-Modified: >Originator: Tim Bishop >Release: FreeBSD 4.8-STABLE i386 >Organization: >Environment: System: FreeBSD pendennis.ukc.ac.uk 4.8-STABLE FreeBSD 4.8-STABLE #2: Fri Apr 4 20:34:25 BST 2003 tdb@pendennis.ukc.ac.uk:/usr/obj/usr/src/sys/PENDENNIS i386 >Description: In it's current state the rt3 port won't compile/work with apache2 and mod_perl2. >How-To-Repeat: >Fix: This patch solves this, and a few other minor problems. First, apply ports/53204 to fix an issue with p5-Apache-DBI. The first change is the dependency list. I followed the dependency list given on rt's website, and updated the port. There's a few in the port that aren't mentioned on the rt site - I've dropped these in this patch and it seems to work. I guess the maintainer will know why they were there in the first place - so they might decide to keep them. I also added a couple of dependencies that were in the list on the rt website, but not in the port. If WITH_APACHE2 is defined I've added two DEPEND_ARGS. The WITHOUT_MODPERL is for the p5-HTML-Mason port which tries to use mod_perl (not mod_perl2), and the second is for the p5-Apache-DBI port. I wonder if there's a way to do this in the dependency list so they're tied to the right port only? To make Apache start with rt3/mason/mod_perl2 a small perl script needs to be run prior to the main rt3 script. This script is in the files directory and gets installed by the port. I've added a brief note about it to the pkg-message. Finally I've updated the pkg-plist for the above new file, and I've removed the RT_SiteConfig.pm file - it was rather annoying to see my config get destroyed by portupgrade. Also added the etc directory, although this makes less sense with RT_SiteConfig.pm remaining. Something I haven't patched is the way this port deals with setting up the database. In my opinion it's "bad" for the default behaviour to destroy all data during an upgrade - the port requires UPGRADE to be defined to preserve data. This could catch people out, especially now portupgrade makes doing multiple ports a doddle. I'd suggest changing this, but I'm not sure of the best approach. --- rt3-ap2mp2.diff begins here --- diff -ruN rt3.bak/Makefile rt3/Makefile --- rt3.bak/Makefile Wed Jun 11 15:31:55 2003 +++ rt3/Makefile Wed Jun 11 15:31:47 2003 @@ -7,7 +7,7 @@ PORTNAME= rt3 PORTVERSION= 3.0.2 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= www MASTER_SITES?= http://www.fsck.com/pub/rt/release/ \ ftp://ftp.eu.uu.net/pub/unix/ticketing/rt/ @@ -21,23 +21,22 @@ ${SITE_PERL}/Apache/Session.pm:${PORTSDIR}/www/p5-Apache-Session \ ${SITE_PERL}/Cache/Cache.pm:${PORTSDIR}/devel/p5-Cache-Cache \ ${SITE_PERL}/CGI/Cookie.pm:${PORTSDIR}/www/p5-CGI.pm \ - ${SITE_PERL}/Date/Format.pm:${PORTSDIR}/devel/p5-TimeDate \ - ${SITE_PERL}/Date/Parse.pm:${PORTSDIR}/devel/p5-TimeDate \ ${ARCH_PERL}/DBI.pm:${PORTSDIR}/databases/p5-DBI \ - ${SITE_PERL}/DBIx/DataSource.pm:${PORTSDIR}/databases/p5-DBIx-DataSource \ ${SITE_PERL}/DBIx/SearchBuilder.pm:${PORTSDIR}/databases/p5-DBIx-SearchBuilder \ ${ARCH_PERL}/Digest/MD5.pm:${PORTSDIR}/security/p5-Digest-MD5 \ + ${SITE_PERL}/Errno.pm:${PORTSDIR}/devel/p5-Errno \ ${SITE_PERL}/Exception/Class.pm:${PORTSDIR}/devel/p5-Exception-Class \ ${SITE_PERL}/File/Temp.pm:${PORTSDIR}/devel/p5-File-Temp \ ${SITE_PERL}/FreezeThaw.pm:${PORTSDIR}/devel/p5-FreezeThaw \ ${SITE_PERL}/Getopt/Long.pm:${PORTSDIR}/devel/p5-Getopt-Long \ ${ARCH_PERL}/HTML/Entities.pm:${PORTSDIR}/www/p5-HTML-Parser \ - ${SITE_PERL}/HTML/Formatter.pm:${PORTSDIR}/textproc/p5-HTML-Format \ + ${SITE_PERL}/HTML/FormatText.pm:${PORTSDIR}/textproc/p5-HTML-Format \ ${SITE_PERL}/HTML/TreeBuilder.pm:${PORTSDIR}/www/p5-HTML-Tree \ ${SITE_PERL}/Locale/Maketext.pm:${PORTSDIR}/devel/p5-Locale-Maketext \ ${SITE_PERL}/Locale/Maketext/Fuzzy.pm:${PORTSDIR}/devel/p5-Locale-Maketext-Fuzzy \ ${SITE_PERL}/Locale/Maketext/Lexicon.pm:${PORTSDIR}/devel/p5-Locale-Maketext-Lexicon \ ${SITE_PERL}/Log/Dispatch.pm:${PORTSDIR}/devel/p5-Log-Dispatch \ + ${SITE_PERL}/LWP/UserAgent.pm:${PORTSDIR}/www/p5-libwww \ ${SITE_PERL}/Mail/Mailer.pm:${PORTSDIR}/mail/p5-Mail-Tools \ ${SITE_PERL}/MIME/Entity.pm:${PORTSDIR}/mail/p5-MIME-Tools \ ${SITE_PERL}/MLDBM.pm:${PORTSDIR}/databases/p5-MLDBM \ @@ -50,7 +49,6 @@ ${SITE_PERL}/Text/Quoted.pm:${PORTSDIR}/textproc/p5-Text-Quoted \ ${SITE_PERL}/Text/Template.pm:${PORTSDIR}/textproc/p5-Text-Template \ ${SITE_PERL}/Text/Wrapper.pm:${PORTSDIR}/textproc/p5-Text-Wrapper \ - ${SITE_PERL}/Tie/IxHash.pm:${PORTSDIR}/devel/p5-Tie-IxHash \ ${ARCH_PERL}/Time/HiRes.pm:${PORTSDIR}/devel/p5-Time-HiRes \ ${SITE_PERL}/Time/ParseDate.pm:${PORTSDIR}/devel/p5-Time-modules \ ${SITE_PERL}/WWW/Mechanize.pm:${PORTSDIR}/www/p5-WWW-Mechanize @@ -80,6 +78,8 @@ .if defined(WITH_APACHE2) APACHE_PORT?= ${PORTSDIR}/www/apache2 BUILD_DEPENDS+= ${LOCALBASE}/libexec/apache2/mod_perl.so:${PORTSDIR}/www/mod_perl2 +DEPENDS_ARGS+= WITHOUT_MODPERL=yes +DEPENDS_ARGS+= WITH_MODPERL2=yes .else APACHE_PORT?= ${PORTSDIR}/www/apache13 BUILD_DEPENDS+= ${LOCALBASE}/libexec/apache/libperl.so:${PORTSDIR}/www/mod_perl @@ -132,6 +132,9 @@ post-install: @${INSTALL_DATA} ${WRKSRC}/README ${RT_PATH}/README +.if defined(WITH_APACHE2) + @${INSTALL_SCRIPT} ${FILESDIR}/ap2mp2-fix.pl ${RT_PATH}/bin +.endif .if defined(UPGRADE) @echo Upgrade of RT3 complete. .else diff -ruN rt3.bak/files/ap2mp2-fix.pl rt3/files/ap2mp2-fix.pl --- rt3.bak/files/ap2mp2-fix.pl Thu Jan 1 01:00:00 1970 +++ rt3/files/ap2mp2-fix.pl Wed Jun 11 00:29:29 2003 @@ -0,0 +1,10 @@ +# temp fix for mp2-09... make a dummy Apache->request +require Apache::RequestUtil; +no warnings 'redefine'; +my $sub = *Apache::request{CODE}; +*Apache::request = sub { + my $r; + eval { $r = $sub->('Apache'); }; + # warn $@ if $@; + return $r; +}; diff -ruN rt3.bak/pkg-message rt3/pkg-message --- rt3.bak/pkg-message Tue Apr 29 06:10:28 2003 +++ rt3/pkg-message Wed Jun 11 00:37:30 2003 @@ -6,9 +6,12 @@ the default config file (%%RT_PATH%%/etc/RT_Config.pm). 2. Configure the email and web gateways. Please refer to 'SETTING UP THE MAIL GATEWAY' in %%RT_PATH%%/README -3. Restart Apache. -4. Do remember to *CHANGE* the root's password for the web interface. +3. For Apache2/mod_perl2 you'll probably need to add the + following line above the webmux.pl line in httpd.conf: + PerlRequire %%RT_PATH%%/bin/ap2mp2-fix.pl +4. Restart Apache. +5. Do remember to *CHANGE* the root's password for the web interface. The default is "password" (without the quotes.) -5. Configure RT per the instructions at http://www.fsck.com/rtfm/. +6. Configure RT per the instructions at http://www.fsck.com/rtfm/. ===================================================================== diff -ruN rt3.bak/pkg-plist rt3/pkg-plist --- rt3.bak/pkg-plist Thu May 15 19:59:34 2003 +++ rt3/pkg-plist Wed Jun 11 08:48:39 2003 @@ -1,5 +1,4 @@ rt3/etc/RT_Config.pm -rt3/etc/RT_SiteConfig.pm rt3/etc/initialdata rt3/etc/schema.SQLite rt3/etc/schema.Pg @@ -349,6 +348,7 @@ rt3/bin/mason_handler.svc rt3/bin/mason_handler.fcgi rt3/bin/rt-mailgate +rt3/bin/ap2mp2-fix.pl rt3/sbin/rt-test-dependencies rt3/sbin/rt-setup-database rt3/README @@ -390,6 +390,7 @@ @dirrm rt3/sbin @dirrm rt3/local/po @dirrm rt3/local/html +@dirrm rt3/local/etc @dirrm rt3/local @dirrm rt3/lib/t/regression @dirrm rt3/lib/t/data --- rt3-ap2mp2.diff ends here --- >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?E19Q78r-000CZq-KI>