diff options
author | pav <pav@FreeBSD.org> | 2004-06-03 00:47:02 +0800 |
---|---|---|
committer | pav <pav@FreeBSD.org> | 2004-06-03 00:47:02 +0800 |
commit | 25ad05358aeb6d1cac232f2d0d3cf8372c97078b (patch) | |
tree | 3eeeddcb78f6dd3d6cf140fe11766c60bb6b9460 /misc | |
parent | 7209f412a24408178b072da7c68da48df7084e43 (diff) | |
download | freebsd-ports-gnome-25ad05358aeb6d1cac232f2d0d3cf8372c97078b.tar.gz freebsd-ports-gnome-25ad05358aeb6d1cac232f2d0d3cf8372c97078b.tar.zst freebsd-ports-gnome-25ad05358aeb6d1cac232f2d0d3cf8372c97078b.zip |
- Give maintainership to submitter
- Turn into master slave to allow slaves of different architectures
- Remove user/group on deinstall
- Install rc script as .sample
- Various tweaks
PR: ports/67463
Submitted by: Tim Bishop <tim@bishnet.net>
Diffstat (limited to 'misc')
-rw-r--r-- | misc/dnetc/Makefile | 70 | ||||
-rw-r--r-- | misc/dnetc/files/INFO | 5 | ||||
-rw-r--r-- | misc/dnetc/files/dnetc.sh | 7 | ||||
-rw-r--r-- | misc/dnetc/pkg-deinstall | 28 | ||||
-rw-r--r-- | misc/dnetc/pkg-descr | 3 | ||||
-rw-r--r-- | misc/dnetc/pkg-install | 16 | ||||
-rw-r--r-- | misc/dnetc/pkg-message | 9 | ||||
-rw-r--r-- | misc/dnetc/pkg-plist | 10 |
8 files changed, 87 insertions, 61 deletions
diff --git a/misc/dnetc/Makefile b/misc/dnetc/Makefile index fb428d85c100..94411c49cc86 100644 --- a/misc/dnetc/Makefile +++ b/misc/dnetc/Makefile @@ -6,33 +6,39 @@ # PORTNAME= dnetc -PORTVERSION= 2.9007.489 -PORTREVISION= 0 +# Slave ports may try to override this +PORTVERSION?= 2.9007.489 PORTEPOCH= 1 CATEGORIES= misc MASTER_SITES= ftp://ftp.distributed.net/pub/dcti/%SUBDIR%/ \ http://http.distributed.net/pub/dcti/%SUBDIR%/ MASTER_SITE_SUBDIR= ${PORTVERSION:S/^/v/:R} -DISTFILES= dnetc${PORTVERSION:E}-freebsd-x86-elf.tar.gz +# This is architecture dependent +DISTNAME= dnetc${PORTVERSION:E}-freebsd-${ARCH:S/i386/x86/}-elf -MAINTAINER= ports@FreeBSD.org +MAINTAINER= tim@bishnet.net COMMENT= Distributed.net distributed computing project client -WRKSRC= ${WRKDIR}/dnetc${PORTVERSION:E}-freebsd-x86-elf +# This is architecture dependent +WRKSRC= ${WRKDIR}/dnetc${PORTVERSION:E}-freebsd-${ARCH:S/i386/x86/}-elf -ONLY_FOR_ARCHS= i386 +# Slave ports may have set this +ONLY_FOR_ARCHS?= i386 NO_BUILD= yes BINDIR= ${PREFIX}/distributed.net -LIBDIR= ${PREFIX}/etc/rc.d CLIENTUSER= dnetc CLIENTGROUP= ${CLIENTUSER} +CLIENTUID= 105 -SBINMODE= 700 BINMODE= 700 +PKGINSTALL= ${WRKDIR}/pkg-install +PKGDEINSTALL= ${WRKDIR}/pkg-deinstall +PKGMESSAGE= ${WRKDIR}/pkg-message + MAN1= dnetc.1 .include <bsd.port.pre.mk> @@ -45,6 +51,15 @@ IGNORE= "This port requires FreeBSD 3.X or greater." BROKEN= "rc5des/dnetc conflict: Please deinstall all rc5des ports/packages first." .endif +post-extract: + @${SED} -e 's#%%CLIENTUSER%%#${CLIENTUSER}#g' -e 's#%%CLIENTGROUP%%#${CLIENTGROUP}#' \ + -e 's#%%CLIENTUID%%#${CLIENTUID}#g' ${MASTERDIR}/pkg-install > ${PKGINSTALL} + @${SED} -e 's#%%CLIENTUSER%%#${CLIENTUSER}#g' -e 's#%%CLIENTGROUP%%#${CLIENTGROUP}#' \ + ${MASTERDIR}/pkg-deinstall > ${PKGDEINSTALL} + @${SED} -e 's#%%BINDIR%%#${BINDIR}#' ${MASTERDIR}/pkg-message > ${PKGMESSAGE} + @${SED} -e 's#%%BINDIR%%#${BINDIR}#' -e 's#%%CLIENTUSER%%#${CLIENTUSER}#g' \ + ${FILESDIR}/dnetc.sh > ${WRKDIR}/dnetc.sh + do-configure: @if [ ! -f ${PREFIX}/dnetc.ini ]; then \ ${INSTALL} -c -m 644 ${FILESDIR}/dnetc.ini ${WRKSRC}; \ @@ -52,45 +67,26 @@ do-configure: pre-install: @${ECHO} "==> Creating custom user to run dnetc..." - ${PKGINSTALL} ${PKGNAME} PRE-INSTALL "${CLIENTUSER}" "${CLIENTGROUP}" + @${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL do-install: - @if [ ! -d ${BINDIR} ]; then \ + if [ ! -d ${BINDIR} ]; then \ ${MKDIR} ${BINDIR}; \ fi - - ${INSTALL} -c -m ${SBINMODE} -o ${CLIENTUSER} -g ${CLIENTGROUP} ${WRKSRC}/dnetc ${BINDIR} - - ${SED} s#CHANGETHIS#${BINDIR}# < ${FILESDIR}/dnetc.sh > ${WRKSRC}/dnetc.sh.pathnames - ${INSTALL} -c -m ${SBINMODE} ${WRKSRC}/dnetc.sh.pathnames ${LIBDIR}/dnetc.sh - - ${INSTALL_DATA} ${FILESDIR}/INFO ${BINDIR} - ${CHOWN} ${CLIENTUSER}:${CLIENTGROUP} ${BINDIR} ${CHMOD} 775 ${BINDIR} - if [ ! -f ${BINDIR}/dnetc.sh ]; then \ - ${LN} -s ${LIBDIR}/dnetc.sh ${BINDIR}/dnetc.sh; \ - fi + ${INSTALL} -c -m ${BINMODE} -o ${CLIENTUSER} -g ${CLIENTGROUP} ${WRKSRC}/dnetc ${BINDIR} + ${INSTALL_DATA} ${FILESDIR}/INFO ${BINDIR} ${INSTALL_MAN} ${WRKSRC}/${MAN1} ${PREFIX}/man/man1 - ${INSTALL} -c -m 644 -o ${CLIENTUSER} -g ${CLIENTGROUP} ${WRKSRC}/dnetc.ini ${BINDIR}/dnetc.ini.default + + ${INSTALL_SCRIPT} ${WRKDIR}/dnetc.sh ${PREFIX}/etc/rc.d/dnetc.sh.sample + + ${INSTALL} -c -m 644 -o ${CLIENTUSER} -g ${CLIENTGROUP} ${WRKSRC}/dnetc.ini ${BINDIR}/dnetc.ini.sample .if !exists(${BINDIR}/dnetc.ini) - @${ECHO} "" - @${ECHO} "" - @${ECHO} "" - @${ECHO} "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" - @${ECHO} "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" - @${ECHO} "! REMEMBER REMEMBER REMEMBER REMEMBER REMEMBER REMEMBER REMEMBER REMEMBER !" - @${ECHO} "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" - @${ECHO} "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" - @${ECHO} " Don't forget to run '${BINDIR}/dnetc -config' " - @${ECHO} "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" - @${ECHO} "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!" - @${ECHO} "" - @${ECHO} "" - @${ECHO} "" - ${INSTALL} -c -m 644 -o ${CLIENTUSER} -g ${CLIENTGROUP} ${WRKSRC}/dnetc.ini ${BINDIR} + ${INSTALL} -c -m 644 -o ${CLIENTUSER} -g ${CLIENTGROUP} ${WRKSRC}/dnetc.ini ${BINDIR}/dnetc.ini + @${CAT} ${PKGMESSAGE} .endif .include <bsd.port.post.mk> diff --git a/misc/dnetc/files/INFO b/misc/dnetc/files/INFO index 710531c5da85..705cea1f1467 100644 --- a/misc/dnetc/files/INFO +++ b/misc/dnetc/files/INFO @@ -15,8 +15,3 @@ For your statistics, check out: For general help with the client or distributed.net, mail: help@distributed.net - -For specific information regarding this port/package, mail: - dbaker@distributed.net or dbaker@cuckoo.com - -http://www.distributed.net/cgi-bin/dnet-finger.cgi?user=dbaker diff --git a/misc/dnetc/files/dnetc.sh b/misc/dnetc/files/dnetc.sh index 919e6f4c71c9..ed7c39e4fe6f 100644 --- a/misc/dnetc/files/dnetc.sh +++ b/misc/dnetc/files/dnetc.sh @@ -1,6 +1,7 @@ #!/bin/sh -dir="CHANGETHIS" +dir="%%BINDIR%%" +user="%%CLIENTUSER%%" case "$1" in start) @@ -26,10 +27,10 @@ start) fi echo -n " dnetc" - su -m dnetc -c "$dir/dnetc -quiet" 2>/dev/null >/dev/null & + su -m $user -c "$dir/dnetc -quiet" 2>/dev/null >/dev/null & ;; stop) - killall dnetc && echo -n " dnetc" + killall -u $user dnetc && echo -n " dnetc" ;; *) echo "Usage: `basename $0` {start|stop}" >&2 diff --git a/misc/dnetc/pkg-deinstall b/misc/dnetc/pkg-deinstall new file mode 100644 index 000000000000..a575f5a38879 --- /dev/null +++ b/misc/dnetc/pkg-deinstall @@ -0,0 +1,28 @@ +#!/bin/sh + +if [ "$2" != "POST-DEINSTALL" ]; then + exit 0 +fi + +CLIENTUSER=%%CLIENTUSER%% +CLIENTGROUP=%%CLIENTGROUP%% + +if /usr/sbin/pw usershow "$CLIENTUSER" 2>/dev/null 1>&2; then + if /usr/sbin/pw userdel -n $CLIENTUSER; then + echo "=> Removed user \"$CLIENTUSER\"." + else + echo "=> Removing user \"$CLIENTUSER\" failed..." + exit 1 + fi +fi + +if /usr/sbin/pw groupshow "$CLIENTGROUP" 2>/dev/null 1>&2; then + if /usr/sbin/pw groupdel -n $CLIENTGROUP; then + echo "=> Removed group \"$CLIENTGROUP\"." + else + echo "=> Removing group \"$CLIENTGROUP\" failed..." + exit 1 + fi +fi + +exit 0 diff --git a/misc/dnetc/pkg-descr b/misc/dnetc/pkg-descr index de33e9de699a..ee462d649124 100644 --- a/misc/dnetc/pkg-descr +++ b/misc/dnetc/pkg-descr @@ -16,7 +16,4 @@ For your statistics, check out: For general help with the client or distributed.net, mail: help@distributed.net -For specific information regarding this port/package, mail: - dbaker@distributed.net or dbaker@cuckoo.com - WWW: http://www.distributed.net/ diff --git a/misc/dnetc/pkg-install b/misc/dnetc/pkg-install index 4c3f2c347d1f..128ca7d87816 100644 --- a/misc/dnetc/pkg-install +++ b/misc/dnetc/pkg-install @@ -4,13 +4,13 @@ if [ "$2" != "PRE-INSTALL" ]; then exit 0 fi -CLIENTUSER=$3 -CLIENTGROUP=$4 -UID=105 +CLIENTUSER=%%CLIENTUSER%% +CLIENTGROUP=%%CLIENTGROUP%% +UID=%%CLIENTUID%% GID=$UID -if ! pw groupshow "$CLIENTGROUP" 2>/dev/null 1>&2; then - if pw groupadd $CLIENTGROUP -g $GID; then +if ! /usr/sbin/pw groupshow "$CLIENTGROUP" 2>/dev/null 1>&2; then + if /usr/sbin/pw groupadd $CLIENTGROUP -g $GID; then echo "=> Added group \"$CLIENTGROUP\"." else echo "=> Adding group \"$CLIENTGROUP\" failed..." @@ -18,10 +18,10 @@ if ! pw groupshow "$CLIENTGROUP" 2>/dev/null 1>&2; then fi fi -if ! pw usershow "$CLIENTUSER" 2>/dev/null 1>&2; then - if pw useradd $CLIENTUSER -u $UID -g $CLIENTGROUP -h - \ +if ! /usr/sbin/pw usershow "$CLIENTUSER" 2>/dev/null 1>&2; then + if /usr/sbin/pw useradd $CLIENTUSER -u $UID -g $CLIENTGROUP -h - \ -s "/sbin/nologin" -d "/nonexistent" \ - -c "distributed.net client and proxy pseudo-user"; \ + -c "distributed.net client pseudo-user"; \ then echo "=> Added user \"$CLIENTUSER\"." else diff --git a/misc/dnetc/pkg-message b/misc/dnetc/pkg-message new file mode 100644 index 000000000000..220c11cf62e0 --- /dev/null +++ b/misc/dnetc/pkg-message @@ -0,0 +1,9 @@ +*************************************************************************** + +Note: dnetc has been installed with a sample configuration. + +To change this run: + + %%BINDIR%%/dnetc -config + +*************************************************************************** diff --git a/misc/dnetc/pkg-plist b/misc/dnetc/pkg-plist index 9222a089bbf4..a621da54a467 100644 --- a/misc/dnetc/pkg-plist +++ b/misc/dnetc/pkg-plist @@ -1,7 +1,7 @@ -@unexec if cmp -s %D/distributed.net/dnetc.ini %D/distributed.net/dnetc.ini.default; then rm -f %D/distributed.net/dnetc.ini; fi distributed.net/dnetc -distributed.net/dnetc.sh distributed.net/INFO -distributed.net/dnetc.ini.default -etc/rc.d/dnetc.sh -@unexec rmdir %D/distributed.net 2>/dev/null || true +@unexec if cmp -s %D/distributed.net/dnetc.ini %D/distributed.net/dnetc.ini.sample; then rm -f %D/distributed.net/dnetc.ini; fi +distributed.net/dnetc.ini.sample +@exec [ -f %B/dnetc.ini ] || cp %B/%f %B/dnetc.ini +etc/rc.d/dnetc.sh.sample +@dirrm distributed.net |