Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 1 Feb 2014 14:28:49 GMT
From:      Oleg Ginzburg <olevole@olevole.ru>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/186344: sysutils/cbsd update to 10.0.2
Message-ID:  <201402011428.s11ESnDp033927@oldred.freebsd.org>
Resent-Message-ID: <201402011430.s11EU0B6060830@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         186344
>Category:       ports
>Synopsis:       sysutils/cbsd update to 10.0.2
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          maintainer-update
>Submitter-Id:   current-users
>Arrival-Date:   Sat Feb 01 14:30:00 UTC 2014
>Closed-Date:
>Last-Modified:
>Originator:     Oleg Ginzburg
>Release:        
>Organization:
>Environment:
>Description:
- update to 10.0.2
- use ports framework to create cbsd account
- add rc.d scripts
- add pkg-deinstall instructions for complete uninstall


>How-To-Repeat:

>Fix:


Patch attached with submission follows:

diff -ruN cbsd.bak/Makefile cbsd/Makefile
--- cbsd.bak/Makefile	2014-02-01 18:08:00.000000000 +0400
+++ cbsd/Makefile	2014-02-01 18:14:39.000000000 +0400
@@ -1,7 +1,7 @@
-# $FreeBSD: head/sysutils/cbsd/Makefile 341642 2014-01-28 17:09:48Z az $
+# $FreeBSD: sysutils/cbsd/Makefile 341642 2014-01-28 17:09:48Z az $
 
 PORTNAME=	cbsd
-PORTVERSION=	10.0.1
+PORTVERSION=	10.0.2
 CATEGORIES=	sysutils
 MASTER_SITES=	http://www.bsdstore.ru/downloads/ \
 		GH
@@ -16,12 +16,13 @@
 		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_TAGNAME=	10.0.2
+GH_COMMIT=	6e05bd1
+
+USE_RC_SUBR=	cbsdd cbsdrsyncd
 
 SUB_FILES=	pkg-message
 PLIST_FILES+=	man/man8/cbsd.8.gz
@@ -30,6 +31,9 @@
 
 .include <bsd.port.pre.mk>
 
+USERS=	${PORTNAME}
+GROUPS=	${PORTNAME}
+
 .if ${OSVERSION} < 901000
 IGNORE=	does not work on FreeBSD < 9.1
 .endif
diff -ruN cbsd.bak/distinfo cbsd/distinfo
--- cbsd.bak/distinfo	2014-02-01 18:08:00.000000000 +0400
+++ cbsd/distinfo	2014-02-01 18:08:50.000000000 +0400
@@ -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 -ruN cbsd.bak/files/cbsdd.in cbsd/files/cbsdd.in
--- cbsd.bak/files/cbsdd.in	1970-01-01 03:00:00.000000000 +0300
+++ cbsd/files/cbsdd.in	2014-01-31 23:12:52.000000000 +0400
@@ -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 -ruN cbsd.bak/files/cbsdrsyncd.in cbsd/files/cbsdrsyncd.in
--- cbsd.bak/files/cbsdrsyncd.in	1970-01-01 03:00:00.000000000 +0300
+++ cbsd/files/cbsdrsyncd.in	2014-01-31 16:49:27.000000000 +0400
@@ -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 -ruN cbsd.bak/pkg-deinstall cbsd/pkg-deinstall
--- cbsd.bak/pkg-deinstall	1970-01-01 03:00:00.000000000 +0300
+++ cbsd/pkg-deinstall	2014-02-01 18:12:40.000000000 +0400
@@ -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=\"/usr/jails\""
+    echo "rcshutdown_timeout=\"900\""
+    echo "sshd_flags=\"-oPort=22222\""
+    echo
+    echo "4) /usr/local/etc/sudoers.d/cbsd_sudoers file"
+    echo
+  ;;
+esac


>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201402011428.s11ESnDp033927>