aboutsummaryrefslogtreecommitdiffstats
path: root/ports-mgmt
diff options
context:
space:
mode:
authorMatthew Seaman <matthew@FreeBSD.org>2013-09-27 22:26:32 +0800
committerMatthew Seaman <matthew@FreeBSD.org>2013-09-27 22:26:32 +0800
commit00bf041f4b5033433b6bebfe0deb753d2b99aad7 (patch)
treedc251550ae551242814abef511b1cc20334f970d /ports-mgmt
parent89989f99245d4a57960d5721b210ef16980542b3 (diff)
downloadfreebsd-ports-gnome-00bf041f4b5033433b6bebfe0deb753d2b99aad7.tar.gz
freebsd-ports-gnome-00bf041f4b5033433b6bebfe0deb753d2b99aad7.tar.zst
freebsd-ports-gnome-00bf041f4b5033433b6bebfe0deb753d2b99aad7.zip
- stageify
- move post-install actions into new pkg-install script
Diffstat (limited to 'ports-mgmt')
-rw-r--r--ports-mgmt/p5-FreeBSD-Portindex/Makefile28
-rw-r--r--ports-mgmt/p5-FreeBSD-Portindex/files/pkg-install.in37
-rw-r--r--ports-mgmt/p5-FreeBSD-Portindex/pkg-plist6
3 files changed, 51 insertions, 20 deletions
diff --git a/ports-mgmt/p5-FreeBSD-Portindex/Makefile b/ports-mgmt/p5-FreeBSD-Portindex/Makefile
index 68ff2dc42c9d..f41707aebdfa 100644
--- a/ports-mgmt/p5-FreeBSD-Portindex/Makefile
+++ b/ports-mgmt/p5-FreeBSD-Portindex/Makefile
@@ -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>
diff --git a/ports-mgmt/p5-FreeBSD-Portindex/files/pkg-install.in b/ports-mgmt/p5-FreeBSD-Portindex/files/pkg-install.in
new file mode 100644
index 000000000000..baf28ebae373
--- /dev/null
+++ b/ports-mgmt/p5-FreeBSD-Portindex/files/pkg-install.in
@@ -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!
+#
diff --git a/ports-mgmt/p5-FreeBSD-Portindex/pkg-plist b/ports-mgmt/p5-FreeBSD-Portindex/pkg-plist
index 21d4e5b71f9a..875cd50f086c 100644
--- a/ports-mgmt/p5-FreeBSD-Portindex/pkg-plist
+++ b/ports-mgmt/p5-FreeBSD-Portindex/pkg-plist
@@ -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