tracking freebsd packaging from anarcat.
authorDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Mon, 27 Oct 2008 01:19:34 +0000 (21:19 -0400)
committerDaniel Kahn Gillmor <dkg@fifthhorseman.net>
Mon, 27 Oct 2008 01:19:34 +0000 (21:19 -0400)
packaging/freebsd/Makefile
packaging/freebsd/TODO [deleted file]
packaging/freebsd/pkg-install

index 7a24dc58e1723fa8c18d9043b7eca8d63db25cbd..78ad0d3a3a6f22e5bef4accd600eb83071562fcb 100644 (file)
@@ -12,9 +12,6 @@ MASTER_SITES=  http://archive.monkeysphere.info/debian/pool/monkeysphere/m/monke
 # hack for debian orig tarballs
 DISTFILES=      ${PORTNAME}_${DISTVERSION}.orig.tar.gz
 
-# comment this out to test the port
-IGNORE=                        this port is not finished yet
-
 MAINTAINER=    dkg@fifthhorseman.net
 COMMENT=       use the OpenPGP web of trust to verify ssh connections
 
@@ -43,5 +40,11 @@ post-install:
        @if [ ! -f ${PREFIX}/etc/monkeysphere/monkeysphere-server.conf ]; then \
                ${CP} -p ${PREFIX}/etc/monkeysphere/monkeysphere-server.conf.sample ${PREFIX}/etc/monkeysphere/monkeysphere-server.conf ; \
        fi
+.if !defined(PACKAGE_BUILDING)
+       @${SETENV} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL
+.endif
+
+post-deinstall:
+       @${SETENV} ${SH} ${PKGDEINSTALL} ${PKGNAME} POST-DEINSTALL
 
 .include <bsd.port.mk>
diff --git a/packaging/freebsd/TODO b/packaging/freebsd/TODO
deleted file mode 100644 (file)
index f482457..0000000
+++ /dev/null
@@ -1,21 +0,0 @@
-This port is not ready yet. 
-
-We also need to create the monkeysphere user in the pkg-install and
-remove it in pkg-deinstall. To do this, this page has useful tips:
-
-http://www.freebsd.org/doc/en/books/porters-handbook/dads-uid-and-gids.html
-
-and we'll have to copy scripts from existing ports that are suggested
-above, see:
-
-http://www.freebsd.org/cgi/cvsweb.cgi/ports/japanese/Wnn6/pkg-install
-http://www.freebsd.org/cgi/cvsweb.cgi/ports/net/cvsup-mirror/pkg-install
-
-or just look around the ports tree for pkg-install files, they are
-usually for adding users.
-
-Finally the pkg-plist needs to be checked. The package hasn't been
-installed at all once yet, it only patches and builds.
-
-The port is therefore marked as IGNORE, which makes it unusable, comment
-out the IGNORE line in the Makefile to test.
index 940b7963eee074937e91fc6734e09bc35f457ddc..5e520cdfd20ad8a19f5b8f7c8e0dd1df39b0fb80 100755 (executable)
@@ -24,7 +24,7 @@ POST-INSTALL)
         GID=${UID}
         SHELL=/usr/local/bin/bash
 
-        if pw group show "${GROUP}" 2>/dev/null; then
+        if pw group show "${GROUP}" >/dev/null 2>&1; then
                 echo "You already have a group \"${GROUP}\", so I will use it."
         else
                 if pw groupadd ${GROUP} -g ${GID}; then
@@ -35,7 +35,8 @@ POST-INSTALL)
                 fi
         fi
 
-        if oldshell=`pw user show "${USER}" 2>/dev/null`; then
+       if pw user show "${USER}" >/dev/null 2>&1; then
+            oldshell=`pw user show "${USER}" 2>/dev/null | cut -f10 -d:`
            if [ x"$oldshell" != x"$SHELL" ]; then
                echo "You already have a \"${USER}\" user, but its shell is '$oldshell'."
                echo "This package requires that \"${USER}\"'s shell be '$SHELL'."