svn commit: r328480 - in head/ports-mgmt/p5-FreeBSD-Portindex: . files
Matthew Seaman
matthew at FreeBSD.org
Fri Sep 27 14:26:33 UTC 2013
Author: matthew
Date: Fri Sep 27 14:26:32 2013
New Revision: 328480
URL: http://svnweb.freebsd.org/changeset/ports/328480
Log:
- stageify
- move post-install actions into new pkg-install script
Added:
head/ports-mgmt/p5-FreeBSD-Portindex/files/
head/ports-mgmt/p5-FreeBSD-Portindex/files/pkg-install.in (contents, props changed)
Modified:
head/ports-mgmt/p5-FreeBSD-Portindex/Makefile
head/ports-mgmt/p5-FreeBSD-Portindex/pkg-plist (contents, props changed)
Modified: head/ports-mgmt/p5-FreeBSD-Portindex/Makefile
==============================================================================
--- head/ports-mgmt/p5-FreeBSD-Portindex/Makefile Fri Sep 27 14:25:52 2013 (r328479)
+++ head/ports-mgmt/p5-FreeBSD-Portindex/Makefile Fri Sep 27 14:26:32 2013 (r328480)
@@ -21,7 +21,6 @@ RUN_DEPENDS:= ${BUILD_DEPENDS}
OPTIONS_DEFINE= GRAPHVIZ
GRAPHVIS_DESCR= Add GraphViz run-time dependency
-NO_STAGE= yes
.include <bsd.port.options.mk>
.if ${PORT_OPTIONS:MGRAPHVIZ}
@@ -39,28 +38,17 @@ CACHE_MODE?= 0775
CFG_FILE= portindex.cfg
-MAN1= find-updated.1 cache-init.1 cache-update.1 portindex.1 \
- portdepends.1 make-readmes.1
+SUB_FILES+= pkg-install
+SUB_LIST+= CACHE_DIR=${CACHE_DIR} \
+ CACHE_OWNER=${CACHE_OWNER} \
+ CACHE_GROUP=${CACHE_GROUP} \
+ CACHE_MODE=${CACHE_MODE} \
+ CFG_FILE=${PREFIX}/etc/portindex.cfg
-post-install: install-conf install-cache
+post-install: install-conf
install-conf:
cd ${WRKSRC} ; \
- ${INSTALL_DATA} ${CFG_FILE}.sample ${PREFIX}/etc/${CFG_FILE}.sample
- cd ${PREFIX}/etc ; \
- if ${TEST} ! -f ${CFG_FILE} ; then \
- ${CP} -p ${CFG_FILE}.sample ${CFG_FILE} ; \
- fi
-
-# Create the cache directory and make it writable by group 'operator'
-# by default. Only if the cache directory doesn't already exist.
-# Have to do this by hand if installing via pkg.
-
-install-cache:
- if ${TEST} ! -d ${CACHE_DIR} ; then \
- ${MKDIR} ${CACHE_DIR} ; \
- ${CHOWN} ${CACHE_OWNER}:${CACHE_GROUP} ${CACHE_DIR} ; \
- ${CHMOD} ${CACHE_MODE} ${CACHE_DIR} ; \
- fi
+ ${INSTALL_DATA} ${CFG_FILE}.sample ${STAGEDIR}${PREFIX}/etc/${CFG_FILE}.sample
.include <bsd.port.mk>
Added: head/ports-mgmt/p5-FreeBSD-Portindex/files/pkg-install.in
==============================================================================
--- /dev/null 00:00:00 1970 (empty, because file is newly added)
+++ head/ports-mgmt/p5-FreeBSD-Portindex/files/pkg-install.in Fri Sep 27 14:26:32 2013 (r328480)
@@ -0,0 +1,37 @@
+#!/bin/sh
+#
+# $FreeBSD$
+#
+
+PATH=/usr/sbin:/usr/bin:/bin ; export PATH
+
+CACHE_DIR=%%CACHE_DIR%%
+CACHE_OWNER=%%CACHE_OWNER%%
+CACHE_GROUP=%%CACHE_GROUP%%
+CACHE_MODE=%%CACHE_MODE%%
+CFG_FILE=%%CFG_FILE%%
+
+case $2 in
+
+ # Create the cache directory and make it writable by group
+ # 'operator' by default. Only if the cache directory doesn't
+ # already exist. Have to do this by hand if installing via pkg.
+ #
+ # Add default copy of config file if no previous config file
+ # exists.
+
+ POST-INSTALL)
+ if [ ! -d ${CACHE_DIR} ] ; then
+ mkdir -p ${CACHE_DIR}
+ chown ${CACHE_OWNER}:${CACHE_GROUP} ${CACHE_GROUP}
+ chmod ${CACHE_MODE} ${CACHE_DIR}
+ fi
+ if [ ! -f ${CFG_FILE} ] ; then
+ cp -p ${CFG_FILE}.sample ${CFG_FILE}
+ fi
+ ;;
+esac
+
+#
+# That's All Folks!
+#
Modified: head/ports-mgmt/p5-FreeBSD-Portindex/pkg-plist
==============================================================================
--- head/ports-mgmt/p5-FreeBSD-Portindex/pkg-plist Fri Sep 27 14:25:52 2013 (r328479)
+++ head/ports-mgmt/p5-FreeBSD-Portindex/pkg-plist Fri Sep 27 14:26:32 2013 (r328480)
@@ -4,6 +4,12 @@ bin/find-updated
bin/make-readmes
bin/portindex
bin/portdepends
+man/man1/cache-init.1.gz
+man/man1/cache-update.1.gz
+man/man1/find-updated.1.gz
+man/man1/make-readmes.1.gz
+man/man1/portdepends.1.gz
+man/man1/portindex.1.gz
@unexec if cmp -s %D/etc/portindex.cfg.sample %D/etc/portindex.cfg ; then rm -f %D/etc/portindex.cfg ; fi
etc/portindex.cfg.sample
@exec [ ! -f %B/portindex.cfg ] && cp -p %B/%f %B/portindex.cfg || true
More information about the svn-ports-all
mailing list