summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Lenz2015-06-14 10:04:54 -0500
committerJason Lenz2015-06-14 10:04:54 -0500
commit6c1606b801534d905d56dbca9aadce818367ec9b (patch)
tree0fc56d161306ac28b79095b7b01b35329c9e1997
downloadaur-6c1606b801534d905d56dbca9aadce818367ec9b.tar.gz
Initial import
-rw-r--r--.SRCINFO38
-rw-r--r--01-libsync_fix.patch39
-rw-r--r--02-runpath_fix.patch12
-rw-r--r--PKGBUILD92
-rw-r--r--burp-client.service7
-rw-r--r--burp-client.timer12
-rw-r--r--burp-server.service11
-rw-r--r--burp.install8
-rw-r--r--readme-archlinux.txt28
9 files changed, 247 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..b455e5c77893
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,38 @@
+pkgbase = burp-backup
+ pkgdesc = A backup and restore program that uses librsync to reduce backup size.
+ pkgver = 1.3.48
+ pkgrel = 12
+ url = http://burp.grke.org/
+ install = burp.install
+ arch = i686
+ arch = x86_64
+ license = AGPL3
+ depends = librsync
+ depends = acl
+ depends = openssl
+ conflicts = burp-backup-dev
+ conflicts = burp-backup-git
+ conflicts = burp-backup14
+ backup = etc/burp/burp.conf
+ backup = etc/burp/burp-server.conf
+ backup = etc/burp/CA.cnf
+ backup = etc/logrotate.d/burp
+ source = http://downloads.sourceforge.net/project/burp/burp-1.3.48/burp-1.3.48.tar.bz2
+ source = burp.install
+ source = burp-server.service
+ source = burp-client.service
+ source = burp-client.timer
+ source = 01-libsync_fix.patch
+ source = 02-runpath_fix.patch
+ source = readme-archlinux.txt
+ sha256sums = bb456c208998d2f5806828357934e794cd9675448cb6545473364fd9e6d73509
+ sha256sums = 813b5c349f9d0ea1db2fb166531472b098a773aa3d2766d151f175ad17c40351
+ sha256sums = 94e1b5f8cf61c44f84675f685279e0d3376abd61ac1e6e4f5da0dd6b922c481f
+ sha256sums = 7908970e23cfb08554cbf53da1f8f3193a6b6ee076584f797644efab8431bfe3
+ sha256sums = 0310a26e9a0af76f847130019cb865dfa09a5e8f9899bfd6526c69e82d160bf4
+ sha256sums = 5dbd7bda6a45a3a8ff49cabe45f644d9761f827541624ac98457fbde421a6465
+ sha256sums = 0014c838d672c803c68c57a24ea84e12c5c7e6145b7974cf8e20db4ccb1bdb1c
+ sha256sums = e3e633f09d03efa3f2c1e769a2e31f514466ebd97cf6bb5f1ef0761e17abec67
+
+pkgname = burp-backup
+
diff --git a/01-libsync_fix.patch b/01-libsync_fix.patch
new file mode 100644
index 000000000000..9f857e13a29f
--- /dev/null
+++ b/01-libsync_fix.patch
@@ -0,0 +1,39 @@
+diff -aur burp.pristine/src/backup_phase2_server.c burp.new/src/backup_phase2_server.c
+--- burp.pristine/src/backup_phase2_server.c 2014-01-27 10:55:47.000000000 +0000
++++ burp.new/src/backup_phase2_server.c 2015-03-29 14:30:45.905800143 +0000
+@@ -480,7 +480,11 @@
+ free(curpath);
+
+ blocklen=get_librsync_block_len(cb->endfile);
++ #ifdef RS_DEFAULT_STRONG_LEN
+ if(!(p1b->sigjob=rs_sig_begin(blocklen, RS_DEFAULT_STRONG_LEN)))
++ #else
++ if(!(p1b->sigjob=rs_sig_begin(blocklen, 8, RS_MD4_SIG_MAGIC)))
++ #endif
+ {
+ logp("could not start signature job.\n");
+ return -1;
+diff -aur burp.pristine/src/backup_phase4_server.c burp.new/src/backup_phase4_server.c
+--- burp.pristine/src/backup_phase4_server.c 2014-01-27 10:56:18.000000000 +0000
++++ burp.new/src/backup_phase4_server.c 2015-03-29 14:30:45.905800143 +0000
+@@ -38,7 +38,7 @@
+ }
+ result=rs_sig_gzfile(dstfp, dstzp, sigp,
+ get_librsync_block_len(endfile),
+- RS_DEFAULT_STRONG_LEN, NULL, cntr);
++ 8, NULL, cntr);
+ gzclose_fp(&dstzp);
+ close_fp(&dstfp);
+ if(close_fp(&sigp))
+diff -aur burp.pristine/src/rs_buf.c burp.new/src/rs_buf.c
+--- burp.pristine/src/rs_buf.c 2014-01-27 10:55:47.000000000 +0000
++++ burp.new/src/rs_buf.c 2015-03-29 14:30:45.905800143 +0000
+@@ -497,7 +497,7 @@
+ rs_job_t *job;
+ rs_result r;
+
+- job = rs_sig_begin(new_block_len, strong_len);
++ job = rs_sig_begin(new_block_len, strong_len, RS_MD4_SIG_MAGIC);
+ r = rs_whole_gzrun(job, old_file, old_zfile, sig_file, NULL, cntr);
+ /*
+ if (stats)
diff --git a/02-runpath_fix.patch b/02-runpath_fix.patch
new file mode 100644
index 000000000000..c10107fc72f0
--- /dev/null
+++ b/02-runpath_fix.patch
@@ -0,0 +1,12 @@
+diff -aur burp.pristine/Makefile.in burp.new/Makefile.in
+--- burp.pristine/Makefile.in 2014-01-27 10:55:47.000000000 +0000
++++ burp.new/Makefile.in 2015-03-29 13:30:33.141852508 +0000
+@@ -90,7 +90,7 @@
+ $(MKDIR) $(DESTDIR)$(sbindir)
+ $(MKDIR) $(DESTDIR)$(sysconfdir)
+ $(MKDIR) $(DESTDIR)$(sysconfdir)/CA-client
+- $(MKDIR) $(DESTDIR)/var/run
++ $(MKDIR) $(DESTDIR)/run
+ $(MKDIR) $(DESTDIR)/var/spool/burp
+ @if [ ! -d $(DESTDIR)$(sysconfdir)/clientconfdir ] ; then $(MKDIR) $(DESTDIR)$(sysconfdir)/clientconfdir ; cp configs/server/clientconfdir/testclient $(DESTDIR)$(sysconfdir)/clientconfdir/testclient ; fi
+ @if [ ! -d $(DESTDIR)$(sysconfdir)/clientconfdir/incexc ] ; then $(MKDIR) $(DESTDIR)$(sysconfdir)/clientconfdir/incexc ; cp configs/server/clientconfdir/incexc $(DESTDIR)$(sysconfdir)/clientconfdir/incexc/example ; fi
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..e4046c03eb12
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,92 @@
+# Maintainer: Jason Lenz <Jason at Lenzplace dot org>
+# Contributor: RafaƂ Michalski <plum.michalski at gmail dot com>
+pkgname="burp-backup"
+_pkgname="burp"
+pkgver=1.3.48
+pkgrel=12
+pkgdesc="A backup and restore program that uses librsync to reduce backup size."
+arch=('i686' 'x86_64')
+license=("AGPL3")
+depends=('librsync' 'acl' 'openssl')
+makedepends=()
+conflicts=('burp-backup-dev' 'burp-backup-git' 'burp-backup14')
+install=$_pkgname.install
+url='http://burp.grke.org/'
+
+source=(
+ "http://downloads.sourceforge.net/project/${_pkgname}/${_pkgname}-${pkgver}/${_pkgname}-${pkgver}.tar.bz2"
+ "burp.install"
+ "burp-server.service"
+ "burp-client.service"
+ "burp-client.timer"
+ "01-libsync_fix.patch"
+ "02-runpath_fix.patch"
+ "readme-archlinux.txt"
+)
+
+sha256sums=(
+ bb456c208998d2f5806828357934e794cd9675448cb6545473364fd9e6d73509 # burp-${pkgver}.tar.bz2
+ 813b5c349f9d0ea1db2fb166531472b098a773aa3d2766d151f175ad17c40351 # burp.install
+ 94e1b5f8cf61c44f84675f685279e0d3376abd61ac1e6e4f5da0dd6b922c481f # burp-server.service
+ 7908970e23cfb08554cbf53da1f8f3193a6b6ee076584f797644efab8431bfe3 # burp-client.service
+ 0310a26e9a0af76f847130019cb865dfa09a5e8f9899bfd6526c69e82d160bf4 # burp-client.timer
+ 5dbd7bda6a45a3a8ff49cabe45f644d9761f827541624ac98457fbde421a6465 # libsync_fix.patch https://github.com/grke/burp/issues/273
+ 0014c838d672c803c68c57a24ea84e12c5c7e6145b7974cf8e20db4ccb1bdb1c # runpath_fix.patch change /var/run to /run
+ e3e633f09d03efa3f2c1e769a2e31f514466ebd97cf6bb5f1ef0761e17abec67 # arch linux specific instructions
+)
+
+backup=(
+ "etc/burp/burp.conf"
+ "etc/burp/burp-server.conf"
+ "etc/burp/CA.cnf"
+ "etc/logrotate.d/burp"
+)
+
+prepare() {
+ cd "$srcdir/$_pkgname"
+ patch -Np1 -i ../01-libsync_fix.patch
+ patch -Np1 -i ../02-runpath_fix.patch
+}
+
+build() {
+ cd "$srcdir/$_pkgname"
+ ./configure --sbindir=/usr/bin
+ make
+}
+
+package() {
+ cd "$srcdir/$_pkgname"
+ make DESTDIR="$pkgdir/" install
+
+ # Setup logrotate
+ mkdir -p $pkgdir/etc/logrotate.d
+ cp debian/logrotate $pkgdir/etc/logrotate.d/burp
+
+ # Copy useful user setup files
+ mkdir -p $pkgdir/usr/share/burp/
+ cp debian/burp.cron.d $pkgdir/usr/share/burp/
+ mkdir -p $pkgdir/usr/lib/systemd/system/
+ cp $srcdir/burp-server.service $pkgdir/usr/lib/systemd/system/
+ cp $srcdir/burp-client.service $pkgdir/usr/lib/systemd/system/
+ cp $srcdir/burp-client.timer $pkgdir/usr/lib/systemd/system/
+
+ # Copy archlinux specific documentation
+ mkdir -p $pkgdir/usr/share/doc/burp/
+ cp $srcdir/readme-archlinux.txt $pkgdir/usr/share/doc/burp/readme-archlinux.txt
+
+ # Fix permissions
+ mkdir -p $pkgdir/var/spool/burp
+ chmod 0755 $pkgdir/var/spool
+ chmod 0700 $pkgdir/var/spool/burp
+ chmod -R go-rwx $pkgdir/etc/burp
+
+ # Move "testclient" example to subfolder so it doesn't automatically get added to backup
+ mv $pkgdir/etc/burp/clientconfdir/testclient $pkgdir/etc/burp/clientconfdir/incexc
+}
+
+# Helpful packaging references:
+# General packaging -> https://wiki.archlinux.org/index.php/Creating_packages
+# Generating patches -> https://wiki.archlinux.org/index.php/Patching_in_ABS
+# Backing up package config files -> https://wiki.archlinux.org/index.php/Pacnew_and_Pacsave_files
+
+# vim:set ts=2 sw=2 et:
diff --git a/burp-client.service b/burp-client.service
new file mode 100644
index 000000000000..335b95eb41bf
--- /dev/null
+++ b/burp-client.service
@@ -0,0 +1,7 @@
+[Unit]
+Description=Burp backup client
+
+[Service]
+Type=simple
+ExecStart=/usr/sbin/burp -a t
+SuccessExitStatus=3
diff --git a/burp-client.timer b/burp-client.timer
new file mode 100644
index 000000000000..e7d5caa8bfc4
--- /dev/null
+++ b/burp-client.timer
@@ -0,0 +1,12 @@
+[Unit]
+Description=Checks every 20 minutes whether a backup is needed.
+
+[Timer]
+# Time to wait after booting before we run first time
+OnBootSec=5min
+# Time between running each consecutive time
+OnUnitActiveSec=20min
+Unit=burp-client.service
+
+[Install]
+WantedBy=multi-user.target
diff --git a/burp-server.service b/burp-server.service
new file mode 100644
index 000000000000..adf8a51ecddb
--- /dev/null
+++ b/burp-server.service
@@ -0,0 +1,11 @@
+[Unit]
+Description=Burp backup and restore server.
+
+[Service]
+User=root
+Type=forking
+KillMode=process
+ExecStart=/usr/sbin/burp -c /etc/burp/burp-server.conf
+
+[Install]
+WantedBy=multi-user.target
diff --git a/burp.install b/burp.install
new file mode 100644
index 000000000000..59ba2e0556c4
--- /dev/null
+++ b/burp.install
@@ -0,0 +1,8 @@
+post_install () {
+ echo "==> For burp usage instructions see http://burp.grke.org/"
+ echo "==> For arch linux specific instructions see /usr/share/doc/burp/readme-archlinux.txt"
+}
+
+post_upgrade () {
+ post_install $1
+}
diff --git a/readme-archlinux.txt b/readme-archlinux.txt
new file mode 100644
index 000000000000..612e237a567b
--- /dev/null
+++ b/readme-archlinux.txt
@@ -0,0 +1,28 @@
+*** For general usage instructions for burp backup refer to the link below:
+http://burp.grke.org/
+
+*** To setup a burp server edit the "/etc/burp/burp-server.conf" file as desired and then
+execute the following commands:
+# systemctl start burp-server.service
+# systemctl enable burp-server.service
+
+*** To create your first client configuration on the server.
+Copy the "testclient" example from /etc/burp/clientconfdir/incexc to
+/etc/burp/clientconfdir and edit it accordingly.
+
+*** To setup a linux client computer to run regular backups, edit "/etc/burp/burp.conf" and
+then execute the commands below.
+# systemctl start burp-client.timer
+# systemctl enable burp-client.timer
+The default timer configuration works pretty well, however if you want to manually edit the timer
+file it is located at "/usr/lib/systemd/system/burp-client.timer"
+The timer file calls "burp-client.service", so you can also edit that file in the same
+folder location as well. Note that you do not need to start or enable the service file
+as the timer calls it directly.
+
+*** Alternately to setup a cron service on the client to run regular backups ensure that a
+cron utility is installed (See the link below). Cron is not installed in ArchLinux
+by default.
+https://wiki.archlinux.org/index.php/Cron
+Then copy the burp cron template to the appropriate location such as in the example below.
+# cp /usr/share/burp/burp.cron.d /etc/cron.d/burp