summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 01d1707dca0913673475f11c1a42d36b19c52097 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
# Maintainer: Jason Lenz <Jason at Lenzplace dot org>
# Contributor: C. Dominik Bódi <dominik dot bodi at gmx dot de>
# Contributor: Rafał Michalski <plum.michalski at gmail dot com>
pkgname="burp-backup"
_pkgname="burp"
pkgver=2.1.32
pkgrel=1
pkgdesc="A backup and restore program that uses librsync to reduce backup size."
arch=('i686' 'x86_64')
license=("AGPL3")
depends=('acl' 'librsync' 'openssl')
makedepends=('uthash')
conflicts=('burp-backup-dev' 'burp-backup-git')
install="${_pkgname}.install"
url='https://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-runpath_fix.patch"
  "readme-archlinux.txt"
)

sha256sums=(
  56f8a13ae96e50f2274857a08c9f3d9f06ed6dee306d49fd189e3ff9f93c74fd # burp-2.1.32.tar.bz2
  813b5c349f9d0ea1db2fb166531472b098a773aa3d2766d151f175ad17c40351 # burp.install
  94e1b5f8cf61c44f84675f685279e0d3376abd61ac1e6e4f5da0dd6b922c481f # burp-server.service
  7908970e23cfb08554cbf53da1f8f3193a6b6ee076584f797644efab8431bfe3 # burp-client.service
  0310a26e9a0af76f847130019cb865dfa09a5e8f9899bfd6526c69e82d160bf4 # burp-client.timer
  6a612f083f512e5293c34db10bbfa0af5c4a4ca74b2ba83fd9bfdb9435f3a69c # 01-runpath_fix.patch
  e3e633f09d03efa3f2c1e769a2e31f514466ebd97cf6bb5f1ef0761e17abec67 # readme-archlinux.txt
)

backup=(
  "etc/burp/burp.conf"
  "etc/burp/burp-server.conf"
  "etc/burp/CA.cnf"
  "etc/logrotate.d/burp"
)

prepare() {
  cd "$srcdir/$_pkgname-$pkgver"
  patch -Np1 -i ../01-runpath_fix.patch
}

build() {
  cd "$_pkgname-$pkgver"
  autoreconf -vif
  # In the 2.70 version of autotools the ability exists to define "runstatedir"
  # which will eliminate the need for the patch file. Archlinux is currently at v2.69.
  # I.E. use "--runstatedir=/run" when 2.70 is released.
  ./configure --prefix=/usr \
              --sbindir=/usr/bin \
              --localstatedir=/var \
              --sysconfdir=/etc/burp
  make
}

package() {
  cd "$_pkgname-$pkgver"
  make DESTDIR="$pkgdir/" install-all

  # 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: