aboutsummaryrefslogtreecommitdiff
path: root/devel/perforce/Makefile
diff options
context:
space:
mode:
authorAkinori MUSHA <knu@FreeBSD.org>2001-09-01 18:57:08 +0000
committerAkinori MUSHA <knu@FreeBSD.org>2001-09-01 18:57:08 +0000
commitdf5a274627d50f17a9f6d26b83d8e78ab014d7b4 (patch)
tree383f9254270129c6616505e1b0163b3dbac3c2e2 /devel/perforce/Makefile
parentec1ecd4eb4a495a9e092f620fba2b495af914fe8 (diff)
downloadports-df5a274627d50f17a9f6d26b83d8e78ab014d7b4.tar.gz
ports-df5a274627d50f17a9f6d26b83d8e78ab014d7b4.zip
Notes
Diffstat (limited to 'devel/perforce/Makefile')
-rw-r--r--devel/perforce/Makefile92
1 files changed, 76 insertions, 16 deletions
diff --git a/devel/perforce/Makefile b/devel/perforce/Makefile
index f0d700965267..799ca0a5f2b5 100644
--- a/devel/perforce/Makefile
+++ b/devel/perforce/Makefile
@@ -6,39 +6,99 @@
#
PORTNAME= perforce
-PORTVERSION= 00.2
+PORTVERSION= ${VERSION}
PORTEPOCH= 1
CATEGORIES= devel
-MASTER_SITES= ftp://ftp.perforce.com/pub/perforce/r${PORTVERSION}/bin.freebsd/ \
- http://www.dsmit.com/p4/ \
+MASTER_SITES= ftp://ftp.perforce.com/pub/perforce/r${PORTVERSION}/bin.${PLATFORM}/ \
ftp://ftp.perforce.com/pub/perforce/r${PORTVERSION}/doc/man/
EXTRACT_SUFX=
-DISTFILES= p4 p4d p4web p4.1 p4d.1
-DIST_SUBDIR= perforce
+DISTFILES= ${BIN_FILES} ${SBIN_FILES} ${MAN1}
+DIST_SUBDIR= perforce/${VERSION}/${ARCH}
+EXTRACT_ONLY= # none
-MAINTAINER= sam@inf.enst.fr
+MAINTAINER= knu@FreeBSD.org
NO_PACKAGE= Restricted distribution
NO_CDROM= Restricted distribution
MAN1= p4.1 p4d.1
-do-extract:
- @${MKDIR} ${WRKSRC}
+NO_WRKSUBDIR= yes
+
+.include <bsd.port.pre.mk>
+
+# These variables are all configurable.
+PERFORCE_USER?= p4admin
+PERFORCE_UID?= 94
+PERFORCE_GROUP?= p4admin
+PERFORCE_GID?= 94
+PERFORCE_HOME?= ${LOCALBASE}/perforce
+PERFORCE_ROOT?= ${PERFORCE_HOME}/root
+PERFORCE_LOGS?= ${PERFORCE_HOME}/logs
+PERFORCE_PORT?= 1666
+
+.if ${ARCH} == i386
+VERSION= 01.1
+PLATFORM= freebsd
+BIN_FILES= p4 p4web
+SBIN_FILES= p4d p4ftpd
+.elif ${ARCH} == alpha
+VERSION= 99.1
+PLATFORM= freebsdaxp
+BIN_FILES= p4
+SBIN_FILES= p4d
+.else
+.error "Unsupported platform, sorry."
+.endif
do-build:
+ ${SED} -e "s,@PERFORCE_ROOT@,${PERFORCE_ROOT},g" \
+ -e "s,@PERFORCE_LOGS@,${PERFORCE_LOGS},g" \
+ -e "s,@PERFORCE_USER@,${PERFORCE_USER},g" \
+ -e "s,@PERFORCE_PORT@,${PERFORCE_PORT},g" \
+ < ${FILESDIR}/perforce.conf.in > ${WRKSRC}/perforce.conf
${SED} -e "s,@PREFIX@,${PREFIX},g" \
< ${FILESDIR}/perforce.sh.in > ${WRKSRC}/perforce.sh
+pre-install:
+ ${SETENV} PKG_PREFIX=${PREFIX} \
+ PERFORCE_USER=${PERFORCE_USER} \
+ PERFORCE_UID=${PERFORCE_UID} \
+ PERFORCE_GROUP=${PERFORCE_GROUP} \
+ PERFORCE_GID=${PERFORCE_GID} \
+ PERFORCE_HOME=${PERFORCE_HOME} \
+ PERFORCE_ROOT=${PERFORCE_ROOT} \
+ PERFORCE_LOGS=${PERFORCE_LOGS} \
+ ${SH} ${PKGDIR}/pkg-install ${PORTNAME} PRE-INSTALL
+
do-install:
- ${INSTALL_PROGRAM} ${DISTDIR}/${DIST_SUBDIR}/p4 ${PREFIX}/bin/
- ${INSTALL_PROGRAM} ${DISTDIR}/${DIST_SUBDIR}/p4web ${PREFIX}/bin/
- ${INSTALL_PROGRAM} ${DISTDIR}/${DIST_SUBDIR}/p4d ${PREFIX}/sbin/
- if [ ! -f ${PREFIX}/etc/perforce ]; then \
- ${INSTALL_DATA} ${FILESDIR}/perforce ${PREFIX}/etc/; \
+.for f in ${BIN_FILES}
+ ${INSTALL_PROGRAM} ${_DISTDIR}/${f} ${PREFIX}/bin/
+.endfor
+.for f in ${SBIN_FILES}
+ ${INSTALL_PROGRAM} ${_DISTDIR}/${f} ${PREFIX}/sbin/
+.endfor
+ ${INSTALL_DATA} ${WRKSRC}/perforce.conf ${PREFIX}/etc/perforce.conf.default; \
+ if [ ! -f ${PREFIX}/etc/perforce.conf ]; then \
+ ${CP} -p ${PREFIX}/etc/perforce.conf.default ${PREFIX}/etc/perforce.conf; \
fi
${INSTALL_SCRIPT} ${WRKSRC}/perforce.sh ${PREFIX}/etc/rc.d/
-.for PERFMAN in p4 p4d
- ${INSTALL_MAN} ${DISTDIR}/${DIST_SUBDIR}/${PERFMAN}.1 ${PREFIX}/man/man1
+.for f in ${MAN1}
+ ${INSTALL_MAN} ${_DISTDIR}/${f} ${PREFIX}/man/man1/
+.endfor
+.for f in ${BIN_FILES}
+ ${INSTALL_PROGRAM} ${_DISTDIR}/${f} ${PREFIX}/bin/
+.endfor
+.for f in ${SBIN_FILES}
+ ${INSTALL_PROGRAM} ${_DISTDIR}/${f} ${PREFIX}/sbin/
+.endfor
+
+post-install:
+.for f in ${BIN_FILES}
+ ${ECHO} bin/${f} >> ${TMPPLIST}
+.endfor
+.for f in ${SBIN_FILES}
+ ${ECHO} sbin/${f} >> ${TMPPLIST}
.endfor
+ ${ECHO} "@unexec /bin/rmdir ${PERFORCE_ROOT} ${PERFORCE_LOGS} ${PERFORCE_HOME} 2>/dev/null || true" >> ${TMPPLIST}
-.include <bsd.port.mk>
+.include <bsd.port.post.mk>