aboutsummaryrefslogtreecommitdiffstats
path: root/main/net-snmp
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2012-04-19 19:51:43 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2012-04-19 20:04:21 +0000
commit69389f2e0065079afe7b85bb4e9995c5beaf2452 (patch)
tree0f0258245884875d517de9ce609cced7d2a50fe6 /main/net-snmp
parent8f2b9bbd23a32d826d22d1235b9c9bb88a74ee38 (diff)
downloadaports-69389f2e0065079afe7b85bb4e9995c5beaf2452.tar.bz2
aports-69389f2e0065079afe7b85bb4e9995c5beaf2452.tar.xz
main/net-snmp: misc fixes and reorganize
- use perl vendor dir instead of /usr/local - fix parallel build issue with man aliases - split -libs -agent-libs -perl and -gui subpackages
Diffstat (limited to 'main/net-snmp')
-rw-r--r--main/net-snmp/APKBUILD65
1 files changed, 63 insertions, 2 deletions
diff --git a/main/net-snmp/APKBUILD b/main/net-snmp/APKBUILD
index 73f902cc98..6e2d7bfc19 100644
--- a/main/net-snmp/APKBUILD
+++ b/main/net-snmp/APKBUILD
@@ -2,7 +2,7 @@
# Maintainer: Carlo Landmeter <clandmeter@gmail.com>
pkgname=net-snmp
pkgver=5.7.1
-pkgrel=2
+pkgrel=3
pkgdesc="Simple Network Management Protocol"
url="http://www.net-snmp.org/"
arch="all"
@@ -10,7 +10,8 @@ license="GPL"
depends=
depends_dev="openssl-dev"
makedepends="perl-dev openssl-dev"
-subpackages="$pkgname-doc $pkgname-dev $pkgname-tools"
+subpackages="$pkgname-doc $pkgname-dev $pkgname-libs $pkgname-agent-libs:alibs
+ $pkgname-perl:pl $pkgname-gui $pkgname-tools"
source="http://downloads.sourceforge.net/$pkgname/$pkgname-$pkgver.tar.gz
netsnmp-arp-netlink-fix.patch
netsnmp-swinst-crash.patch
@@ -62,16 +63,28 @@ build() {
--enable-ipv6 \
--enable-shared \
--enable-as-needed \
+ --with-perl-modules="INSTALLDIRS=vendor" \
--disable-embedded-perl
# embedded-perl seems to create TEXTREL's
+ # work around parallell build issue
+ make sedscript && make -j1 -C man || return 1
make || return 1
}
package() {
cd "$_builddir"
make -j1 DESTDIR="$pkgdir" install || return 1
+ # remove things we dont want distribute
rm "$pkgdir"/usr/lib/*.la || return 1
+ rm "$pkgdir"/usr/lib/libsnmp* \
+ "$pkgdir"/usr/bin/snmpcheck \
+ "$pkgdir"/usr/bin/fixproc \
+ "$pkgdir"/usr/share/man/man1/fixproc* \
+ "$pkgdir"/usr/bin/ipf-mod.pl \
+ "$pkgdir"/usr/bin/snmpinform \
+ || return 1
+ ln -s snmptrap "$pkgdir"/usr/bin/snmpinform || return 1
install -m755 -D "$srcdir"/snmpd.initd "$pkgdir"/etc/init.d/snmpd
install -m644 -D "$srcdir"/snmpd.confd "$pkgdir"/etc/conf.d/snmpd
@@ -82,7 +95,55 @@ package() {
find "$pkgdir" -name perllocal.pod -delete
}
+libs() {
+ pkgdesc="The NET-SNMP runtime client libraries"
+ replaces="net-snmp"
+ mkdir -p "$subpkgdir"/usr/lib "$subpkgdir"/usr/share/snmp || return 1
+ mv "$pkgdir"/usr/lib/libnetsnmp.so.* "$subpkgdir"/usr/lib/ || return 1
+ mv "$pkgdir"/usr/share/snmp/mibs "$subpkgdir"/usr/share/snmp/ \
+ || return 1
+}
+
+alibs() {
+ pkgdesc="The NET-SNMP runtime agent libraries"
+ replaces="net-snmp"
+ mkdir -p "$subpkgdir"/usr/lib
+ mv "$pkgdir"/usr/lib/libnetsnmpagent*.so.* \
+ "$pkgdir"/usr/lib/libnetsnmphelpers*.so.* \
+ "$pkgdir"/usr/lib/libnetsnmpmibs*.so.* \
+ "$pkgdir"/usr/lib/libnetsnmptrapd*.so.* \
+ "$subpkgdir"/usr/lib/
+}
+
+pl() {
+ pkgdesc="The perl NET-SNMP module and the mib2c tool"
+ replaces="net-snmp"
+ mkdir -p "$subpkgdir"/usr/lib \
+ "$subpkgdir"/usr/bin \
+ "$subpkgdir"/usr/share/snmp
+
+ mv "$pkgdir"/usr/bin/mib2c-update \
+ "$pkgdir"/usr/bin/mib2c \
+ "$pkgdir"/usr/bin/snmp-bridge-mib \
+ "$pkgdir"/usr/bin/net-snmp-cert \
+ "$pkgdir"/usr/bin/traptoemail \
+ "$subpkgdir"/usr/bin/ || return 1
+ mv "$pkgdir"/usr/lib/perl* "$subpkgdir"/usr/lib/
+ mv "$pkgdir"/usr/share/snmp/mib2c* \
+ "$pkgdir"/usr/share/snmp/*.pl \
+ "$subpkgdir"/usr/share/snmp/
+}
+
+gui() {
+ pkgdesc="An interactive graphical MIB browser for SNMP"
+ depends="perl-net-snmp" # needs perl-tk too...
+ replaces="net-snmp-tools"
+ mkdir -p "$subpkgdir"/usr/bin
+ mv "$pkgdir"/usr/bin/tkmib "$subpkgdir"/usr/bin/
+}
+
tools() {
+ pkgdesc="Network management utilities using SNMP"
mkdir -p "$subpkgdir"/usr
mv "$pkgdir"/usr/bin "$subpkgdir"/usr
}