summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjmmv <jmmv>2003-04-09 15:52:28 +0000
committerjmmv <jmmv>2003-04-09 15:52:28 +0000
commit364d6a39c38b046fde0b20ac4ee06ed7bd7643c0 (patch)
tree90eb716a57904b8478b35d243662b4f6d0f25938
parent5c5f0c9e5d2fefbf344c04a4632e7d7d4723a74e (diff)
downloadpkgsrc-364d6a39c38b046fde0b20ac4ee06ed7bd7643c0.tar.gz
Add a rc.d script to run this program at bootup as an unprivileged user.
Bump PKGREVISION to 1. Closes my own PR pkg/18361.
-rw-r--r--misc/setiathome/MESSAGE7
-rw-r--r--misc/setiathome/Makefile18
-rw-r--r--misc/setiathome/PLIST3
-rw-r--r--misc/setiathome/files/setiathome.sh52
4 files changed, 71 insertions, 9 deletions
diff --git a/misc/setiathome/MESSAGE b/misc/setiathome/MESSAGE
index a7d5ff7935b..9c358afd09d 100644
--- a/misc/setiathome/MESSAGE
+++ b/misc/setiathome/MESSAGE
@@ -1,9 +1,14 @@
===========================================================================
-$NetBSD: MESSAGE,v 1.1 2001/11/01 01:29:33 zuntum Exp $
+$NetBSD: MESSAGE,v 1.2 2003/04/09 15:52:28 jmmv Exp $
Please note - you should really mkdir and cd into a new directory before
running setiathome (to avoid cluttering up your homedir).
+The other possibility is to use the provided "setiathome" rc.d script
+which will start SETI@home on system bootup as an unpriviledged user,
+using /var/db/setiathome as its home. The first time you use this script
+the configuration utility will appear to manually configure your account.
+
Also, please consider joining the NetBSD team:
http://setiathome.ssl.berkeley.edu/cgi-bin/cgi?cmd=team_lookup&name=NetBSD
diff --git a/misc/setiathome/Makefile b/misc/setiathome/Makefile
index 6d2e8b63cc6..159c9b46255 100644
--- a/misc/setiathome/Makefile
+++ b/misc/setiathome/Makefile
@@ -1,29 +1,30 @@
-# $NetBSD: Makefile,v 1.8 2001/10/01 15:52:05 abs Exp $
+# $NetBSD: Makefile,v 1.9 2003/04/09 15:52:29 jmmv Exp $
#
.include "../../mk/bsd.prefs.mk"
#
.if ${OPSYS} == "SunOS" && ${MACHINE_ARCH} == "sparc"
-DISTNAME= ${PKGNAME}.sparc-sun-solaris2.6
+DISTNAME= ${PKGNAME_NOREV}.sparc-sun-solaris2.6
#
.elif (${MACHINE_ARCH} == "alpha")
-DISTNAME= ${PKGNAME}.alpha-unknown-netbsd1.4
+DISTNAME= ${PKGNAME_NOREV}.alpha-unknown-netbsd1.4
#
.elif (${MACHINE_ARCH} == "i386")
-DISTNAME= ${PKGNAME}.i386-unknown-netbsd1.3
+DISTNAME= ${PKGNAME_NOREV}.i386-unknown-netbsd1.3
#
.elif (${MACHINE_ARCH} == "powerpc")
-DISTNAME= ${PKGNAME}.powerpc-unknown-netbsd1.4
+DISTNAME= ${PKGNAME_NOREV}.powerpc-unknown-netbsd1.4
#
# XXX Not yet on ftp site
.elif (${MACHINE_ARCH} == "sparc")
-DISTNAME= ${PKGNAME}.sparc-unknown-netbsd1.4
+DISTNAME= ${PKGNAME_NOREV}.sparc-unknown-netbsd1.4
#
.else
-DISTNAME= ${PKGNAME}
+DISTNAME= ${PKGNAME_NOREV}
.endif
#
PKGNAME= setiathome-3.03
+PKGREVISION= 1
CATEGORIES= misc
MASTER_SITES= ftp://ftp.cdrom.com/pub/setiathome/ \
ftp://alien.ssl.berkeley.edu/pub/ \
@@ -39,6 +40,9 @@ ONLY_FOR_PLATFORM= NetBSD-*-alpha NetBSD-*-i386 NetBSD-*-powerpc SunOS-*-sparc
DIST_SUBDIR= setiathome
DECOMPRESS_CMD= ${CAT}
NO_BUILD= yes
+USE_PKGINSTALL= yes
+
+RCD_SCRIPTS= setiathome
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/setiathome ${PREFIX}/bin
diff --git a/misc/setiathome/PLIST b/misc/setiathome/PLIST
index 8e56629bce7..2c857bdd77a 100644
--- a/misc/setiathome/PLIST
+++ b/misc/setiathome/PLIST
@@ -1,4 +1,5 @@
-@comment $NetBSD: PLIST,v 1.1 2001/11/01 01:29:33 zuntum Exp $
+@comment $NetBSD: PLIST,v 1.2 2003/04/09 15:52:29 jmmv Exp $
bin/setiathome
bin/xsetiathome
+etc/rc.d/setiathome
man/cat1/setiathome.0
diff --git a/misc/setiathome/files/setiathome.sh b/misc/setiathome/files/setiathome.sh
new file mode 100644
index 00000000000..937a973fe5e
--- /dev/null
+++ b/misc/setiathome/files/setiathome.sh
@@ -0,0 +1,52 @@
+#!/bin/sh
+#
+# $NetBSD: setiathome.sh,v 1.1 2003/04/09 15:52:29 jmmv Exp $
+#
+
+# PROVIDE: setiathome
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+
+. /etc/rc.subr
+
+sah_user="nobody"
+sah_group="nobody"
+sah_homedir="/var/db/setiathome"
+
+name="setiathome"
+rcvar=$name
+command="/usr/pkg/bin/${name}"
+pidfile="${sah_homedir}/pid.sah"
+extra_commands="config"
+
+setiathome_config() {
+ if [ ! -d ${sah_homedir} ]; then
+ mkdir ${sah_homedir}
+ chmod 755 ${sah_homedir}
+ chown ${sah_user}:${sah_group} ${sah_homedir}
+ fi
+
+ su -fm ${sah_user} -c "cd ${sah_homedir} && exec ${command} -login"
+ return 0
+}
+
+setiathome_start() {
+ if [ ! -f ${sah_homedir}/key.sah ]; then
+ run_rc_command config
+ fi
+
+ echo "Starting ${name}."
+ su -fm ${sah_user} -c "cd ${sah_homedir} && exec ${command} \
+ ${command_args} &" 2>/dev/null 1>/dev/null
+}
+
+setiathome_poststop() {
+ rm -f ${sah_homedir}/pid.sah
+}
+
+config_cmd=setiathome_config
+start_cmd=setiathome_start
+stop_postcmd=setiathome_poststop
+
+load_rc_config $name
+run_rc_command "$1"