From 1938fbc4fc3d24d5b31a8156681b3764c217fd09 Mon Sep 17 00:00:00 2001 From: pvalchev Date: Thu, 14 Jun 2001 03:18:27 +0000 Subject: [PATCH] Bring this into the XXI century: * Place the sample config file in ${SYSCONFDIR} and make that the default path (instead of lib/) * Correct path to template file - share/examples * Use INSTALL/DEINSTALL scripts to place the config file and print the appropriate warnings instead of messing with @exec/@unexec in PLIST * Don't mess with permissions in the install target, use BSD_INSTALL* macros * Rename patch, make -> ${MAKE_PROGRAM} * Run DESCR through fmt(1) work by me and naddy@ --- sysutils/idled/Makefile | 11 ++- .../patches/{patch-aa => patch-Makefile} | 89 +++++++------------ sysutils/idled/pkg/DEINSTALL | 24 +++++ sysutils/idled/pkg/DESCR | 9 +- sysutils/idled/pkg/INSTALL | 65 ++++++++++++++ sysutils/idled/pkg/PLIST | 13 +-- 6 files changed, 136 insertions(+), 75 deletions(-) rename sysutils/idled/patches/{patch-aa => patch-Makefile} (66%) create mode 100644 sysutils/idled/pkg/DEINSTALL create mode 100644 sysutils/idled/pkg/INSTALL diff --git a/sysutils/idled/Makefile b/sysutils/idled/Makefile index f004ef69248..47da488139c 100644 --- a/sysutils/idled/Makefile +++ b/sysutils/idled/Makefile @@ -1,4 +1,4 @@ -# $OpenBSD: Makefile,v 1.9 2001/05/06 03:59:01 lebel Exp $ +# $OpenBSD: Makefile,v 1.10 2001/06/14 03:18:27 pvalchev Exp $ COMMENT= "log out idle users and those hogging resources" @@ -10,13 +10,16 @@ NEED_VERSION= 1.402 MAINTAINER= ports@openbsd.org +FAKE_FLAGS= PREFIX=${PREFIX} DESTDIR=${WRKINST} + PERMIT_PACKAGE_CDROM= "no fee" PERMIT_PACKAGE_FTP= Yes PERMIT_DISTFILES_CDROM= "no fee" PERMIT_DISTFILES_FTP= Yes -post-extract: - @cd ${WRKSRC}; make clean +MAKE_ENV= SYSCONFDIR="${SYSCONFDIR}" + +post-extract: + @cd ${WRKSRC} && ${MAKE_PROGRAM} clean -FAKE_FLAGS=PREFIX=${PREFIX} DESTDIR=${WRKINST} .include diff --git a/sysutils/idled/patches/patch-aa b/sysutils/idled/patches/patch-Makefile similarity index 66% rename from sysutils/idled/patches/patch-aa rename to sysutils/idled/patches/patch-Makefile index bcc20cd01bd..cbf68e19dbe 100644 --- a/sysutils/idled/patches/patch-aa +++ b/sysutils/idled/patches/patch-Makefile @@ -1,5 +1,6 @@ ---- Makefile.orig Fri May 17 00:05:28 1996 -+++ Makefile Mon Mar 12 16:10:10 2001 +$OpenBSD: patch-Makefile,v 1.1 2001/06/14 03:18:28 pvalchev Exp $ +--- Makefile.orig Thu May 16 16:05:28 1996 ++++ Makefile Tue Jun 12 19:44:17 2001 @@ -2,7 +2,6 @@ # @@ -8,7 +9,7 @@ RM = rm INCLUDE = -@@ -165,27 +164,27 @@ INCLUDE = +@@ -165,16 +164,17 @@ INCLUDE = # If you add it, '-lkvm' must also be added to the SPECLIBS line # You will need to delete parse.c before compiling! You can either # do so by hand, or do a 'make clean' followed by the normal 'make'. @@ -26,32 +27,14 @@ -#LOGDEST = /var/log +DEST = ${DESTDIR}${PREFIX}/libexec +CFLIB = ${DESTDIR}${PREFIX}/lib -+CFDEST = ${DESTDIR}/etc ++CFDEST = ${DESTDIR}${PREFIX}/share/examples/idled ++SYSCONF = ${SYSCONFDIR} +MDEST = ${DESTDIR}${PREFIX}/man +LOGDEST = /var/log # --#OWNER = root --#CFOWNER = root --#MOWNER = man -+OWNER = root -+CFOWNER = root -+MOWNER = root - # --#GROUP = daemon --#CFGROUP = daemon -+GROUP = daemon -+CFGROUP = daemon - # --#MODE = 750 --#CFMODE = 664 --#MMODE = 444 -+MODE = 755 -+CFMODE = 664 -+MMODE = 444 - - ###################################################################### - ###################################################################### -@@ -215,25 +214,25 @@ INCLUDE = + #OWNER = root + #CFOWNER = root +@@ -215,14 +215,14 @@ INCLUDE = # SVR4 -- Solaris 2.x # Use install3 for /usr/sbin/install # and install1 for /usr/ucb/install @@ -66,34 +49,22 @@ +#DEFS += -DSYSV -DHAVE_PROC_FS -DUTMPPID -DHAVE_SETSID -DHAVE_UTMPX -DUTMPHOST -DRUDEKILL +#SPECLIBS = +#INSTTYPE = install3 - --OWNER = root --CFOWNER = root --MOWNER = root ++ +#DEST = /usr/local/bin +#CFDEST = /usr/local/lib +#MDEST = /usr/local/man +#LOGDEST = /var/log --GROUP = root --CFGROUP = root -+#OWNER = root -+#CFOWNER = root -+#MOWNER = root + OWNER = root + CFOWNER = root +@@ -422,13 +422,13 @@ CFMAN = idled.cf.5 + PMAN = idled.8 --MODE = 750 --CFMODE = 664 --MMODE = 644 -+#GROUP = root -+#CFGROUP = root -+ -+#MODE = 750 -+#CFMODE = 664 -+#MMODE = 644 + # Names of config and log files +-CONFIG = ${CFDEST}/${COMMFILE} ++CONFIG = ${SYSCONF}/${COMMFILE} + LOGFILE = ${LOGDEST}/idled.log - ###################################################################### - ###################################################################### -@@ -428,7 +427,7 @@ LOGFILE = ${LOGDEST}/idled.log # HERE are the big CFLAGS # Add -g if you want debugging # Add -O or whatever variant for optimization @@ -102,31 +73,35 @@ # For HP's ANSI C compiler (use -g instead of +O3 for debugging) # CFLAGS = +O3 -Aa -D_HPUX_SOURCE ${DEFS} ${DEBUG} -DCONFIG=\"${CONFIG}\" -DLOGFILE=\"${LOGFILE}\" ${INCLUDE} -@@ -479,18 +478,16 @@ install1: all +@@ -479,18 +479,17 @@ install1: all @echo "file can serve as a guide, as well as the man pages." # BSD like, but with some enhancements like: install -s -> strip binary -# gzip manual pages install1a: all - install -s -c -m ${MODE} -o ${OWNER} -g ${GROUP} ${BINARY} ${DEST} +- install -s -c -m ${MODE} -o ${OWNER} -g ${GROUP} ${BINARY} ${DEST} - install -c -m ${CFMODE} -o ${CFOWNER} -g ${CFGROUP} ${COMMFILE}.template ${CFDEST} -+ install -c -m ${CFMODE} -o ${CFOWNER} -g ${CFGROUP} ${COMMFILE}.template ${CFLIB} - install -c -m ${MMODE} -o ${MOWNER} ${CFMAN} ${MDEST}/man5 +- install -c -m ${MMODE} -o ${MOWNER} ${CFMAN} ${MDEST}/man5 - gzip -f ${MDEST}/man5/${CFMAN} - install -c -m ${MMODE} -o ${MOWNER} ${PMAN} ${MDEST}/man8 +- install -c -m ${MMODE} -o ${MOWNER} ${PMAN} ${MDEST}/man8 - gzip -f ${MDEST}/man8/${PMAN} ++ ${BSD_INSTALL_PROGRAM} ${BINARY} ${DEST} ++ ${BSD_INSTALL_DATA_DIR} ${CFDEST} ++ ${BSD_INSTALL_DATA} ${COMMFILE}.template ${CFDEST} ++ ${BSD_INSTALL_MAN} ${CFMAN} ${MDEST}/man5 ++ ${BSD_INSTALL_MAN} ${PMAN} ${MDEST}/man8 ++ @echo "" ++ @echo "*** Be sure to edit/create the file ${CONFIG} based on" ++ @echo "*** the needs for your system. The ${CFLIB}/${COMMFILE}.template" ++ @echo "*** file can serve as a guide, as well as the man pages." @echo "" - @echo "Be sure to edit/create the file ${CONFIG} based on" - @echo "the needs for your system. The ${CONFIG}.template" - @echo "file can serve as a guide, as well as the man pages." -+ @echo "*** Be sure to edit/create the file ${CONFIG} based on" -+ @echo "*** the needs for your system. The ${CFLIB}/${COMMFILE}.template" -+ @echo "*** file can serve as a guide, as well as the man pages." -+ @echo "" # Aix Prefers install2 install2: all -@@ -527,7 +524,7 @@ ${MAN}: idled.man.form idled.cf.man.form +@@ -527,7 +526,7 @@ ${MAN}: idled.man.form idled.cf.man.form lint: ${SRC} ${SRCg} lint -hxn ${DEFS} ${SRC} ${SRCg} diff --git a/sysutils/idled/pkg/DEINSTALL b/sysutils/idled/pkg/DEINSTALL new file mode 100644 index 00000000000..7e46e241873 --- /dev/null +++ b/sysutils/idled/pkg/DEINSTALL @@ -0,0 +1,24 @@ +# $OpenBSD: DEINSTALL,v 1.1 2001/06/14 03:18:29 pvalchev Exp $ +# +# idled de-installation + +set -e +PATH=/bin:/usr/bin:/sbin:/usr/sbin +PREFIX=${PKG_PREFIX:-/usr/local} +CONFIG_FILE=${SYSCONFDIR}/idled.cf + +if [ -f $CONFIG_FILE ]; then + echo + echo "+---------------" + echo "| To completely deinstall the $1 package you need to perform" + echo "| this step as root:" + echo "|" + echo "| rm -f $CONFIG_FILE" + echo "|" + echo "| Do not do this if you plan on re-installing $1" + echo "| at some future time." + echo "+---------------" + echo +fi + +exit 0 diff --git a/sysutils/idled/pkg/DESCR b/sysutils/idled/pkg/DESCR index 0992063de35..d871bc36e27 100644 --- a/sysutils/idled/pkg/DESCR +++ b/sysutils/idled/pkg/DESCR @@ -1,4 +1,5 @@ -This is a port of idled by Michael P. Crider. Idled is a daemon that runs on a -machine to keep an eye on current users. If users have been idle for too long, -or have been logged on for too long, or have logged in too many times, it will -warn them and log them out appropriately. +This is a port of idled by Michael P. Crider. Idled is a +daemon that runs on a machine to keep an eye on current +users. If users have been idle for too long, or have been +logged on for too long, or have logged in too many times, it +will warn them and log them out appropriately. diff --git a/sysutils/idled/pkg/INSTALL b/sysutils/idled/pkg/INSTALL new file mode 100644 index 00000000000..9dc91c56c05 --- /dev/null +++ b/sysutils/idled/pkg/INSTALL @@ -0,0 +1,65 @@ +#!/bin/sh +# $OpenBSD: INSTALL,v 1.1 2001/06/14 03:18:30 pvalchev Exp $ +# +# Pre/post-installation setup of idled + +# exit on errors, use a sane path and install prefix +# +set -e +PATH=/bin:/usr/bin:/sbin:/usr/sbin +PREFIX=${PKG_PREFIX:-/usr/local} +CONFIG_FILE=${SYSCONFDIR}/idled.cf +SAMPLE_CONFIG_FILE=$PREFIX/share/examples/idled/idled.cf.template + +do_notice() +{ + echo + echo "+---------------" + echo "| The existing $1 configuration file, $CONFIG_FILE," + echo "| has NOT been changed. You may want to compare it to the" + echo "| current sample file, $SAMPLE_CONFIG_FILE," + echo "| and update your configuration as needed." + echo "+---------------" + echo +} + +do_install() +{ + install -o root -g wheel -m 644 $SAMPLE_CONFIG_FILE $CONFIG_FILE + echo + echo "+---------------" + echo "| The $1 configuration file, $CONFIG_FILE," + echo "| has been installed. Please view this file and change" + echo "| the configuration to meet your needs" + echo "+---------------" + echo + +} + +# verify proper execution +# +if [ $# -ne 2 ]; then + echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2 + exit 1 +fi + +# Verify/process the command +# +case $2 in + PRE-INSTALL) + : nothing to pre-install for this port + ;; + POST-INSTALL) + if [ -f $CONFIG_FILE ]; then + do_notice $1 + else + do_install $1 + fi + ;; + *) + echo "usage: $0 distname { PRE-INSTALL | POST-INSTALL }" >&2 + exit 1 + ;; +esac + +exit 0 diff --git a/sysutils/idled/pkg/PLIST b/sysutils/idled/pkg/PLIST index bf780cb71ea..a1500ac41e8 100644 --- a/sysutils/idled/pkg/PLIST +++ b/sysutils/idled/pkg/PLIST @@ -1,13 +1,6 @@ -lib/idled.cf.template +@comment $OpenBSD: PLIST,v 1.5 2001/06/14 03:18:30 pvalchev Exp $ libexec/idled man/man5/idled.cf.5 man/man8/idled.8 -@exec echo "" -@exec echo "*** Be sure to edit/create the file /etc/idled.cf based on" -@exec echo "*** the needs for your system. The /usr/local/lib/idled.cf.template" -@exec echo "*** file can serve as a guide, as well as the man pages." -@exec echo "" -@unexec echo "" -@unexec echo "*** To completely remove this package be sure to delete the" -@unexec echo "*** /etc/idled.cf from your system." -@unexec echo "" +share/examples/idled/idled.cf.template +@dirrm share/examples/idled