diff options
author | Rob Austein <sra@hactrn.net> | 2013-05-03 14:17:14 +0000 |
---|---|---|
committer | Rob Austein <sra@hactrn.net> | 2013-05-03 14:17:14 +0000 |
commit | 719612bb63774856b0a6a4d9810eb6f79090e5cc (patch) | |
tree | 30a9018ad498611f54d35469ac422ba4f8444db1 /buildtools/freebsd-skeleton/rpki-rp | |
parent | 9cb3bdabce76e0e9e0947a8795ff1d121c773c51 (diff) |
Update FreeBSD port skeleton. Not (yet) tested properly due to bugs
in pkgng causing pkgng to dump core on test machine (!). See #526.
svn path=/trunk/; revision=5318
Diffstat (limited to 'buildtools/freebsd-skeleton/rpki-rp')
-rw-r--r-- | buildtools/freebsd-skeleton/rpki-rp/Makefile | 14 | ||||
-rw-r--r-- | buildtools/freebsd-skeleton/rpki-rp/pkg-deinstall | 6 | ||||
-rw-r--r-- | buildtools/freebsd-skeleton/rpki-rp/pkg-install | 48 | ||||
-rw-r--r-- | buildtools/freebsd-skeleton/rpki-rp/pkg-upgrade | 18 |
4 files changed, 67 insertions, 19 deletions
diff --git a/buildtools/freebsd-skeleton/rpki-rp/Makefile b/buildtools/freebsd-skeleton/rpki-rp/Makefile index d55ed91d..86262666 100644 --- a/buildtools/freebsd-skeleton/rpki-rp/Makefile +++ b/buildtools/freebsd-skeleton/rpki-rp/Makefile @@ -6,6 +6,7 @@ DISTFILES= rpki-%(SVNBRANCH)s-r%(SVNVERSION)s.tar.xz WRKSRC= ${WRKDIR}/rpki-%(SVNBRANCH)s-r%(SVNVERSION)s MAINTAINER= sra@hactrn.net COMMENT= rpki.net RPKI relying party tools +WWW= http://rpki.net/ GNU_CONFIGURE= yes USE_PYTHON= 2.7+ @@ -41,10 +42,19 @@ CONFIGURE_ENV= CFLAGS="-I${LOCALBASE}/include" LDFLAGS="-L${LOCALBASE}/lib" pre-install: PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} PRE-INSTALL - @if [ -f ${PREFIX}/etc/rcynic.conf ]; then ${MV} -f ${PREFIX}/etc/rcynic.conf ${PREFIX}/etc/rcynic.conf.real ; fi + @if test -f ${PREFIX}/etc/rcynic.conf; \ + then \ + ${MV} -f ${PREFIX}/etc/rcynic.conf ${PREFIX}/etc/rcynic.conf.real; \ + fi post-install: PKG_PREFIX=${PREFIX} ${SH} ${PKGINSTALL} ${PKGNAME} POST-INSTALL - @if [ -f ${PREFIX}/etc/rcynic.conf.real ]; then ${MV} -f ${PREFIX}/etc/rcynic.conf ${PREFIX}/etc/rcynic.conf.sample ; ${MV} -f ${PREFIX}/etc/rcynic.conf.real ${PREFIX}/etc/rcynic.conf ; else ${CP} -p ${PREFIX}/etc/rcynic.conf ${PREFIX}/etc/rcynic.conf.sample ; fi + @if test -f ${PREFIX}/etc/rcynic.conf.real; \ + then \ + ${MV} -f ${PREFIX}/etc/rcynic.conf ${PREFIX}/etc/rcynic.conf.sample; \ + ${MV} -f ${PREFIX}/etc/rcynic.conf.real ${PREFIX}/etc/rcynic.conf; \ + else \ + ${CP} -p ${PREFIX}/etc/rcynic.conf ${PREFIX}/etc/rcynic.conf.sample; \ + fi .include <bsd.port.mk> diff --git a/buildtools/freebsd-skeleton/rpki-rp/pkg-deinstall b/buildtools/freebsd-skeleton/rpki-rp/pkg-deinstall index 31beff95..d5ffbd5b 100644 --- a/buildtools/freebsd-skeleton/rpki-rp/pkg-deinstall +++ b/buildtools/freebsd-skeleton/rpki-rp/pkg-deinstall @@ -3,9 +3,12 @@ case $2 in DEINSTALL) - if cmp -s /usr/local/etc/rcynic.conf.sample /usr/local/etc/rcynic.conf; then + + if cmp -s /usr/local/etc/rcynic.conf.sample /usr/local/etc/rcynic.conf + then rm -f /usr/local/etc/rcynic.conf fi + echo "Whacking rcynic's crontab" /usr/bin/crontab -l -u rcynic 2>/dev/null | /usr/bin/awk ' @@ -19,6 +22,7 @@ DEINSTALL) else system("/usr/bin/crontab -u rcynic -r"); }' + ;; POST-DEINSTALL) diff --git a/buildtools/freebsd-skeleton/rpki-rp/pkg-install b/buildtools/freebsd-skeleton/rpki-rp/pkg-install index aaf48c3c..9c60a7be 100644 --- a/buildtools/freebsd-skeleton/rpki-rp/pkg-install +++ b/buildtools/freebsd-skeleton/rpki-rp/pkg-install @@ -3,18 +3,22 @@ case $2 in PRE-INSTALL) - if /usr/sbin/pw groupshow "rcynic" 2>/dev/null; then + if /usr/sbin/pw groupshow "rcynic" 2>/dev/null + then echo "You already have a group \"rcynic\", so I will use it." - elif /usr/sbin/pw groupadd rcynic; then + elif /usr/sbin/pw groupadd rcynic + then echo "Added group \"rcynic\"." else echo "Adding group \"rcynic\" failed..." echo "Please create it, then try again." exit 1 fi - if /usr/sbin/pw usershow "rcynic" 2>/dev/null; then + if /usr/sbin/pw usershow "rcynic" 2>/dev/null + then echo "You already have a user \"rcynic\", so I will use it." - elif /usr/sbin/pw useradd rcynic -g rcynic -h - -d /nonexistant -s /usr/sbin/nologin -c "RPKI validation system"; then + elif /usr/sbin/pw useradd rcynic -g rcynic -h - -d /nonexistant -s /usr/sbin/nologin -c "RPKI validation system" + then echo "Added user \"rcynic\"." else echo "Adding user \"rcynic\" failed..." @@ -24,26 +28,32 @@ PRE-INSTALL) ;; POST-INSTALL) - if ! test -d /var/rcynic; then + if ! test -d /var/rcynic + then echo "Creating /var/rcynic" install -o root -g wheel -d /var/rcynic fi - for dir in /var/rcynic/data /var/rcynic/rpki-rtr; do - if ! test -d $dir; then + for dir in /var/rcynic/data /var/rcynic/rpki-rtr + do + if ! test -d $dir + then echo "Creating $dir" install -o rcynic -g rcynic -d /var/rcynic fi done - if test ! -f /usr/local/etc/rcynic.conf; then + if test ! -f /usr/local/etc/rcynic.conf + then cp -p /usr/local/etc/rcynic.conf.sample /usr/local/etc/rcynic.conf fi htmldir=/usr/local/www/apache22/data/rcynic - if ! test -d $htmldir ; then + if ! test -d $htmldir + then echo "Creating $htmldir" install -o rcynic -g rcynic -d $htmldir fi sockdir=/var/rcynic/rpki-rtr/sockets - if ! test -d $sockdir ; then + if ! test -d $sockdir + then echo "Creating $sockdir" install -o nobody -g rcynic -d $sockdir fi @@ -57,25 +67,31 @@ POST-INSTALL) /usr/bin/crontab -u rcynic - fi echo "Setting up rpki-rtr listener under inetd" - if /usr/bin/egrep -q '^rpki-rtr' /etc/services ; then + if /usr/bin/egrep -q '^rpki-rtr' /etc/services + then echo "You already have a /etc/services entry for rpki-rtr, so I will use it." - elif echo >>/etc/services "rpki-rtr 43779/tcp #RFC 6810" ; then + elif echo >>/etc/services "rpki-rtr 43779/tcp #RFC 6810" + then echo "Added rpki-rtr to /etc/services." else echo "Adding rpki-rtr to /etc/services failed, please fix this, then try again." exit 1 fi - if /usr/bin/egrep -q "rpki-rtr[ ]+stream[ ]+tcp[ ]" /etc/inetd.conf; then + if /usr/bin/egrep -q "rpki-rtr[ ]+stream[ ]+tcp[ ]" /etc/inetd.conf + then echo "You already have an inetd.conf entry for rpki-rtr on TCPv4, so I will use it." - elif echo >>/etc/inetd.conf "rpki-rtr stream tcp nowait nobody /usr/local/bin/rtr-origin rtr-origin --server /var/rcynic/rpki-rtr"; then + elif echo >>/etc/inetd.conf "rpki-rtr stream tcp nowait nobody /usr/local/bin/rtr-origin rtr-origin --server /var/rcynic/rpki-rtr" + then echo "Added rpki-rtr for TCPv4 to /etc/inetd.conf." else echo "Adding rpki-rtr for TCPv4 to /etc/inetd.conf failed, please fix this, then try again." exit 1 fi - if /usr/bin/egrep -q "rpki-rtr[ ]+stream[ ]+tcp6[ ]" /etc/inetd.conf; then + if /usr/bin/egrep -q "rpki-rtr[ ]+stream[ ]+tcp6[ ]" /etc/inetd.conf + then echo "You already have an inetd.conf entry for rpki-rtr on TCPv6, so I will use it." - elif echo >>/etc/inetd.conf "rpki-rtr stream tcp6 nowait nobody /usr/local/bin/rtr-origin rtr-origin --server /var/rcynic/rpki-rtr"; then + elif echo >>/etc/inetd.conf "rpki-rtr stream tcp6 nowait nobody /usr/local/bin/rtr-origin rtr-origin --server /var/rcynic/rpki-rtr" + then echo "Added rpki-rtr for TCPv6 to /etc/inetd.conf." else echo "Adding rpki-rtr for TCPv6 to /etc/inetd.conf failed, please fix this, then try again." diff --git a/buildtools/freebsd-skeleton/rpki-rp/pkg-upgrade b/buildtools/freebsd-skeleton/rpki-rp/pkg-upgrade new file mode 100644 index 00000000..f569a3d6 --- /dev/null +++ b/buildtools/freebsd-skeleton/rpki-rp/pkg-upgrade @@ -0,0 +1,18 @@ +#!/bin/sh - + +echo 1>&2 "pkg-upgrade invoked with arguments \"$*\"." + +case $2 in + +PRE-UPGRADE) + ;; + +POST-UPGRADE) + ;; + +*) + echo "No clue what this script is meant to do when invoked with arguments \"$*\"." + #exit 1 + ;; + +esac |