summaryrefslogtreecommitdiff
path: root/www/rt34/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'www/rt34/Makefile')
-rw-r--r--www/rt34/Makefile215
1 files changed, 100 insertions, 115 deletions
diff --git a/www/rt34/Makefile b/www/rt34/Makefile
index 33233b5eb827..ad6840a888a2 100644
--- a/www/rt34/Makefile
+++ b/www/rt34/Makefile
@@ -1,160 +1,145 @@
-# New ports collection makefile for: RT2
-# Date created: 12 Auguest 2002
-# Whom: plasma
+# New ports collection makefile for: rt3
+# Date created: 28 November 2002
+# Whom: autrijus
#
# $FreeBSD$
#
-PORTNAME= rt2
-PORTVERSION= 2.0.15
-CATEGORIES= www
-MASTER_SITES= http://www.fsck.com/pub/rt/release/
-DISTNAME= rt-${PORTVERSION:S/./-/g}
+PORTNAME= rt3
+PORTVERSION= 3.0.0
+CATEGORIES= www
+MASTER_SITES= http://www.fsck.com/pub/rt/release/
+WRKSRC= ${WRKDIR}/rt-3-0-0
+DISTFILES= rt-3-0-0.tar.gz
-MAINTAINER= plasmaball@pchome.com.tw
+MAINTAINER= autrijus@autrijus.org
COMMENT= RT is an industrial-grade ticketing system written in Perl
-BUILD_DEPENDS= ${LOCALBASE}/libexec/apache/libperl.so:${PORTSDIR}/www/mod_perl \
- ${SITE_PERL}/${PERL_ARCH}/Apache/Cookie.pm:${PORTSDIR}/www/p5-libapreq \
+BUILD_DEPENDS= ${APXS}:${APACHE_PORT} \
+ ${LOCALBASE}/libexec/apache/libperl.so:${PORTSDIR}/www/mod_perl \
+ ${ARCH_PERL}/Apache/Cookie.pm:${PORTSDIR}/www/p5-libapreq \
${SITE_PERL}/Apache/DBI.pm:${PORTSDIR}/www/p5-Apache-DBI \
+ ${SITE_PERL}/Apache/Mason.pm:${PORTSDIR}/www/p5-HTML-Mason \
${SITE_PERL}/Apache/Session.pm:${PORTSDIR}/www/p5-Apache-Session \
- ${SITE_PERL}/${PERL_ARCH}/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 \
+ ${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 \
- ${SITE_PERL}/${PERL_ARCH}/Digest/MD5.pm:${PORTSDIR}/security/p5-Digest-MD5 \
+ ${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}/Encode/compat.pm:${PORTSDIR}/devel/p5-Encode-compat \
+ ${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 \
- ${SITE_PERL}/${PERL_ARCH}/HTML/Entities.pm:${PORTSDIR}/www/p5-HTML-Parser \
- ${SITE_PERL}/Apache/Mason.pm:${PORTSDIR}/www/p5-HTML-Mason \
+ ${ARCH_PERL}/HTML/Entities.pm:${PORTSDIR}/www/p5-HTML-Parser \
+ ${SITE_PERL}/HTML/Formatter.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}/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 \
- ${SITE_PERL}/Mail/Mailer.pm:${PORTSDIR}/mail/p5-Mail-Tools \
${SITE_PERL}/Net/SMTP.pm:${PORTSDIR}/net/p5-Net \
- ${SITE_PERL}/${PERL_ARCH}/Params/Validate.pm:${PORTSDIR}/devel/p5-Params-Validate \
- ${SITE_PERL}/${PERL_ARCH}/Storable.pm:${PORTSDIR}/devel/p5-Storable \
+ ${ARCH_PERL}/Params/Validate.pm:${PORTSDIR}/devel/p5-Params-Validate \
+ ${SITE_PERL}/Regexp/Common.pm:${PORTSDIR}/textproc/p5-Regexp-Common \
+ ${ARCH_PERL}/Storable.pm:${PORTSDIR}/devel/p5-Storable \
+ ${ARCH_PERL}/Term/ReadKey.pm:${PORTSDIR}/devel/p5-Term-ReadKey \
+ ${SITE_PERL}/Text/Autoformat.pm:${PORTSDIR}/textproc/p5-Text-Autoformat \
+ ${ARCH_PERL}/Text/Iconv.pm:${PORTSDIR}/converters/p5-Text-Iconv \
+ ${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 \
- ${SITE_PERL}/CGI/Cookie.pm:${PORTSDIR}/www/p5-CGI.pm \
- ${SITE_PERL}/File/Temp.pm:${PORTSDIR}/devel/p5-File-Temp
+ ${ARCH_PERL}/Time/HiRes.pm:${PORTSDIR}/devel/p5-Time-HiRes \
+ ${SITE_PERL}/Time/ParseDate.pm:${PORTSDIR}/devel/p5-Time \
+ ${SITE_PERL}/WWW/Mechanize.pm:${PORTSDIR}/www/p5-WWW-Mechanize
+
+HAS_CONFIGURE= yes
+
+CONFIGURE_ARGS= --prefix=${RT_PATH} \
+ --enable-layout=${LAYOUT} \
+ --with-web-user=${WEB_USER} \
+ --with-web-group=${WEB_GROUP} \
+ --with-libs-group=${LIBS_GROUP} \
+ --with-db-host=${DB_HOST} \
+ --with-db-port=${DB_PORT} \
+ --with-db-type=${DB_TYPE} \
+ --with-db-dba=${DB_DBA_USER}
+
+.if defined(WITH_APACHE2)
+APACHE_PORT?= ${PORTSDIR}/www/apache2
+BUILD_DEPENDS+= ${LOCALBASE}/libexec/apache2/mod_perl.so:${PORTSDIR}/www/mod_perl2
+TESTDEPS_ARGS+= --with-MODPERL2
+.else
+APACHE_PORT?= ${PORTSDIR}/www/apache13
+BUILD_DEPENDS+= ${LOCALBASE}/libexec/apache/libperl.so:${PORTSDIR}/www/mod_perl
+TESTDEPS_ARGS+= --with-MODPERL1
+.endif
+
+APXS?= ${LOCALBASE}/sbin/apxs
-WRKSRC= ${WRKDIR}/rt-${RT_VERSION}
-RT_VERSION= ${PORTVERSION:C/\./-/g}
-DB_TYPE?= mysql
+DB_TYPE?= mysql
.if ${DB_TYPE} == "Pg"
-BUILD_DEPENDS+= ${LOCALBASE}/bin/psql:${PORTSDIR}/databases/postgresql7 \
- ${SITE_PERL}/${PERL_ARCH}/DBD/Pg.pm:${PORTSDIR}/databases/p5-DBD-Pg
+BUILD_DEPENDS+= ${LOCALBASE}/bin/psql:${PORTSDIR}/databases/postgresql7
+TESTDEPS_ARGS+= --with-POSTGRESQL
.else
-DB_TYPE= mysql
-BUILD_DEPENDS+= ${LOCALBASE}/bin/safe_mysqld:${PORTSDIR}/databases/mysql323-server
+DB_TYPE= mysql
+BUILD_DEPENDS+= ${LOCALBASE}/bin/mysql_config:${PORTSDIR}/databases/mysql40-server \
+ ${ARCH_PERL}/Mysql.pm:${PORTSDIR}/databases/p5-DBD-mysql
+TESTDEPS_ARGS+= --with-MYSQL
.endif
-RUN_DEPENDS= ${BUILD_DEPENDS}
+RUN_DEPENDS= ${BUILD_DEPENDS}
-SITE_PERL= ${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}
-USE_REINPLACE= yes
-USE_PERL5= yes
+SITE_PERL:= ${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}
+ARCH_PERL= ${SITE_PERL}/${PERL_ARCH}/
+USE_PERL5= yes
+RT_PATH?= ${PREFIX}/rt3
-RT_PATH?= ${PREFIX}/rt2
-DB_DBA_PASSWORDD?=
+DB_DBA_USER?= root
DB_HOST?= localhost
-DB_RT_PASS= rt_pass
-
-MAN3= RT::Links.3 \
- RT::Watchers.3 \
- RT::Group.3 \
- RT::Keyword.3 \
- RT::Record.3 \
- RT::ScripConditions.3 \
- RT::Action::Generic.3 \
- RT::Transaction.3 \
- RT::Interface::Email.3 \
- RT::Link.3 \
- RT.3 \
- RT::Watcher.3 \
- RT::ObjectKeywords.3 \
- RT::EasySearch.3 \
- RT::ScripActions.3 \
- RT::Scrip.3 \
- RT::GroupMembers.3 \
- RT::Action::SendPasswordEmail.3 \
- RT::Transactions.3 \
- RT::Scrips.3 \
- RT::Action::SendEmail.3 \
- RT::User.3 \
- RT::ScripCondition.3 \
- RT::Users.3 \
- RT::Ticket.3 \
- RT::ACE.3 \
- RT::Queue.3 \
- RT::Interface::CLI.3 \
- RT::Tickets.3 \
- RT::GroupMember.3 \
- RT::Template.3 \
- RT::Templates.3 \
- RT::Queues.3 \
- RT::Date.3 \
- RT::CurrentUser.3 \
- RT::ScripAction.3 \
- RT::Keywords.3 \
- RT::ObjectKeyword.3 \
- RT::Attachment.3 \
- RT::Groups.3 \
- RT::KeywordSelect.3 \
- RT::Condition::Generic.3 \
- RT::Handle.3 \
- RT::ACL.3 \
- RT::Attachments.3
+DB_DBA_PASSWORD?=
+
+WEB_USER?= nobody
+WEB_GROUP?= nogroup
+LIBS_GROUP?= wheel
pre-fetch:
@${ECHO} ""
@${ECHO} "You may use the following build options:"
@${ECHO} ""
- @${ECHO} " DB_DBA_PASSWORD=password Your password of MySQL root ();"
- @${ECHO} " DB_HOST=hostname Where MySQL resident (localhost);"
- @${ECHO} " DB_RT_PASS=password Your password of MySQL RT user (rt_pass);"
- @${ECHO} " DB_TYPE=type Pg for postgresql, mysql for MySQL (mysql);"
- @${ECHO} " INSTALL_NEW Install a fresh port, otherwise just upgrade;"
- @${ECHO} ""
- @${ECHO} "IMPORTANT!!! If you want to install a fresh new port, define INSTALL_NEW to do so, otherwise this port just do a upgrade."
+ @${ECHO} " DB_TYPE=type Pg for postgresql, mysql for MySQL (mysql)"
+ @${ECHO} " DB_HOST=hostname The database host (localhost)"
+ @${ECHO} " DB_PORT=port The database port"
+ @${ECHO} " DB_DBA_USER=password Name of database administrator (root)"
+ @${ECHO} " DB_DBA_PASSWORD=password Password of database administrator"
+ @${ECHO} " WITH_APACHE2 Use Apache2 as the web server"
+ @${ECHO} " UPGRADE Upgrade only, don't initialize DB"
@${ECHO} ""
-post-patch:
-.for _FILE in tools/testdeps
- ${REINPLACE_CMD} 's,/usr/bin/perl,${PERL},' ${WRKSRC}/${_FILE}
- ${CHMOD} +x ${WRKSRC}/${_FILE}
-.endfor
+post-extract:
+ -@cd ${WRKSRC} && chmod a+x configure
do-build:
-.for _NAME in RT_PATH DB_DBA_PASSWORD DB_HOST DB_RT_PASS DB_TYPE
- @${REINPLACE_CMD} "s!%%${_NAME}%%!${${_NAME}}!g" ${WRKSRC}/Makefile
-.endfor
- @cd ${WRKSRC} && ${MAKE} -f ${WRKSRC}/Makefile testdeps
- @cd ${WRKSRC} && ${MAKE} -f ${WRKSRC}/Makefile fixdeps
+ -@cd ${WRKSRC} && ${PERL} ./sbin/rt-test-dependencies --install ${TESTDEPS_ARGS}
do-install:
- @${MKDIR} /var/log/rt2
-.if defined(INSTALL_NEW)
- -@cd ${WRKSRC} && ${MAKE} -f ${WRKSRC}/Makefile dropdb
@cd ${WRKSRC} && ${MAKE} -f ${WRKSRC}/Makefile install
-.else
- @cd ${WRKSRC} && ${MAKE} -f ${WRKSRC}/Makefile upgrade
-.endif
- @${INSTALL_DATA} ${WRKSRC}/README ${PREFIX}/rt2/README
- @${CHOWN} -R www /var/log/rt2
+ @${INSTALL_DATA} ${WRKSRC}/README ${RT_PATH}/README
post-install:
- @${SED} s!%%PREFIX%%!${PREFIX}!g ${PKGMESSAGE}
-
-.include <bsd.port.pre.mk>
-
-.if ${PERL_LEVEL} < 500601
-BUILD_DEPENDS+= ${SITE_PERL}/File/Spec.pm:${PORTSDIR}/devel/p5-File-Spec
-RUN_DEPENDS+= ${SITE_PERL}/File/Spec.pm:${PORTSDIR}/devel/p5-File-Spec
+.if defined(UPGRADE)
+ @echo Upgrade of RT3 complete.
+.else
+ -@${PERL} $(RT_PATH)/sbin/rt-setup-database --force --action drop --dba ${DB_DBA_USER} --dba-password ${DB_DBA_PASSWORD}
+ -@${PERL} $(RT_PATH)/sbin/rt-setup-database --force --action init --dba ${DB_DBA_USER} --dba-password ${DB_DBA_PASSWORD}
+ @${SED} s!%%RT_PATH%%!${RT_PATH}!g ${PKGMESSAGE}
.endif
-.include <bsd.port.post.mk>
+.include <bsd.port.mk>