diff options
author | Dmitry Marakasov <amdmi3@FreeBSD.org> | 2014-02-04 00:52:58 +0000 |
---|---|---|
committer | Dmitry Marakasov <amdmi3@FreeBSD.org> | 2014-02-04 00:52:58 +0000 |
commit | 3dffd6c4add3fc4c1984fe14fe6056fed9212552 (patch) | |
tree | 3a97cad62b4453a7ab308c1107eee0337aba63f2 | |
parent | Fix a stage symlink. (diff) |
- update to 10.0.2
- use ports framework to create cbsd user/group
- add rc.d scripts
- add pkg-deinstall instructions for complete uninstall
PR: 186344
Submitted by: Oleg Ginzburg <olevole@olevole.ru> (maintainer)
Notes
Notes:
svn path=/head/; revision=342481
-rw-r--r-- | GIDs | 1 | ||||
-rw-r--r-- | UIDs | 1 | ||||
-rw-r--r-- | sysutils/cbsd/Makefile | 11 | ||||
-rw-r--r-- | sysutils/cbsd/distinfo | 4 | ||||
-rw-r--r-- | sysutils/cbsd/files/cbsdd.in | 60 | ||||
-rw-r--r-- | sysutils/cbsd/files/cbsdrsyncd.in | 27 | ||||
-rw-r--r-- | sysutils/cbsd/pkg-deinstall | 31 |
7 files changed, 129 insertions, 6 deletions
@@ -84,6 +84,7 @@ ventrilo:*:146: kdm:*:147: ipv6mon:*:148: avenger:*:149: +cbsd:*:150: rbldns:*:153: trircd:*:154: sfs:*:171: @@ -91,6 +91,7 @@ ventrilo:*:146:146::0:0:& server:/usr/local/ventrilo-server:/usr/sbin/nologin kdm:*:147:147::0:0:KDE Display Manager:/nonexistent:/usr/sbin/nologin ipv6mon:*:148:148::0:0:IPv6 Address Monitoring Daemon:/nonexistent:/usr/sbin/nologin avenger:*:149:149::0:0:Mail Avenger:/var/spool/avenger:/usr/sbin/nologin +cbsd:*:150:150::0:0:Cbsd user:/nonexistent:/bin/sh rbldns:*:153:153::0:0:rbldnsd pseudo-user:/nonexistent:/usr/sbin/nologin trircd:*:154:154::0:0:& user:/usr/local/etc/tr-ircd:/usr/sbin/nologin sfs:*:171:171::0:0:Self-Certifying File System:/nonexistent:/usr/sbin/nologin diff --git a/sysutils/cbsd/Makefile b/sysutils/cbsd/Makefile index 568cb58cdb77..a0248cdcd74a 100644 --- a/sysutils/cbsd/Makefile +++ b/sysutils/cbsd/Makefile @@ -1,7 +1,7 @@ # $FreeBSD$ PORTNAME= cbsd -PORTVERSION= 10.0.1 +PORTVERSION= 10.0.2 CATEGORIES= sysutils MASTER_SITES= http://www.bsdstore.ru/downloads/ \ GH @@ -16,12 +16,12 @@ RUN_DEPENDS= rsync:${PORTSDIR}/net/rsync \ sqlite3:${PORTSDIR}/databases/sqlite3 LIB_DEPENDS= libssh2.so:${PORTSDIR}/security/libssh2 -IGNORE= Fails to work properly - USE_GITHUB= yes GH_ACCOUNT= olevole GH_PROJECT= cbsd -GH_COMMIT= ff6e7ea +GH_COMMIT= 6e05bd1 + +USE_RC_SUBR= cbsdd cbsdrsyncd SUB_FILES= pkg-message PLIST_FILES+= man/man8/cbsd.8.gz @@ -30,6 +30,9 @@ CBSD_HOME?= ${PREFIX}/cbsd .include <bsd.port.pre.mk> +USERS= ${PORTNAME} +GROUPS= ${PORTNAME} + .if ${OSVERSION} < 901000 IGNORE= does not work on FreeBSD < 9.1 .endif diff --git a/sysutils/cbsd/distinfo b/sysutils/cbsd/distinfo index 661d174e6be0..dae289a437f3 100644 --- a/sysutils/cbsd/distinfo +++ b/sysutils/cbsd/distinfo @@ -1,2 +1,2 @@ -SHA256 (cbsd-10.0.1.tar.gz) = a4475238ecf1f05752ddccfd514afe9dcd151c580ddba29dfee467c80193050f -SIZE (cbsd-10.0.1.tar.gz) = 1752119 +SHA256 (cbsd-10.0.2.tar.gz) = 3cce46368bcd0e9e5c4f8aec8219059fcc71b0709155d5dfb029d7b9a1ed4547 +SIZE (cbsd-10.0.2.tar.gz) = 325560 diff --git a/sysutils/cbsd/files/cbsdd.in b/sysutils/cbsd/files/cbsdd.in new file mode 100644 index 000000000000..9127d7df9ea1 --- /dev/null +++ b/sysutils/cbsd/files/cbsdd.in @@ -0,0 +1,60 @@ +#!/bin/sh +# +# PROVIDE: cbsdd +# REQUIRE: LOGIN FILESYSTEMS sshd +# KEYWORD: shutdown +# +# cbsdd_enable="YES" +# + +. /etc/rc.subr + +name=cbsdd +rcvar=cbsdd_enable +load_rc_config $name + +: ${cbsdd_enable="NO"} + +export workdir="${cbsd_workdir}" +globalconf=${cbsd_globalconf:-"${workdir}/cbsd.conf"} + +if [ ! -f ${globalconf} ]; then + echo "cbsd: no such ${globalconf}"; + exit 1 +fi + +. ${globalconf} +. ${inventory} +. ${mdtools} +. ${subr} + +if [ ! -f ${localcbsdconf} ]; then + echo "cbsd: no such ${localcbsdconf}"; + exit 1 +fi + +. ${localcbsdconf} + +start_precmd=${name}_prestart +stop_precmd=${name}_prestop + +command="${sbindir}/cbsdd" +pidfile="/var/run/$name.pid" + +cbsdd_prestart() { + find ${ftmpdir} -depth 1 -maxdepth 1 -type f -exec rm -f {} \; + %%PREFIX%%/bin/cbsd sysinv mode=update + + . ${inventory} + + [ -n "$nat_enable" ] && %%PREFIX%%/bin/cbsd naton + /usr/sbin/daemon ${rcddir}/jails-astart start +} + +cbsdd_prestop() +{ + ${rcddir}/jails-astart stop + [ -n "${nat_enable}" ] && %%PREFIX%%/bin/cbsd natoff +} + +run_rc_command "$1" diff --git a/sysutils/cbsd/files/cbsdrsyncd.in b/sysutils/cbsd/files/cbsdrsyncd.in new file mode 100644 index 000000000000..4dabb1ea204e --- /dev/null +++ b/sysutils/cbsd/files/cbsdrsyncd.in @@ -0,0 +1,27 @@ +#!/bin/sh +# PROVIDE: cbsdrsyncd +# REQUIRE: LOGIN +# KEYWORD: shutdown + +# cbsdrsyncd_enable="YES" +# cbsdrsyncd_flags="<set as needed>" +# +# See rsync(1) for cbsdrsyncd_flags +# + +. /etc/rc.subr +. /etc/rc.conf + +name="cbsdrsyncd" +rcvar=cbsdrsyncd_enable + +command="%%PREFIX%%/bin/rsync" +command_args="--daemon" +pidfile="/var/run/$name.pid" +required_files="${cbsd_workdir}/etc/$name.conf" + +# read configuration and set defaults +load_rc_config "$name" +: ${cbsdrsyncd_enable="NO"} + +run_rc_command "$1" diff --git a/sysutils/cbsd/pkg-deinstall b/sysutils/cbsd/pkg-deinstall new file mode 100644 index 000000000000..e5992bdbde7b --- /dev/null +++ b/sysutils/cbsd/pkg-deinstall @@ -0,0 +1,31 @@ +#!/bin/sh +case $2 in +POST-DEINSTALL) + echo + echo "The cbsd package has been deleted." + echo "If you're *not* upgrading and won't be using it any longer, you may want to" + echo "check some files in the system which could modify by cbsd and remove this" + echo "changes for complete deinstall. Specifically:" + echo + echo "1) follow records in the /var/cron/tabs/root file:" + echo "* * * * * /usr/bin/lockf -s -t0 \$workdir/ftmp/periodic_minutes \\" + echo "/usr/sbin/periodic minutes > /dev/null 2>&1" + echo "0 * * * * /usr/bin/lockf -s -t0 \$workdir/ftmp/periodic_hourly \\" + echo "/usr/sbin/periodic hourly > /dev/null 2>&1" + echo + echo "2) follow record in the /etc/periodic.conf file:" + echo "local_periodic=\"/usr/local/etc/periodic \$workdir/etc/periodic\"" + echo + echo "3) follow records in the /etc/rc.conf file:" + echo "cbsdrsyncd_enable=\"YES\"" + echo "cbsdrsyncd_flags=\"--config=\$workdir/etc/rsyncd.conf\"" + echo "cbsdd_enable=\"YES\"" + echo "devfs_load_rulesets=\"YES\"" + echo "cbsd_workdir=\"\$workdir\"" + echo "rcshutdown_timeout=\"900\"" + echo "sshd_flags=\"-oPort=22222\"" + echo + echo "4) /usr/local/etc/sudoers.d/cbsd_sudoers file" + echo + ;; +esac |