From owner-svn-ports-head@FreeBSD.ORG Fri Sep 27 14:26:33 2013 Return-Path: Delivered-To: svn-ports-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id AD16D8CD; Fri, 27 Sep 2013 14:26:33 +0000 (UTC) (envelope-from matthew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.freebsd.org (Postfix) with ESMTPS id 9A19D2530; Fri, 27 Sep 2013 14:26:33 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r8REQXPD029945; Fri, 27 Sep 2013 14:26:33 GMT (envelope-from matthew@svn.freebsd.org) Received: (from matthew@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r8REQXVu029939; Fri, 27 Sep 2013 14:26:33 GMT (envelope-from matthew@svn.freebsd.org) Message-Id: <201309271426.r8REQXVu029939@svn.freebsd.org> From: Matthew Seaman Date: Fri, 27 Sep 2013 14:26:33 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r328480 - in head/ports-mgmt/p5-FreeBSD-Portindex: . files X-SVN-Group: ports-head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Sep 2013 14:26:33 -0000 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 .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 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