Wednesday, February 28, 2018

UPDATE: burp -> 2.0/2.0.54, stable (2.1.28)

On Thu, Feb 22, 2018 at 08:08:02PM -0500, Jiri B wrote:
> I have no idea how to solve this - no conflict, thus one could have
> old server and would like to install new client or vice-versa.
> What to do with configuration files? I have no opinion.

Hi,

I hope I finally was successful to make diff for burp.

- moving current port version into '2.0' subdir
- adding 'stable' subdir for 2.1.28
- customizing Makefile and adding Makefile.inc
- making both ports 'conflict' and have '@option is-branch'

IIUC, both ports can be installed with something like:

env PKG_DBDIR=<var_db_pkg_alternative> pkg_add -B <new_root> <package>

- I would love to know how to build -static flavor so I could use burp
for disaster recovery from ramdisk env.
- If there would be pledge restrictions, it would be great too...

Question: I could not do 'make fetch' in 'stable' subdir, it was
showing error that distinfo does not exist, no idea what's going on?!

Jiri


diff --git Makefile Makefile
new file mode 100644
index 00000000000..ceb51612cbf
--- /dev/null
+++ Makefile
@@ -0,0 +1,13 @@
+# $OpenBSD: Makefile,v 1.3 2018/02/09 10:41:45 nigel Exp $
+
+VERSION = 2.0.54
+REVISION = 1
+
+post-patch:
+ ${SUBST_CMD} ${WRKSRC}/src/client/monitor/status_client_ncurses.c
+
+post-install:
+ @rm -Rf ${WRKINST}/${SYSCONFDIR}/burp/autoupgrade
+ @mv ${WRKINST}/${SYSCONFDIR}/burp ${PREFIX}/share/examples/burp
+
+.include <bsd.port.mk>
diff --git distinfo distinfo
new file mode 100644
index 00000000000..8261a2d01ba
--- /dev/null
+++ distinfo
@@ -0,0 +1,2 @@
+SHA256 (burp-2.0.54.tar.bz2) = rhBHBYbx/uRVbqrls8UreM/A6sQQn0uCU8VJ5/8ADYY=
+SIZE (burp-2.0.54.tar.bz2) = 754566
diff --git patches/patch-Makefile_in patches/patch-Makefile_in
new file mode 100644
index 00000000000..045e0419c45
--- /dev/null
+++ patches/patch-Makefile_in
@@ -0,0 +1,14 @@
+$OpenBSD: patch-Makefile_in,v 1.1.1.1 2017/11/03 11:31:01 landry Exp $
+
+Index: Makefile.in
+--- Makefile.in.orig
++++ Makefile.in
+@@ -625,7 +625,7 @@ sbindir = @sbindir@
+ scriptdir = @scriptdir@
+ sharedstatedir = @sharedstatedir@
+ srcdir = @srcdir@
+-sysconfdir = @sysconfdir@
++sysconfdir = @sysconfdir@/burp
+ target_alias = @target_alias@
+ top_build_prefix = @top_build_prefix@
+ top_builddir = @top_builddir@
diff --git patches/patch-configs_client_burp_conf_in patches/patch-configs_client_burp_conf_in
new file mode 100644
index 00000000000..4b0fe24292f
--- /dev/null
+++ patches/patch-configs_client_burp_conf_in
@@ -0,0 +1,14 @@
+$OpenBSD: patch-configs_client_burp_conf_in,v 1.1.1.1 2017/11/03 11:31:01 landry Exp $
+
+Index: configs/client/burp.conf.in
+--- configs/client/burp.conf.in.orig
++++ configs/client/burp.conf.in
+@@ -11,7 +11,7 @@ cname = testclient
+ # with a pseudo mirrored storage on the server and optional rsync). 2 forces
+ # protocol2 mode (inline deduplication with variable length blocks).
+ # protocol = 0
+-pidfile = @runstatedir@/burp.client.pid
++pidfile = @runstatedir@/burp/client.pid
+ syslog = 0
+ stdout = 1
+ progress_counter = 1
diff --git patches/patch-configs_server_burp_conf_in patches/patch-configs_server_burp_conf_in
new file mode 100644
index 00000000000..e40588384a1
--- /dev/null
+++ patches/patch-configs_server_burp_conf_in
@@ -0,0 +1,26 @@
+$OpenBSD: patch-configs_server_burp_conf_in,v 1.1.1.1 2017/11/03 11:31:01 landry Exp $
+
+Index: configs/server/burp.conf.in
+--- configs/server/burp.conf.in.orig
++++ configs/server/burp.conf.in
+@@ -22,7 +22,7 @@ clientconfdir = @sysconfdir@/clientconfdir
+ # Like many other settings, this can be set per client in the clientconfdir
+ # files.
+ # protocol = 0
+-pidfile = @runstatedir@/burp.server.pid
++pidfile = @runstatedir@/burp/server.pid
+ hardlinked_archive = 0
+ working_dir_recovery_method = delete
+ max_children = 5
+@@ -68,8 +68,9 @@ keep = 7
+ # keep = 6
+
+ # Run as different user/group.
+-# user=graham
+-# group=nogroup
++user=_burp
++group=_burp
++dedup_group=_burp
+
+ # CA options.
+ # If you want your server to be a certificate authority and generate its own
diff --git patches/patch-configs_server_timer_script patches/patch-configs_server_timer_script
new file mode 100644
index 00000000000..1b1d569ea9f
--- /dev/null
+++ patches/patch-configs_server_timer_script
@@ -0,0 +1,42 @@
+$OpenBSD: patch-configs_server_timer_script,v 1.1.1.1 2017/11/03 11:31:01 landry Exp $
+
+https://github.com/grke/burp/issues/627
+
+Index: configs/server/timer_script
+--- configs/server/timer_script.orig
++++ configs/server/timer_script
+@@ -77,29 +77,12 @@ get_intervals()
+
+ read junk ts < "$timestamp"
+
+- if ! secs=$(LANG=C LC_TIME=C date +%s -d "$ts") \
+- || ! now=$(LANG=C LC_TIME=C date +"%Y-%m-%d %H:%M:%S") \
+- || ! nowsecs=$(LANG=C LC_TIME=C date +%s -d "$now")
+- then
+- echo "$0: Date command returned error for $client."
+- return 0
+- fi
+-
++ mts=$(echo $ts | sed -e 's/-//g; s/ //; s/://; s/:/./')
++ secs=$(LANG=C LC_TIME=C date -j "$mts" +%s)
++ now=$(LANG=C LC_TIME=C date +"%Y-%m-%d %H:%M:%S")
++ nowsecs=$(LANG=C LC_TIME=C date +%s)
+ min_timesecs=$((secs+intervalsecs))
+-
+- # GNU coreutils 'date' command should accept the following (even
+- # slightly old versions).
+- if ! min_time=$(LANG=C LC_TIME=C date -d "Jan 1, 1970 00:00:00 +0000 + $min_timesecs seconds" +"%Y-%m-%d %H:%M:%S")
+- then
+- # FreeBSD 'date' will return an error with the above, so try
+- # a version that FreeBSD 'date' should be happy with.
+- if ! min_time=$(LANG=C LC_TIME=C date -r $min_timesecs +"%Y-%m-%d %H:%M:%S")
+- then
+- echo "$0: Date command returned error for $client."
+- return 0
+- fi
+- fi
+-
++ min_time=$(LANG=C LC_TIME=C date -r $min_timesecs +"%Y-%m-%d %H:%M:%S")
+ echo "Last backup: $ts"
+ echo "Next after : $min_time (interval $interval)"
+
diff --git patches/patch-src_client_monitor_status_client_ncurses_c patches/patch-src_client_monitor_status_client_ncurses_c
new file mode 100644
index 00000000000..d23ac878275
--- /dev/null
+++ patches/patch-src_client_monitor_status_client_ncurses_c
@@ -0,0 +1,23 @@
+$OpenBSD: patch-src_client_monitor_status_client_ncurses_c,v 1.1.1.1 2017/11/03 11:31:01 landry Exp $
+
+https://github.com/grke/burp/issues/626
+
+Index: src/client/monitor/status_client_ncurses.c
+--- src/client/monitor/status_client_ncurses.c.orig
++++ src/client/monitor/status_client_ncurses.c
+@@ -1453,14 +1453,7 @@ static pid_t fork_monitor(int *csin, int *csout, struc
+ char procpath[32];
+ char buf[PATH_MAX];
+
+- snprintf(procpath, sizeof(procpath), "/proc/%d/exe", getpid());
+- if(!readlink_w(procpath, buf, sizeof(buf)))
+- args[a++]=(char *)buf;
+- else if(is_reg_lstat(prog_long)>0)
+- args[a++]=(char *)prog_long;
+- else
+- args[a++]=(char *)"/usr/sbin/burp";
+-
++ args[a++]=(char *)"${TRUEPREFIX}/sbin/burp";
+ args[a++]=(char *)"-c";
+ args[a++]=get_string(confs[OPT_CONFFILE]);
+ args[a++]=(char *)"-a";
diff --git pkg/DESCR pkg/DESCR
new file mode 100644
index 00000000000..01a51148382
--- /dev/null
+++ pkg/DESCR
@@ -0,0 +1,4 @@
+Burp is a network backup and restore program. It attempts to reduce
+network traffic and the amount of space that is used by each backup,
+and uses VSS (Volume Shadow Copy Service) to make snapshots when
+backing up Windows computers.
diff --git pkg/PLIST pkg/PLIST
new file mode 100644
index 00000000000..71f076924f1
--- /dev/null
+++ pkg/PLIST
@@ -0,0 +1,72 @@
+@comment $OpenBSD: PLIST,v 1.1.1.1 2017/11/03 11:31:01 landry Exp $
+@option is-branch
+@conflict burp-*
+@newgroup _burp:794
+@newuser _burp:794:794:daemon:BackUp and Recovery Daemon:/var/empty:/sbin/nologin
+@bin bin/vss_strip
+@man man/man8/bedup.8
+@man man/man8/bsigs.8
+@man man/man8/burp.8
+@man man/man8/burp_ca.8
+@man man/man8/vss_strip.8
+sbin/bedup
+sbin/bsigs
+@bin sbin/burp
+sbin/burp_ca
+share/burp/
+share/burp/scripts/
+share/burp/scripts/notify_script
+share/burp/scripts/ssl_extra_checks_script
+share/burp/scripts/summary_script
+share/burp/scripts/timer_script
+share/doc/burp/
+share/doc/burp/CHANGELOG
+share/doc/burp/CONTRIBUTORS
+share/doc/burp/DONATIONS
+share/doc/burp/LICENSE
+share/doc/burp/README
+share/doc/burp/UPGRADING
+share/doc/burp/add-remove.txt
+share/doc/burp/autoupgrade.txt
+share/doc/burp/backup_phases.txt
+share/doc/burp/baremetal-windows2008.txt
+share/doc/burp/baremetal-windows7-hirens.txt
+share/doc/burp/baremetal-windows7.txt
+share/doc/burp/baremetal-windows7and8.txt
+share/doc/burp/burp_ca.txt
+share/doc/burp/debug.txt
+share/doc/burp/readwrite.txt
+share/doc/burp/retention.txt
+share/doc/burp/security-models.txt
+share/doc/burp/server-basics.txt
+share/doc/burp/shuffling.txt
+share/doc/burp/status-monitor.txt
+share/doc/burp/tests.txt
+share/doc/burp/timer_script.txt
+share/doc/burp/working_dir.txt
+@mode 770
+@owner _burp
+@group _burp
+share/examples/burp/
+@sample ${SYSCONFDIR}/burp/
+share/examples/burp/CA-client/
+@sample ${SYSCONFDIR}/burp/CA-client/
+share/examples/burp/CA.cnf
+@sample ${SYSCONFDIR}/burp/CA.cnf
+share/examples/burp/burp-server.conf
+@sample ${SYSCONFDIR}/burp/burp-server.conf
+share/examples/burp/burp.conf
+@sample ${SYSCONFDIR}/burp/burp.conf
+share/examples/burp/clientconfdir/
+@sample ${SYSCONFDIR}/burp/clientconfdir/
+share/examples/burp/clientconfdir/incexc/
+@sample ${SYSCONFDIR}/burp/clientconfdir/incexc/
+share/examples/burp/clientconfdir/incexc/example
+@sample ${SYSCONFDIR}/burp/clientconfdir/incexc/example
+share/examples/burp/clientconfdir/testclient
+@sample ${SYSCONFDIR}/burp/clientconfdir/testclient
+@sample /var/spool/burp/
+@mode
+@owner
+@group
+@rcscript ${RCDIR}/burp
diff --git pkg/burp.rc pkg/burp.rc
new file mode 100644
index 00000000000..98d0505c4ac
--- /dev/null
+++ pkg/burp.rc
@@ -0,0 +1,15 @@
+#!/bin/ksh
+#
+# $OpenBSD: burp.rc,v 1.3 2018/01/11 19:27:10 rpe Exp $
+
+daemon="${TRUEPREFIX}/sbin/burp"
+daemon_flags="-c ${SYSCONFDIR}/burp/burp-server.conf"
+
+. /etc/rc.d/rc.subr
+
+rc_pre() {
+ chown _burp ${SYSCONFDIR}/burp/ssl_cert_ca.pem
+ install -d -o _burp -g _burp /var/run/burp
+}
+
+rc_cmd $1

No comments:

Post a Comment