diff options
author | Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> | 2017-07-06 15:21:08 +0300 |
---|---|---|
committer | Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> | 2017-07-06 15:21:08 +0300 |
commit | 95ca92e319b7b5215eaa6b0476947f922e6d0b13 (patch) | |
tree | e025fb7d48cb734780f4def6d761e188a1a4dd4b /community/homer-api | |
parent | cb2326db70e5fd238e985d18b55c6650d8ef3876 (diff) | |
download | alpine_aports-95ca92e319b7b5215eaa6b0476947f922e6d0b13.tar.bz2 alpine_aports-95ca92e319b7b5215eaa6b0476947f922e6d0b13.tar.xz alpine_aports-95ca92e319b7b5215eaa6b0476947f922e6d0b13.zip |
community/homer-*: moved from testing
Diffstat (limited to 'community/homer-api')
-rw-r--r-- | community/homer-api/APKBUILD | 61 | ||||
-rw-r--r-- | community/homer-api/homer_db_init | 24 | ||||
-rw-r--r-- | community/homer-api/rotation-ini-path.patch | 28 |
3 files changed, 113 insertions, 0 deletions
diff --git a/community/homer-api/APKBUILD b/community/homer-api/APKBUILD new file mode 100644 index 0000000000..4e702e52fb --- /dev/null +++ b/community/homer-api/APKBUILD | |||
@@ -0,0 +1,61 @@ | |||
1 | # Contributor: Leonardo Arena <rnalrd@alpinelinux.org> | ||
2 | # Maintainer: Kaarle Ritvanen <kaarle.ritvanen@datakunkku.fi> | ||
3 | pkgname=homer-api | ||
4 | pkgver=5.0.6 | ||
5 | pkgrel=9 | ||
6 | pkgdesc="HOMER API" | ||
7 | url="https://github.com/sipcapture/homer-api" | ||
8 | arch="noarch" | ||
9 | license="GPL" | ||
10 | depends="homer-db php7-ctype php7-json php7-pdo_mysql php7-session" | ||
11 | makedepends="$depends_dev" | ||
12 | options="!check" | ||
13 | subpackages="$pkgname-doc homer-db" | ||
14 | source="$pkgname-$pkgver.tar.gz::https://github.com/sipcapture/homer-api/archive/$pkgver.tar.gz | ||
15 | homer_db_init | ||
16 | rotation-ini-path.patch" | ||
17 | builddir="$srcdir"/$pkgname-$pkgver | ||
18 | |||
19 | build() { | ||
20 | return 0 | ||
21 | } | ||
22 | |||
23 | package() { | ||
24 | cd "$builddir" | ||
25 | local file | ||
26 | local appdir=$pkgdir/usr/share/webapps/homer | ||
27 | |||
28 | mkdir -p "$appdir" \ | ||
29 | "$pkgdir"/etc/homer \ | ||
30 | "$pkgdir"/usr/share/doc/homer-api | ||
31 | |||
32 | mv api "$appdir" | ||
33 | |||
34 | for file in configuration preferences; do | ||
35 | mv "$appdir"/api/${file}_example.php "$pkgdir"/etc/homer/$file.php | ||
36 | ln -s /etc/homer/$file.php "$appdir"/api | ||
37 | done | ||
38 | |||
39 | cp -R examples "$pkgdir"/usr/share/doc/homer-api | ||
40 | } | ||
41 | |||
42 | db() { | ||
43 | depends="mariadb-client perl perl-dbi perl-dbd-mysql" | ||
44 | |||
45 | cd "$builddir" | ||
46 | mkdir -p \ | ||
47 | "$subpkgdir"/etc/periodic/daily \ | ||
48 | "$subpkgdir"/usr/share/homer-db | ||
49 | |||
50 | install -D -m 644 scripts/rotation.ini \ | ||
51 | "$subpkgdir"/etc/homer/rotation.ini | ||
52 | cp -pr sql/* "$subpkgdir"/usr/share/homer-db | ||
53 | |||
54 | install -D "$srcdir"/homer_db_init "$subpkgdir"/usr/bin/homer_db_init | ||
55 | cp -p scripts/homer_* "$subpkgdir"/usr/bin | ||
56 | ln -s /usr/bin/homer_rotate "$subpkgdir"/etc/periodic/daily | ||
57 | } | ||
58 | |||
59 | sha512sums="620185c19bd348ba68bad3a1992b7d673d29dcfb8a0aeea437a2d31e90f0a21cf6f46a43f0041a583a14d9403e1d8574c6040da1dba397ec2d955b8aba9010d8 homer-api-5.0.6.tar.gz | ||
60 | e305af57a8445b45cb1e894aa34ceea3aeedb60740a636229d470d872f9ebb835e03985faeb685180a3e2c1eae29b49c841f8cbdb4236dbf0323f905a30b0bbb homer_db_init | ||
61 | 0328c4f645601be150f877a31a8c245908da9d9972bed6e1af50f2c43055c9f47376da30c666b6eaa0310637414f65906b88f9a339a1dfa14e1864c70b36fa77 rotation-ini-path.patch" | ||
diff --git a/community/homer-api/homer_db_init b/community/homer-api/homer_db_init new file mode 100644 index 0000000000..c80328ac6a --- /dev/null +++ b/community/homer-api/homer_db_init | |||
@@ -0,0 +1,24 @@ | |||
1 | #!/bin/sh -e | ||
2 | |||
3 | # HOMER database setup script | ||
4 | # Copyright (c) 2017 Kaarle Ritvanen | ||
5 | |||
6 | exec_sql() { | ||
7 | mysql $2 < /usr/share/homer-db/$1.sql | ||
8 | } | ||
9 | |||
10 | exec_sql homer_databases | ||
11 | exec_sql homer_user | ||
12 | |||
13 | for db in configuration data statistic; do | ||
14 | exec_sql schema_$db homer_$db | ||
15 | done | ||
16 | |||
17 | homer_rotate | ||
18 | |||
19 | [ "$1" = -r ] || exit 0 | ||
20 | |||
21 | mysql <<EOF | ||
22 | CREATE USER 'homer_user' IDENTIFIED BY 'homer_password'; | ||
23 | GRANT SELECT ON homer_data.* TO 'homer_user'; | ||
24 | EOF | ||
diff --git a/community/homer-api/rotation-ini-path.patch b/community/homer-api/rotation-ini-path.patch new file mode 100644 index 0000000000..52d42f7b09 --- /dev/null +++ b/community/homer-api/rotation-ini-path.patch | |||
@@ -0,0 +1,28 @@ | |||
1 | --- homer-api-5.0.6/scripts/homer_partremove | ||
2 | +++ homer-api-5.0.6.alpine/scripts/homer_partremove | ||
3 | @@ -3,9 +3,8 @@ | ||
4 | # Set correct bin path if we are running as a cron job | ||
5 | PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin | ||
6 | |||
7 | -bin_dir=`dirname $0` | ||
8 | -programm="$bin_dir/homer_mysql_remove_partitions.pl" | ||
9 | -config="$bin_dir/rotation.ini" | ||
10 | +programm="homer_mysql_remove_partitions.pl" | ||
11 | +config=/etc/homer/rotation.ini | ||
12 | |||
13 | $programm $config | ||
14 | |||
15 | --- homer-api-5.0.6/scripts/homer_rotate | ||
16 | +++ homer-api-5.0.6.alpine/scripts/homer_rotate | ||
17 | @@ -3,9 +3,8 @@ | ||
18 | # Set correct bin path if we are running as a cron job | ||
19 | PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin | ||
20 | |||
21 | -bin_dir=`dirname $0` | ||
22 | -programm="$bin_dir/homer_mysql_rotate.pl" | ||
23 | -config="$bin_dir/rotation.ini" | ||
24 | +programm="homer_mysql_rotate.pl" | ||
25 | +config=/etc/homer/rotation.ini | ||
26 | |||
27 | if [ $# -ne 0 ] | ||
28 | then | ||