aboutsummaryrefslogtreecommitdiffstats
path: root/community/bareos/APKBUILD
blob: b7811739a5e2695cabbe8853ae91ff6d3a178bf0 (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
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
# Contributor: Valery Kartel <valery.kartel@gmail.com>
# Contributor: Francesco Colista <fcolista@alpinelinux.org>
# Maintainer: Francesco Colista <fcolista@alpinelinux.org>
pkgname=bareos
pkgver=18.2.6
pkgrel=2
pkgdesc="Bareos - Backup Archiving REcovery Open Sourced"
url="http://www.bareos.org"
arch="all"
options="!check"
license="AGPL-3.0"
depends=""
makedepends="cmake gawk
lzo-dev acl-dev gettext-dev
readline-dev ncurses-dev jansson-dev
sqlite-dev postgresql-dev mariadb-connector-c-dev
php7"
install="$pkgname.pre-install $pkgname.post-install"
subpackages="$pkgname-dev $pkgname-doc $pkgname-openrc $pkgname-dbg
$pkgname-mysql:_mysql $pkgname-sqlite:_sqlite $pkgname-postgresql:_postgresql
$pkgname-webui:_webui:noarch $pkgname-webui-apache2:_webui_apache2:noarch $pkgname-webui-nginx:_webui_nginx:noarch"
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
	detect-alpine.patch
	add-libintl.patch
	nginx-conf.patch
	path-mounted.patch
	649ae58a65f6cdbcf7ee770a0d5b5cf51b5e412b.patch
	"
builddir="$srcdir"/${pkgname}-Release-${pkgver}

prepare() {
	default_prepare
	cd "$builddir"
	mkdir -pv core/platforms/alpine
	touch core/platforms/alpine/CMakeLists.txt

	# cleanup stale builddir and recreate
	[ -d cmake-build ] && rm -rfv cmake-build
	mkdir cmake-build
}

build() {
	cd "$builddir"/cmake-build

	cmake .. \
		-DCMAKE_VERBOSE_MAKEFILE=ON \
		-DCMAKE_INSTALL_PREFIX:PATH=/usr \
		-DCMAKE_INSTALL_LIBDIR:PATH=/usr/lib \
		-DBUILD_SHARED_LIBS:BOOL=ON \
		-Dsysconfdir=/etc \
		-Dbasename=$pkgname \
		-Dhostname=localhost \
		-Dconfdir=/etc/$pkgname \
		-Dlibdir=/usr/lib \
		-Darchivedir=/var/lib/$pkgname/archive \
		-Dworkingdir=/var/lib/$pkgname \
		-Dscriptdir=/etc/$pkgname/scripts \
		-Dplugindir=/usr/lib/$pkgname \
		-Dbackenddir=/usr/lib/$pkgname \
		-Dlogdir=/var/log/$pkgname \
		-Dpiddir=/run/$pkgname \
		-Dbsrdir=/run/$pkgname \
		-Dsubsysdir=/var/lock \
		-Dsmartalloc=yes \
		-Dbatch-insert=yes \
		-Dscsi-crypto=yes \
		-Dlmdb=yes \
		-Dipv6=yes \
		-Ddynamic-cats-backends=yes \
		-Dpostgresql=yes \
		-Dmysql=yes \
		-Dsqlite3=yes \
		-Dopenssl=yes \
		-Dtraymonitor=no \
		-Dsystemd=no \
		-Dndmp=no \
		-Ddir-user=$pkgname \
		-Ddir-group=$pkgname \
		-Dsd-user=$pkgname \
		-Dsd-group=$pkgname \
		-Dfd-user=root \
		-Dfd-group=$pkgname

	make
}

package() {
	cd "$builddir"/cmake-build
	make DESTDIR="$pkgdir" install
	mkdir -p "$pkgdir"/usr/sbin
	mkdir -p "$pkgdir"/usr/bin
	mkdir -p "$pkgdir"/var/lib/bareos
	mkdir -p "$pkgdir"/var/log/bareos

	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 ../core/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

	# remove perl script
	rm "$pkgdir"/etc/bareos/scripts/make_catalog_backup.pl

	# remove http configuration
	rm -r "$pkgdir"/etc/httpd
}

_mysql() {
	description="$description (mysql driver)"
	mkdir -p "$subpkgdir"/usr/lib/bareos
	mv "$pkgdir"/usr/lib/bareos/libbareoscats-mysql.so "$subpkgdir"/usr/lib/bareos/

	for _i in creates grants updates; do
		mkdir -p "$subpkgdir"/etc/bareos/scripts/ddl/$_i
		mv "$pkgdir"/etc/bareos/scripts/ddl/$_i/mysql*.sql "$subpkgdir"/etc/bareos/scripts/ddl/$_i/
	done
}

_sqlite() {
	description="$description (sqlite driver)"
	mkdir -p "$subpkgdir"/usr/lib/bareos
	mv "$pkgdir"/usr/lib/bareos/libbareoscats-sqlite3.so "$subpkgdir"/usr/lib/bareos/

	for _i in creates updates; do
		mkdir -p "$subpkgdir"/etc/bareos/scripts/ddl/$_i
		mv "$pkgdir"/etc/bareos/scripts/ddl/$_i/sqlite3*.sql "$subpkgdir"/etc/bareos/scripts/ddl/$_i/
	done
}

_postgresql() {
	description="$description (postgresql driver)"
	mkdir -p "$subpkgdir"/usr/lib/bareos
	mv "$pkgdir"/usr/lib/bareos/libbareoscats-postgresql.so "$subpkgdir"/usr/lib/bareos/

	for _i in creates grants updates; do
		mkdir -p "$subpkgdir"/etc/bareos/scripts/ddl/$_i
		mv "$pkgdir"/etc/bareos/scripts/ddl/$_i/postgresql*.sql "$subpkgdir"/etc/bareos/scripts/ddl/$_i/
	done
}

_webui() {
	description="$description (webui)"
	depends="php7 php7-gettext php7-mbstring php7-session php7-ctype php7-openssl php7-json"

	mkdir -p "$subpkgdir"/usr/share
	mv "$pkgdir"/bareos-webui "$subpkgdir"/usr/share/

	mkdir -p "$subpkgdir"/etc
	mv "$pkgdir"/etc/bareos-webui "$subpkgdir"/etc/

	mkdir -p "$subpkgdir"/etc/bareos/bareos-dir.d/console/
	mv "$pkgdir"/etc/bareos/bareos-dir.d/console/admin.conf.example "$subpkgdir"/etc/bareos/bareos-dir.d/console/

	mkdir -p "$subpkgdir"/etc/bareos/bareos-dir.d/profile/
	mv "$pkgdir"/etc/bareos/bareos-dir.d/profile/webui-admin.conf "$subpkgdir"/etc/bareos/bareos-dir.d/profile/
}

_webui_apache2() {
	description="$description (webui apache2 configuration)"
	depends="$pkgname-webui php7-apache2"

	mkdir -p "$subpkgdir"/etc/apache2/conf.d
	cp "$builddir"/webui/install/apache/bareos-webui.conf "$subpkgdir"/etc/apache2/conf.d/
}


_webui_nginx() {
	description="$description (webui apache2 configuration)"
	depends="$pkgname-webui nginx"

	mkdir -p "$subpkgdir"/etc/nginx/conf.d
	cp "$builddir"/webui/install/nginx/bareos-webui.conf "$subpkgdir"/etc/nginx/conf.d/
}


sha512sums="b6618173a803db4cfc3fe7edfe8c9e4e4128195f44383cd7df5b9866da4290686ed7cb42499edec957a5d9ab8bbd92d26258ce58f13fba84fb569167956768c3  bareos-18.2.6.tar.gz
eb1e7072b579bf9ae21f2e351d6900abb277db64e373f4760bac8188b82929376e4a196d2c935cefe1ae4cc2c396f2fcba1a25642b26e2f92a0d008fbdc4b5f2  bareos-dir.initd
c770b1d041fafef93d4eb0269ba8d9733e85ef465657fe8dd5d5c68a27ec773cec9c5c582d4a16596d95bbf6dbd3f7194dc9c0d8ed73138e9fb438fba9aa9445  bareos-sd.initd
c6347079dbcef5f4a69ec0c4ecc31803520d715d599d89c6bbfbb3741a86c50d7295c30432889b13ee9c16f2feaa84b1c6ae992cfee6505d569c6493d7e85a5b  bareos-fd.initd
1251d81d142b58bb2f5ab2ea762068fe2273aa5face9dfd314011706e9c2189ecab36b80f76317a595679f164b124cff85623c1ec98cc6997e350b6223f2a524  detect-alpine.patch
1439b8f72e39ca27689dbcc1a58c63f22b7dc4d4bee480408a4c388e30c0c3434915e5162fa7e55d16b3a80c9e4727b96263ab5edc9dda52acb38737e136f147  add-libintl.patch
0f73f38237a2320785b565d92c175de2c0c333081723c98b026f188b67ad738b5157222bc233811c6dafda3ddcdabf6849d5eeccc6723e0506e35923309cbcee  nginx-conf.patch
2fb3d059185efb9c492d865ed79810971992ea2d8609639b4260b3338cbd0e89dc8ad0b3031be868d13b21ed9a93ff444703332f0864bbec7ce3e691210d05f7  path-mounted.patch
5bbad4f2b831ac51b41319965675ff7d828ab518eb87b682e91e49fdd10d2ee6580968a5cf79df5bda5f3bad957ce251d40b561a48dab5b32bc217a972d1276b  649ae58a65f6cdbcf7ee770a0d5b5cf51b5e412b.patch"