aboutsummaryrefslogtreecommitdiff
path: root/ports-mgmt
diff options
context:
space:
mode:
authorMatthew Seaman <matthew@FreeBSD.org>2015-05-29 20:01:47 +0000
committerMatthew Seaman <matthew@FreeBSD.org>2015-05-29 20:01:47 +0000
commitedb1d63141bfadf282bdb31197ac08a07cbfe0cd (patch)
tree583fb145ed4a458c217ee8c2fab58a876d0c6cf4 /ports-mgmt
parent4490e311f6943fecb54533e92a055006e5640821 (diff)
downloadports-edb1d63141bfadf282bdb31197ac08a07cbfe0cd.tar.gz
ports-edb1d63141bfadf282bdb31197ac08a07cbfe0cd.zip
- Use @sample
- Manager cache directory owner/group/permissions from plist instaead of scripts, unbreak build from plain user - Simplify installation - Use canonical statement order - Fix option description PR: 200520 Submitted by: amdmi3
Notes
Notes: svn path=/head/; revision=387886
Diffstat (limited to 'ports-mgmt')
-rw-r--r--ports-mgmt/p5-FreeBSD-Portindex/Makefile33
-rw-r--r--ports-mgmt/p5-FreeBSD-Portindex/files/pkg-deinstall.in23
-rw-r--r--ports-mgmt/p5-FreeBSD-Portindex/files/pkg-install.in33
-rw-r--r--ports-mgmt/p5-FreeBSD-Portindex/pkg-plist5
4 files changed, 15 insertions, 79 deletions
diff --git a/ports-mgmt/p5-FreeBSD-Portindex/Makefile b/ports-mgmt/p5-FreeBSD-Portindex/Makefile
index 7c10ac0d2f43..68fc578e97d9 100644
--- a/ports-mgmt/p5-FreeBSD-Portindex/Makefile
+++ b/ports-mgmt/p5-FreeBSD-Portindex/Makefile
@@ -3,7 +3,7 @@
PORTNAME= FreeBSD-Portindex
PORTVERSION= 3.4
-PORTREVISION= 2
+PORTREVISION= 3
CATEGORIES= ports-mgmt perl5
MASTER_SITES= http://www.infracaninophile.co.uk/portindex/
PKGNAMEPREFIX= p5-
@@ -16,20 +16,9 @@ LICENSE= BSD2CLAUSE
BUILD_DEPENDS= p5-BerkeleyDB>0:${PORTSDIR}/databases/p5-BerkeleyDB
RUN_DEPENDS:= ${BUILD_DEPENDS}
-NO_ARCH= yes
-
-# GraphViz not required for portindex to run or generate GraphViz
-# format output: this is only needed to render the output on the same
-# machine.
-OPTIONS_DEFINE= GRAPHVIZ
-GRAPHVIS_DESCR= Add GraphViz run-time dependency
-
-.include <bsd.port.options.mk>
-
-GRAPHVIZ_RUN_DEPENDS= dot:${PORTSDIR}/graphics/graphviz
-
-USES+= perl5 tar:xz
+USES= perl5 tar:xz
USE_PERL5= configure
+NO_ARCH= yes
CACHE_DIR?= /var/db/portindex
CACHE_OWNER?= root
@@ -38,16 +27,20 @@ CACHE_MODE?= 0775
CFG_FILE= portindex.cfg
-SUB_FILES+= pkg-install pkg-deinstall
-SUB_LIST+= CACHE_DIR=${CACHE_DIR} \
+PLIST_SUB+= CACHE_DIR=${CACHE_DIR} \
CACHE_OWNER=${CACHE_OWNER} \
CACHE_GROUP=${CACHE_GROUP} \
CACHE_MODE=${CACHE_MODE}
-post-install: install-conf
+# GraphViz not required for portindex to run or generate GraphViz
+# format output: this is only needed to render the output on the same
+# machine.
+OPTIONS_DEFINE= GRAPHVIZ
+GRAPHVIZ_DESC= Add GraphViz run-time dependency
+GRAPHVIZ_RUN_DEPENDS= dot:${PORTSDIR}/graphics/graphviz
-install-conf:
- cd ${WRKSRC} ; \
- ${INSTALL_DATA} ${CFG_FILE}.sample ${STAGEDIR}${PREFIX}/etc/${CFG_FILE}.sample
+post-install:
+ ${MKDIR} ${STAGEDIR}${CACHE_DIR}
+ ${INSTALL_DATA} ${WRKSRC}/${CFG_FILE}.sample ${STAGEDIR}${PREFIX}/etc/${CFG_FILE}.sample
.include <bsd.port.mk>
diff --git a/ports-mgmt/p5-FreeBSD-Portindex/files/pkg-deinstall.in b/ports-mgmt/p5-FreeBSD-Portindex/files/pkg-deinstall.in
deleted file mode 100644
index fa79034099ab..000000000000
--- a/ports-mgmt/p5-FreeBSD-Portindex/files/pkg-deinstall.in
+++ /dev/null
@@ -1,23 +0,0 @@
-#!/bin/sh
-#
-# $FreeBSD$
-#
-
-PATH=/usr/sbin:/usr/bin:/bin ; export PATH
-
-CACHE_DIR=%%CACHE_DIR%%
-
-case $2 in
-
- # Remove the cache directory, but only if it is empty.
-
- POST-DEINSTALL)
- if [ ! -d ${CACHE_DIR} ] ; then
- rmdir ${CACHE_DIR} >/dev/null 2>&1 || true
- fi
- ;;
-esac
-
-#
-# That's All Folks!
-#
diff --git a/ports-mgmt/p5-FreeBSD-Portindex/files/pkg-install.in b/ports-mgmt/p5-FreeBSD-Portindex/files/pkg-install.in
deleted file mode 100644
index efa3f50ca131..000000000000
--- a/ports-mgmt/p5-FreeBSD-Portindex/files/pkg-install.in
+++ /dev/null
@@ -1,33 +0,0 @@
-#!/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%%
-
-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
- ;;
-esac
-
-#
-# That's All Folks!
-#
diff --git a/ports-mgmt/p5-FreeBSD-Portindex/pkg-plist b/ports-mgmt/p5-FreeBSD-Portindex/pkg-plist
index 050f8eb0c62a..c45b43fe20af 100644
--- a/ports-mgmt/p5-FreeBSD-Portindex/pkg-plist
+++ b/ports-mgmt/p5-FreeBSD-Portindex/pkg-plist
@@ -10,9 +10,7 @@ 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
+@sample etc/portindex.cfg.sample
%%SITE_PERL%%/FreeBSD/Portindex/Category.pm
%%SITE_PERL%%/FreeBSD/Portindex/Config.pm
%%SITE_PERL%%/FreeBSD/Portindex/FileObject.pm
@@ -23,3 +21,4 @@ etc/portindex.cfg.sample
%%SITE_PERL%%/FreeBSD/Portindex/PortsTreeObject.pm
%%SITE_PERL%%/FreeBSD/Portindex/Tree.pm
%%SITE_PERL%%/FreeBSD/Portindex/TreeObject.pm
+@dir(%%CACHE_OWNER%%,%%CACHE_GROUP%%,%%CACHE_MODE%%) %%CACHE_DIR%%