aboutsummaryrefslogtreecommitdiffstats
path: root/testing/poweradmin/APKBUILD
blob: 2ec8077ed1bac05b9c7c1f6910c28f225e5cd52d (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
# Contributor: Matt Smith <mcs@darkregion.net>
# Maintainer:  Matt Smith <mcs@darkregion.net>
pkgname=poweradmin
pkgver=2.1.5.999
pkgrel=0
pkgdesc="A Web-based PHP tool for administering PowerDNS"
url="https://www.poweradmin.org/"
arch="noarch"
license="GPL"
depends="php php-gettext php-mcrypt php-pear php-pear-mdb2 pdns"
# user needs to select either mysql or pgsql:
# - mysql php-mysql php-pear-mdb2-driver-mysql
# - postgresql php-pgsql php-pear-mdb2-driver-pgsql
depends_dev=
makedepends="$depends_dev wget"
install="$pkgname.post-install"
subpackages="$pkgname-doc"
source="https://www.poweradmin.org/download/poweradmin.nightly.tgz
	0010-fix-installer-config.patch
	0020-fix-for-mysql55.patch
	$pkgname.apache2.conf
	"

_builddir="$srcdir"/$pkgname-nightly
prepare() {
	local i
	cd "$_builddir"
	for i in $source; do
		case $i in
		*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
		esac
	done
}

build() {
	return 0
}

package() {
	# copy poweradmin
	mkdir -p "$pkgdir"/usr/share/webapps/$pkgname || return 1
	cp -ra "$_builddir"/* "$pkgdir"/usr/share/webapps/$pkgname/ || return 1

	# install empty config file (for the web installer)
	mkdir -p "$pkgdir"/etc/$pkgname || return 1
	touch "$pkgdir"/etc/$pkgname/config.inc.php || return 1
	chmod 660 "$pkgdir"/etc/$pkgname/config.inc.php || return 1
	ln -fs /etc/$pkgname/config.inc.php "$pkgdir"/usr/share/webapps/$pkgname/inc/config.inc.php || return 1

	# share files
	_shares="i18n-template-db.pot i18n-template-php.pot \
	poweradmin-mysql-db-structure.sql poweradmin-pgsql-db-structure.sql \
	powerdns-mysql-db-structure.sql powerdns-pgsql-db-structure.sql \
	powerdns-sqlite-db-structure.sql"
	for _share in $_shares; do
		install -Dm644 \
			"$pkgdir"/usr/share/webapps/$pkgname/docs/$_share \
			"$pkgdir"/usr/share/$pkgname/$_share || return 1
	done
	mv "$pkgdir"/usr/share/webapps/$pkgname/inc/config-me.inc.php \
		"$pkgdir"/usr/share/$pkgname/config-me.inc.php || return 1

	# install the apache2 config
	install -Dm644 "$srcdir"/$pkgname.apache2.conf \
		"$pkgdir"/etc/apache2/conf.d/$pkgname.conf || return 1
}

doc() {
	_docs="CHANGELOG LICENSE README"
	for _doc in $_docs; do
		install -Dm644 \
			"$pkgdir"/usr/share/webapps/$pkgname/docs/$_doc \
			"$subpkgdir"/usr/share/doc/$pkgname/$_doc || return 1
	done
	rm -rf "$pkgdir"/usr/share/webapps/$pkgname/docs || return 1
}

md5sums="323f19990f3b0263f16db1dc18e0d42d  poweradmin.nightly.tgz
f2936b9362269f5ed08dc853d49576cb  0010-fix-installer-config.patch
15638562a494a7ee3043e32476a47c94  0020-fix-for-mysql55.patch
a74d64fc95f48c64927dd10df214127a  poweradmin.apache2.conf"