diff options
author | bapt <bapt@FreeBSD.org> | 2014-06-06 06:57:49 +0800 |
---|---|---|
committer | bapt <bapt@FreeBSD.org> | 2014-06-06 06:57:49 +0800 |
commit | 443841a23789c76e693014876c55f8e6e8b52ac4 (patch) | |
tree | d5971c8ac5fa4f46bafb2e4009e91a8bcfeba490 | |
parent | fb16e47866d332bb2c51549a170f1745b33d3011 (diff) | |
download | freebsd-ports-gnome-443841a23789c76e693014876c55f8e6e8b52ac4.tar.gz freebsd-ports-gnome-443841a23789c76e693014876c55f8e6e8b52ac4.tar.zst freebsd-ports-gnome-443841a23789c76e693014876c55f8e6e8b52ac4.zip |
Support stage
Modernisation:
- Use @sample
- Install pam files into prefix
- Use USERS/GROUPS framework
- Remove now useless pkg-install/pkg-deinstall scripts
PR: 190162
Submitted by: Zsolt Udvari
-rw-r--r-- | sysutils/fcron/Makefile | 53 | ||||
-rw-r--r-- | sysutils/fcron/pkg-deinstall | 21 | ||||
-rw-r--r-- | sysutils/fcron/pkg-install | 41 | ||||
-rw-r--r-- | sysutils/fcron/pkg-plist | 43 |
4 files changed, 51 insertions, 107 deletions
diff --git a/sysutils/fcron/Makefile b/sysutils/fcron/Makefile index 5f392f16f0c2..46fddf71d12a 100644 --- a/sysutils/fcron/Makefile +++ b/sysutils/fcron/Makefile @@ -3,7 +3,7 @@ PORTNAME= fcron PORTVERSION= 3.0.6 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= sysutils MASTER_SITES= ${MASTER_SITE_SUNSITE} \ http://fcron.free.fr/archives/ \ @@ -14,6 +14,8 @@ DISTNAME= ${PORTNAME}-${PORTVERSION}.src MAINTAINER= rde@tavi.co.uk COMMENT= A periodic command scheduler +OPTIONS_DEFINE= DOCS EXAMPLES + GNU_CONFIGURE= yes USES= perl5 gmake USE_PERL5= build @@ -24,13 +26,12 @@ CONFIGURE_ARGS= --with-etcdir=${PREFIX}/etc --localstatedir=/var \ WRKSRC= ${WRKDIR}/fcron-${PORTVERSION} +USERS= fcron +GROUPS= fcron + USE_RC_SUBR= fcron SUB_FILES= pkg-message -MAN1= fcrontab.1 -MAN5= fcron.conf.5 fcrontab.5 -MAN8= fcron.8 - PAMDIR?= /etc/pam.d PLIST_SUB+= PAMDIR=etc/pam.d @@ -42,37 +43,25 @@ DOCSRC= ${WRKSRC}/doc/${MANLANG} DOCSRC= ${WRKSRC}/doc/en .endif -LICENSE= GPLv2 - -NO_STAGE= yes -pre-su-install: - @PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL - do-install: - ${INSTALL_PROGRAM} ${WRKSRC}/fcron ${PREFIX}/sbin - ${INSTALL_PROGRAM} -g fcron -o fcron -m 6111 ${WRKSRC}/fcrontab ${PREFIX}/bin - ${INSTALL_PROGRAM} -g fcron -o fcron -m 6111 ${WRKSRC}/fcrondyn ${PREFIX}/bin - ${INSTALL_PROGRAM} -g fcron -m 4110 ${WRKSRC}/fcronsighup ${PREFIX}/bin + ${INSTALL_PROGRAM} ${WRKSRC}/fcron ${STAGEDIR}${PREFIX}/sbin + ${INSTALL_PROGRAM} ${WRKSRC}/fcrontab ${STAGEDIR}${PREFIX}/bin + ${INSTALL_PROGRAM} ${WRKSRC}/fcrondyn ${STAGEDIR}${PREFIX}/bin + ${INSTALL_PROGRAM} ${WRKSRC}/fcronsighup ${STAGEDIR}${PREFIX}/bin .for f in fcron.allow fcron.conf fcron.deny - ${INSTALL_DATA} -g fcron -m 640 ${WRKSRC}/files/${f} ${PREFIX}/etc/${f}.dist + ${INSTALL_DATA} -m 640 ${WRKSRC}/files/${f} ${STAGEDIR}${PREFIX}/etc/${f}.sample .endfor - ${MKDIR} ${EXAMPLESDIR} - ${INSTALL_DATA} ${FILESDIR}/fcrontab-* ${WRKSRC}/files/*.pam ${EXAMPLESDIR} - ${MKDIR} ${PAMDIR} - [ -f ${PAMDIR}/fcron ] || ${INSTALL_DATA} ${WRKSRC}/files/fcron.pam ${PAMDIR}/fcron - [ -f ${PAMDIR}/fcrontab ] || ${INSTALL_DATA} ${WRKSRC}/files/fcrontab.pam ${PAMDIR}/fcrontab + ${MKDIR} ${STAGEDIR}${EXAMPLESDIR} + ${INSTALL_DATA} ${FILESDIR}/fcrontab-* ${WRKSRC}/files/*.pam ${STAGEDIR}${EXAMPLESDIR} + ${INSTALL_DATA} ${WRKSRC}/files/fcron.pam ${STAGEDIR}${PREFIX}${PAMDIR}/fcron + ${INSTALL_DATA} ${WRKSRC}/files/fcrontab.pam ${STAGEDIR}${PREFIX}${PAMDIR}/fcrontab + install -d -m 770 ${STAGEDIR}/var/spool/fcron .for n in 1 5 8 - ${INSTALL_MAN} ${MAN${n}:S|^|${DOCSRC}/man/|} ${PREFIX}/man/man${n} + ${INSTALL_MAN} ${DOCSRC}/man/*.${n} ${STAGEDIR}${PREFIX}/man/man${n} +.endfor +.for d in txt HTML + ${MKDIR} ${STAGEDIR}${DOCSDIR}/${d} + ${INSTALL_DATA} ${DOCSRC}/${d}/* ${STAGEDIR}${DOCSDIR}/${d} .endfor -.if !defined(NOPORTDOCS) -. for d in txt HTML - ${MKDIR} ${DOCSDIR}/${d} - ${INSTALL_DATA} ${DOCSRC}/${d}/* ${DOCSDIR}/${d} -. endfor -.endif - -post-install: - @PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL - @${CAT} ${PKGMESSAGE} .include <bsd.port.mk> diff --git a/sysutils/fcron/pkg-deinstall b/sysutils/fcron/pkg-deinstall deleted file mode 100644 index c57341fd829f..000000000000 --- a/sysutils/fcron/pkg-deinstall +++ /dev/null @@ -1,21 +0,0 @@ -#!/bin/sh -if [ "$2" = DEINSTALL ]; then - echo "===============================================================================" - echo "If you are permanently removing this port:" - echo "" - echo "- You should manually remove the fcron user and group." - - /bin/rmdir /var/spool/fcron 2>/dev/null - if [ -d /var/spool/fcron ]; then - echo "- You should manually remove the /var/spool/fcron directory." - fi - - for f in fcron.allow fcron.conf fcron.deny; do - if /usr/bin/cmp -s $PKG_PREFIX/etc/$f $PKG_PREFIX/etc/$f.dist; then - /bin/rm -f $PKG_PREFIX/etc/$f - else - echo "- You should manually remove the $PKG_PREFIX/etc/$f file." - fi - done - echo "===============================================================================" -fi diff --git a/sysutils/fcron/pkg-install b/sysutils/fcron/pkg-install deleted file mode 100644 index a4fe55d028f0..000000000000 --- a/sysutils/fcron/pkg-install +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/sh - -if [ "$2" = PRE-INSTALL ]; then - user=fcron - group=fcron - uid=247 - gid=247 - - if /usr/sbin/pw groupshow $group 2>/dev/null; then - echo "Using already existing group \"$group\"." - else - if /usr/sbin/pw groupadd $group -g $gid; then - echo "Added group \"$group\"." - else - echo "Unable to add group \"$group\"." - echo "Please create it manually and try again." - exit 1 - fi - fi - - if /usr/sbin/pw usershow $user 2>/dev/null; then - echo "Using already existing user \"$user\"." - else - if /usr/sbin/pw useradd $user -u $uid -g $group -s /sbin/nologin -c "fcron pseudo-user"; then - echo "Added user \"$user\"." - else - echo "Unable to add user \"$user\"." - echo "Please create it manually and try again." - exit 1 - fi - fi -elif [ "$2" = POST-INSTALL ]; then - /usr/bin/install -o fcron -g fcron -m 770 -d /var/spool/fcron - - for f in fcron.allow fcron.conf fcron.deny; do - if ! [ -e $PKG_PREFIX/etc/$f ]; then - /usr/bin/install -o root -g fcron -m 640 \ - $PKG_PREFIX/etc/$f.dist $PKG_PREFIX/etc/$f - fi - done -fi diff --git a/sysutils/fcron/pkg-plist b/sysutils/fcron/pkg-plist index 61a28fe049cb..fb075abba5c3 100644 --- a/sysutils/fcron/pkg-plist +++ b/sysutils/fcron/pkg-plist @@ -1,16 +1,33 @@ -bin/fcronsighup -bin/fcrontab +%%PAMDIR%%/fcron +%%PAMDIR%%/fcrontab +@mode 6111 +@owner fcron +@group fcron bin/fcrondyn -etc/fcron.allow.dist -etc/fcron.conf.dist -etc/fcron.deny.dist +bin/fcrontab +@mode 4110 +bin/fcronsighup +@mode +@sample etc/fcron.allow.sample +@sample etc/fcron.conf.sample +@sample etc/fcron.deny.sample +@owner root +@group wheel +man/man1/fcrondyn.1.gz +man/man1/fcrontab.1.gz +man/man5/fcron.conf.5.gz +man/man5/fcrontab.5.gz +man/man8/fcron.8.gz sbin/fcron -%%EXAMPLESDIR%%/fcrontab-operator -%%EXAMPLESDIR%%/fcrontab-root -%%EXAMPLESDIR%%/fcron.pam -%%EXAMPLESDIR%%/fcrontab.pam -@dirrm %%EXAMPLESDIR%% +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/fcron.pam +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/fcrontab-operator +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/fcrontab-root +%%PORTEXAMPLES%%%%EXAMPLESDIR%%/fcrontab.pam +%%PORTEXAMPLES%%@dirrmtry %%EXAMPLESDIR%% @cwd / -%%PAMDIR%%/fcron -%%PAMDIR%%/fcrontab -@dirrmtry %%PAMDIR%% +@exec install -d -o fcron -g fcron -m 770 /var/spool/fcron +@owner fcron +@group fcron +@dirrmtry /var/spool/fcron +@owner root +@group wheel |