aboutsummaryrefslogtreecommitdiffstats
path: root/main/smokeping
diff options
context:
space:
mode:
authorJeff Bilyk <jbilyk@gmail.com>2011-10-04 21:34:26 +0000
committerJeff Bilyk <jbilyk@gmail.com>2011-10-04 21:34:26 +0000
commit5ecb19f58efbbf0db5eedf64a71db1651a1b9fcc (patch)
treebb914ee29acba918c32d393fb8782fad8cf9aade /main/smokeping
parentb2cd6d33cb032e7356f828ddfa5ae34f2f696777 (diff)
downloadaports-5ecb19f58efbbf0db5eedf64a71db1651a1b9fcc.tar.gz
aports-5ecb19f58efbbf0db5eedf64a71db1651a1b9fcc.tar.bz2
aports-5ecb19f58efbbf0db5eedf64a71db1651a1b9fcc.tar.xz
main/smokeping: fix several annoyances in 2.6.1 APKBUILD
- fix checksum for patch files - remove extra perl module files that are stored in dependent packages - fixed paths within files that were wrong
Diffstat (limited to 'main/smokeping')
-rw-r--r--main/smokeping/APKBUILD75
1 files changed, 69 insertions, 6 deletions
diff --git a/main/smokeping/APKBUILD b/main/smokeping/APKBUILD
index f052cec85b..2e54380fe5 100644
--- a/main/smokeping/APKBUILD
+++ b/main/smokeping/APKBUILD
@@ -24,8 +24,9 @@ depends="perl fping rrdtool perl-rrd
perl-fcgi
perl-config-grammar
"
-arch="all"
+arch="noarch"
license="GPL"
+subpackages="$pkgname-doc"
_builddir="$srcdir"/$pkgname-$pkgver
_vendorlib=/usr/share/perl5/vendor_perl
@@ -38,6 +39,9 @@ prepare() {
*.patch) msg $i; patch -p1 -i "$srcdir"/$i || return 1;;
esac
done
+
+ # provided by perl-snmp-session
+ rm -r lib/BER.pm lib/SNMP_Session.pm lib/SNMP_util.pm
}
build() {
@@ -45,22 +49,81 @@ build() {
./configure --prefix=/usr \
--bindir=/usr/bin \
--libdir=/usr/lib \
- --sysconfdir=/etc \
+ --sysconfdir=/etc/smokeping \
--libexecdir=/usr/libexec \
--datarootdir=/usr/share \
--mandir=/usr/share/man \
- --with-htdocs-dir=/usr/share/webapps \
+ --with-htdocs-dir=/usr/share/webapps/smokeping \
|| return 1
}
package() {
cd "$_builddir"
make DESTDIR="$pkgdir" install || return 1
+
+ for i in basepage.html config smokemail smokeping_secrets tmail; do
+ mv "$pkgdir"/etc/smokeping/${i}.dist "$pkgdir"/etc/smokeping/${i}
+ done
+
+ # Next part here cleans up the mess that the Makefile leaves behind...
+
+ # Fix path to config file
+ sed -i -e 's#/usr/etc/config#/etc/smokeping/config#' "$pkgdir"/usr/share/webapps/smokeping/smokeping.fcgi.dist
+
+ # Install cgi in the right spot and fix permissions
+ mv "$pkgdir"/usr/share/webapps/smokeping/smokeping.fcgi.dist "$pkgdir"/usr/share/webapps/smokeping/smokeping.cgi
+ chmod 755 "$pkgdir"/usr/share/webapps/smokeping/smokeping.cgi
+
+ # Fix up some paths within smokeping.cgi
+ sed -i -e 's:^use lib:#use lib:' \
+ -e 's:/etc/config:/etc/smokeping/config:' \
+ -e '1s:.*:#!/usr/bin/perl:' \
+ "$pkgdir"/usr/bin/smokeping_cgi || return 1
+
+ for i in smokeping smokeinfo; do
+ sed -e 's:^use lib:#use lib:g' \
+ -e 's:etc/config:/etc/smokeping/config:' \
+ -i "$pkgdir"/usr/bin/$i
+ done
+
+ sed -e 's:etc/config.dist:etc/smokeping/config:' \
+ -i "$pkgdir"/usr/bin/tSmoke
+
+ # config
+ sed -e '/^imgcache/{s:\(^imgcache[ \t]*=\).*:\1 /var/lib/smokeping/.simg:}' \
+ -e '/^imgurl/{s:\(^imgurl[ \t]*=\).*:\1 img:}' \
+ -e '/^datadir/{s:\(^datadir[ \t]*=\).*:\1 /var/lib/smokeping:}' \
+ -e '/^piddir/{s:\(^piddir[ \t]*=\).*:\1 /var/run/smokeping:}' \
+ -e '/^cgiurl/{s#\(^cgiurl[ \t]*=\).*#\1 http://some.place.xyz/perl/smokeping.pl#}' \
+ -e '/^smokemail/{s:\(^smokemail[ \t]*=\).*:\1 /etc/smokeping/smokemail:}' \
+ -e '/^tmail/{s:\(^tmail[ \t]*=\).*:\1 /etc/smokeping/tmail:}' \
+ -e '/^secrets/{s:\(^secrets[ \t]*=\).*:\1 /etc/smokeping/smokeping_secrets:}' \
+ -e '/^template/{s:\(^template[ \t]*=\).*:\1 /etc/smokeping/basepage.html:}' \
+ -e '/^sendmail/{s:usr/lib:usr/sbin:}' \
+ -i "$pkgdir"/etc/smokeping/config || return 1
+
+ # Create softlink for image directory
+ ln -s /var/lib/smokeping/.simg/ "$pkgdir"/usr/share/webapps/smokeping/img
+
+ sed -e '/^<script/{s:cropper/:/cropper/:}' \
+ -i etc/basepage.html.dist \
+ || return 1
+
+ chmod 700 "$pkgdir"/etc/smokeping/smokeping_secrets
+
+ # initscript
+ install -Dm755 "$srcdir"/smokeping.initd "$pkgdir"/etc/init.d/smokeping\
+ || return 1
+
+ install -d -o smokeping -g smokeping -m755 \
+ "$pkgdir"/var/lib/smokeping \
+ "$pkgdir"/var/lib/smokeping/.simg \
+ "$pkgdir"/var/run/smokeping
}
md5sums="f4a5437b71e02f982f08bf318bb9857d smokeping-2.6.1.tar.gz
550979e008f49299bf404aceeb81fe61 smokeping.initd
b3f3c968c582adb9e4e0fdcc9c7163e9 0001-fix-sysconfdir-in-etc.patch
-552c05ad77a3a4ca5a0deee3128a01f2 0002-fix-sysconfdir-in-doc.patch
-6bab62a79099cea322e4f9dd6fffd828 0003-fix-sysconfdir-in-lib.patch
-372c700c585efbe5d0e53476d2e0088b 0004-fix-sysconfdir-in-htdocs.patch"
+2bdafaade171bfb2241d1e6450fb094a 0002-fix-sysconfdir-in-doc.patch
+1942e4eceecb80b4bbe4cfc95e3e642f 0003-fix-sysconfdir-in-lib.patch
+974909d772ed67cbba45f20c14c2bb49 0004-fix-sysconfdir-in-htdocs.patch"