# $NetBSD: Makefile.common,v 1.14 2007/02/22 19:26:25 wiz Exp $
DISTNAME= rt-2-0-15
CATEGORIES= devel
MASTER_SITES= http://www.bestpractical.com/rt/release/
MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= http://www.bestpractical.com/rt/
COMMENT= Industrial-grade ticketing system
CONFLICTS= rt-*
RT_GROUP?= rt
RT_PATH?= ${PREFIX}/rt
RT_VAR_PATH?= /var/pkg/rt
RT_LOG_PATH?= ${RT_VAR_PATH}/log
RT_DATA_PATH?= ${RT_VAR_PATH}/data
RT_SESSION_PATH?= ${RT_VAR_PATH}/sessiondata
RT_DB_HOME?= ${PREFIX}
RT_DB_DATABASE?=rt2
RT_DB_USER?= rt
RT_DB_PASS?= changemeplease
RT_WEB_USER?= nobody
RT_WEB_GROUP?= nobody
PKGDIR= ${.CURDIR}/../../devel/rt-mysql
DISTINFO_FILE= ${PKGDIR}/distinfo
FILESDIR= ${PKGDIR}/files
PATCHDIR= ${PKGDIR}/patches
PLIST_SRC= ${PKGDIR}/PLIST
PKG_GROUPS= ${RT_GROUP}
CONF_FILES= ${RT_PATH}/etc/config.pm.default ${RT_PATH}/etc/config.pm
REQD_DIRS+= ${RT_PATH}
REQD_DIRS+= ${RT_PATH}/etc
REQD_DIRS+= ${RT_PATH}/WebRT
OWN_DIRS+= ${RT_VAR_PATH}
OWN_DIRS+= ${RT_LOG_PATH}
OWN_DIRS+= ${RT_DATA_PATH}
OWN_DIRS+= ${RT_SESSION_PATH}
USE_TOOLS+= perl:run
REPLACE_PERL+= tools/insertdata \
tools/initdb
.if (${RT_DB_TYPE} == "mysql")
PKGNAME= ${DISTNAME:S/-/./g:S/./-mysql-/}
DEPENDS+= p5-DBD-mysql-[0-9]*:../../databases/p5-DBD-mysql
RT_DB_HOST?= localhost
RT_DB_PORT?=
RT_DB_PATH?= ${PREFIX}/lib/mysql
RT_DB_DBA?= root
RT_DB_DBA_PASSWORD?=
.elif (${RT_DB_TYPE} == "Pg")
PKGNAME= ${DISTNAME:S/-/./g:S/./-pgsql-/}
DEPENDS+= p5-DBD-postgresql-[0-9]*:../../databases/p5-DBD-postgresql
RT_DB_HOST?=
RT_DB_PORT?=
RT_DB_PATH?= ${PREFIX}/lib/postgresql
RT_DB_DBA?= pgsql
RT_DB_DBA_PASSWORD?=
.else
#
# oracle is supposed to be an option, but not yet.
#
.endif
DEPENDS+= p5-Digest-MD5-[0-9]*:../../security/p5-Digest-MD5
DEPENDS+= p5-Storable-[0-9]*:../../devel/p5-Storable
DEPENDS+= p5-DBI>=1.18:../../databases/p5-DBI
DEPENDS+= p5-DBIx-DataSource>=0.02:../../databases/p5-DBIx-Datasource
DEPENDS+= p5-DBIx-SearchBuilder>=0.48:../../databases/p5-DBIx-SearchBuilder
DEPENDS+= p5-libwww-[0-9]*:../../www/p5-libwww
DEPENDS+= p5-MLDBM-[0-9]*:../../databases/p5-MLDBM
DEPENDS+= p5-Params-Validate>=0.02:../../devel/p5-Params-Validate
DEPENDS+= p5-HTML-Mason>=1.02:../../www/p5-HTML-Mason
DEPENDS+= p5-CGI-[0-9]*:../../www/p5-CGI
DEPENDS+= p5-libapreq2-[0-9]*:../../www/p5-libapreq2
DEPENDS+= p5-Apache-Session>=1.53:../../www/p5-Apache-Session
DEPENDS+= p5-TimeDate-[0-9]*:../../time/p5-TimeDate
DEPENDS+= p5-MIME-tools>=5.108:../../mail/p5-MIME-tools
DEPENDS+= p5-MailTools>=1.20:../../mail/p5-MailTools
DEPENDS+= p5-Tie-IxHash-[0-9]*:../../devel/p5-Tie-IxHash
DEPENDS+= p5-Text-Wrapper-[0-9]*:../../textproc/p5-Text-Wrapper
DEPENDS+= p5-Text-Template-[0-9]*:../../textproc/p5-Text-Template
DEPENDS+= p5-FreezeThaw-[0-9]*:../../devel/p5-FreezeThaw
DEPENDS+= p5-Log-Dispatch-[0-9]*:../../devel/p5-Log-Dispatch
DEPENDS+= p5-Apache-DBI-[0-9]*:../../databases/p5-Apache-DBI
pre-configure:
@${ECHO} "=> Removing CVS directories from work directory"
@${FIND} ${WRKSRC} -name CVS -type d -print | ${XARGS} ${RM} -rf
@${CP} ${FILESDIR}/rtconfig ${WRKSRC}/rtconfig
@${CP} ${FILESDIR}/README ${WRKSRC}/README.pkg
@cd ${WRKSRC} ; \
for f in Makefile rtconfig README.pkg; do \
${ECHO} "=> Doing RT variable replacement in $$f"; \
[ -f $$f.BAK ] || ${MV} $$f $$f.BAK ; \
${SED} -e 's|@PREFIX@|${PREFIX}|g' \
-e 's|@RT_GROUP@|${RT_GROUP}|g' \
-e 's|@RT_PATH@|${RT_PATH}|g' \
-e 's|@RT_LOG_PATH@|${RT_LOG_PATH}|g' \
-e 's|@RT_DATA_PATH@|${RT_DATA_PATH}|g' \
-e 's|@RT_SESSION_PATH@|${RT_SESSION_PATH}|g' \
-e 's|@RT_DB_TYPE@|${RT_DB_TYPE}|g' \
-e 's|@RT_DB_DBA@|${RT_DB_DBA}|g' \
-e 's|@RT_DB_DBA_PASSWORD@|${RT_DB_DBA_PASSWORD}|g' \
-e 's|@RT_DB_DATABASE@|${RT_DB_DATABASE}|g' \
-e 's|@RT_DB_USER@|${RT_DB_USER}|g' \
-e 's|@RT_DB_PASS@|${RT_DB_PASS}|g' \
-e 's|@RT_DB_HOME@|${RT_DB_HOME}|g' \
-e 's|@RT_DB_HOST@|${RT_DB_HOST}|g' \
-e 's|@RT_DB_PORT@|${RT_DB_PORT}|g' \
-e 's|@RT_WEB_USER@|${RT_WEB_USER}|g' \
-e 's|@RT_WEB_GROUP@|${RT_WEB_GROUP}|g' < $$f.BAK > $$f; \
done
pre-build:
(mkdir -p ${WRKSRC}/src; \
cd ${WRKSRC}/src; \
${CP} ${FILESDIR}/wrapper.c .; \
${ECHO} '#define RT_REAL_PATH "${RT_PATH}/bin/real"' > config.h; \
${ECHO} '#define DATABASE_LIBRARY_PATH "${RT_DB_PATH}"' >> config.h; \
${ECHO} '#define RT_GROUP "${RT_GROUP}"' >> config.h )
.include "../../mk/bsd.pkg.mk"
CVSweb <webmaster@jp.NetBSD.org>