aboutsummaryrefslogtreecommitdiffstats
path: root/community/bareos/APKBUILD
blob: c1774aa67c4c5fd665c85b05e0dbdc054cb3aa7c (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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
# Contributor: Valery Kartel <valery.kartel@gmail.com>
# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=bareos
pkgver=17.2.4
pkgrel=1
pkgdesc="Bareos - Backup Archiving REcovery Open Sourced"
url="http://www.bareos.org"
arch="all"
options="!check"
license="AGPL-3.0"
depends="perl"
makedepends="file libtool libintl libpcap-dev lzo-dev \
	sqlite-dev postgresql-dev gnutls-dev mariadb-connector-c-dev acl-dev \
	qt-dev python-dev readline-dev ncurses-dev jansson-dev"
install="$pkgname.pre-install $pkgname.post-install"
subpackages="$pkgname-dev $pkgname-doc $pkgname-trayicon"
pkgusers=$pkgname
pkggroups=$pkgname
source="$pkgname-$pkgver.tar.gz::https://github.com/$pkgname/$pkgname/archive/Release/$pkgver.tar.gz
	$pkgname-dir.initd
	$pkgname-sd.initd
	$pkgname-fd.initd
	path-mounted.patch
	mariadb.patch
	"
builddir="$srcdir"/${pkgname}-Release-${pkgver}

prepare() {
	update_config_guess
	default_prepare
}

build() {
	cd "$builddir"
	./configure \
		--prefix=/usr \
		--sysconfdir=/etc \
		--localstatedir=/var \
		--with-basename=$pkgname \
		--with-hostname=localhost \
		--with-confdir=/etc/$pkgname \
		--with-archivedir=/var/lib/$pkgname/archive \
		--with-scriptdir=/etc/$pkgname/scripts \
		--with-working-dir=/var/lib/$pkgname \
		--with-plugindir=/usr/lib/$pkgname \
		--with-backenddir=/usr/lib/$pkgname \
		--with-pid-dir=/run/$pkgname \
		--with-logdir=/var/log/$pkgname \
		--with-subsys-dir=/var/lock \
		--enable-smartalloc \
		--enable-largefile \
		--enable-readline \
		--enable-traymonitor \
		--enable-batch-insert \
		--enable-acl \
		--enable-xattr \
		--enable-scsi-crypto \
		--enable-lmdb \
		--enable-ipv6 \
		--enable-dynamic-cats-backends \
		--enable-dynamic-debian-package-list \
		--enable-sql-pooling \
		--enable-includes \
		--disable-conio \
		--disable-nls \
		--disable-rpath \
		--with-postgresql \
		--with-mysql \
		--with-sqlite3 \
		--with-gnutls \
		--with-python \
		--without-openssl \
		--without-systemd \
		--with-dir-user=$pkgname \
		--with-dir-group=$pkgname \
		--with-sd-user=$pkgname \
		--with-sd-group=$pkgname \
		--with-fd-user=root \
		--with-fd-group=$pkgname

	# work around parallel build issue
	for i in src scripts src/lib src/findlib src/lmdb src/filed \
			src/qt-tray-monitor src/console src/plugins/filed \
			src/cats; do
		make -C "$i"
	done
	make
}

package() {
	cd "$builddir"
	make DESTDIR="$pkgdir" install
	mkdir -p "$pkgdir"/usr/sbin
	mkdir -p "$pkgdir"/usr/bin

	local daemon; for daemon in dir sd fd; do
		install -Dm755 "$srcdir"/$pkgname-$daemon.initd \
			"$pkgdir"/etc/init.d/$pkgname-$daemon
	done

	# Install logrotate script
	install -Dm644 scripts/logrotate "$pkgdir"/etc/logrotate.d/$pkgname

	# Fix job to use shell script instead of perl script
	sed -i -e 's/make_catalog_backup.pl/make_catalog_backup/' \
		"$pkgdir"/etc/bareos/bareos-dir.d/job/BackupCatalog.conf
}

trayicon() {
	local dir
	provides="$pkgname-tray-monitor"
	depends="$pkgname"
	pkgdesc="$pkgdesc (qt tray monitor)"
	mkdir -p "$subpkgdir"/etc/$pkgname "$subpkgdir"/usr/bin
	mv "$pkgdir"/usr/share "$subpkgdir"/usr
	mv "$pkgdir"/etc/xdg "$subpkgdir"/etc
	mv "$pkgdir"/etc/$pkgname/tray-monitor.d "$subpkgdir"/etc/$pkgname
	mv "$pkgdir"/usr/bin/bareos-tray-monitor "$subpkgdir"/usr/bin
	for dir in bareos-dir.d/console bareos-fd.d/director bareos-sd.d/director; do
		mkdir -p "$subpkgdir"/etc/$pkgname/$dir
		mv "$pkgdir"/etc/$pkgname/$dir/bareos-mon.conf \
			"$subpkgdir"/etc/$pkgname/$dir
	done
}

sha512sums="165bee4dcfabac7e72839831de7067b4dafd1f82dd1615d7fa08ca331b1b3efa516555e33ca2d2ef42482c9b5104769c5ef3dd40a12e1954934874b6884ea26b  bareos-17.2.4.tar.gz
eb1e7072b579bf9ae21f2e351d6900abb277db64e373f4760bac8188b82929376e4a196d2c935cefe1ae4cc2c396f2fcba1a25642b26e2f92a0d008fbdc4b5f2  bareos-dir.initd
c770b1d041fafef93d4eb0269ba8d9733e85ef465657fe8dd5d5c68a27ec773cec9c5c582d4a16596d95bbf6dbd3f7194dc9c0d8ed73138e9fb438fba9aa9445  bareos-sd.initd
c6347079dbcef5f4a69ec0c4ecc31803520d715d599d89c6bbfbb3741a86c50d7295c30432889b13ee9c16f2feaa84b1c6ae992cfee6505d569c6493d7e85a5b  bareos-fd.initd
eac4614c1b29ff0f12061837e425ae495890076021b6d1b0f1beb93501cfb905170342dac5dab69b09f825d5b9416eea25fa02e2174b5a704315c7feb08ff3d3  path-mounted.patch
fd4b06cc8f118c05afbc03238376c7c6bedaf3f564090819e3fb1ab01320c79e1515ea7a81a307648015cc98a2a14aceb67684a166b986c5314bfd23b1e5ebde  mariadb.patch"