/[gentoo-x86]/net-analyzer/net-snmp/net-snmp-5.7.2_rc1.ebuild
Gentoo

Contents of /net-analyzer/net-snmp/net-snmp-5.7.2_rc1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.11 - (show annotations) (download)
Fri Oct 5 17:04:55 2012 UTC (21 months, 3 weeks ago) by ranger
Branch: MAIN
Changes since 1.10: +2 -2 lines
Marking net-snmp-5.7.2_rc1 ppc for bug 431752

(Portage version: 2.1.10.65/cvs/Linux ppc64)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/net-analyzer/net-snmp/net-snmp-5.7.2_rc1.ebuild,v 1.10 2012/08/28 17:56:12 ranger Exp $
4
5 EAPI=4
6 PYTHON_DEPEND="python? 2"
7
8 WANT_AUTOMAKE=none
9
10 PATCHSET=3
11
12 inherit eutils perl-module python autotools
13
14 MY_P="${P/_rc/.rc}"
15
16 DESCRIPTION="Software for generating and retrieving SNMP data"
17 HOMEPAGE="http://net-snmp.sourceforge.net/"
18 SRC_URI="mirror://sourceforge/${PN}/${MY_P}.tar.gz
19 http://dev.gentoo.org/~flameeyes/${PN}/${MY_P}-patches-${PATCHSET}.tar.xz"
20
21 # GPL-2 for the init scripts
22 LICENSE="as-is BSD GPL-2"
23 SLOT="0"
24 KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86"
25 IUSE="bzip2 doc elf ipv6 mfd-rewrites minimal perl python rpm selinux ssl tcpd X zlib lm_sensors ucd-compat"
26
27 COMMON="ssl? ( >=dev-libs/openssl-0.9.6d )
28 tcpd? ( >=sys-apps/tcp-wrappers-7.6 )
29 rpm? (
30 app-arch/rpm
31 dev-libs/popt
32 )
33 bzip2? ( app-arch/bzip2 )
34 zlib? ( >=sys-libs/zlib-1.1.4 )
35 elf? ( dev-libs/elfutils )
36 python? ( dev-python/setuptools )
37 sys-apps/pciutils
38 lm_sensors? ( sys-apps/lm_sensors )"
39
40 RDEPEND="${COMMON}
41 perl? (
42 X? ( dev-perl/perl-tk )
43 !minimal? ( dev-perl/TermReadKey )
44 )
45 selinux? ( sec-policy/selinux-snmp )
46 sys-apps/openrc"
47
48 # Dependency on autoconf due to bug #225893
49 DEPEND="${COMMON}
50 >=sys-apps/sed-4
51 doc? ( app-doc/doxygen )"
52
53 REQUIRED_USE="rpm? ( bzip2 zlib )"
54
55 RESTRICT=test
56
57 S="${WORKDIR}/${MY_P}"
58
59 pkg_setup() {
60 if use python; then
61 python_set_active_version 2
62 python_pkg_setup
63 fi
64 }
65
66 src_prepare() {
67 # snmpconf generates config files with proper selinux context
68 use selinux && epatch "${FILESDIR}"/${PN}-5.1.2-snmpconf-selinux.patch
69
70 epatch "${WORKDIR}"/patches/*.patch
71 eautoconf
72 }
73
74 src_configure() {
75 # keep this in the same line, configure.ac arguments are passed down to config.h
76 local mibs="host ucd-snmp/dlmod ucd-snmp/diskio ucd-snmp/extensible mibII/mta_sendmail smux"
77 use lm_sensors && mibs="${mibs} ucd-snmp/lmsensorsMib"
78
79 use python && export PYTHON_DIR="$(python_get_sitedir)"
80
81 econf \
82 --with-install-prefix="${D}" \
83 --with-sys-location="Unknown" \
84 --with-sys-contact="root@Unknown" \
85 --with-default-snmp-version="3" \
86 --with-mib-modules="${mibs}" \
87 --with-logfile="/var/log/net-snmpd.log" \
88 --with-persistent-directory="/var/lib/net-snmp" \
89 $(use_enable ucd-compat ucd-snmp-compatibility) \
90 --enable-shared --disable-static \
91 --with-ldflags="${LDFLAGS}" \
92 $(use_enable ipv6) \
93 $(use_enable mfd-rewrites) \
94 $(use_enable perl embedded-perl) \
95 $(use_enable !ssl internal-md5) \
96 $(use_with elf) \
97 $(use_with perl perl-modules INSTALLDIRS=vendor) \
98 $(use_with python python-modules) \
99 $(use_with ssl openssl) \
100 $(use_with tcpd libwrap) \
101 $(use_with bzip2) \
102 $(use_with zlib) \
103 $(use_with rpm) \
104 --without-nl \
105 --with-pci
106 }
107
108 src_compile() {
109 emake OTHERLDFLAGS="${LDFLAGS}"
110
111 if use doc ; then
112 einfo "Building HTML Documentation"
113 emake docsdox
114 fi
115 }
116
117 src_install () {
118 # bug #317965
119 emake -j1 DESTDIR="${D}" install
120
121 if use perl ; then
122 fixlocalpod
123 use X || rm -f "${D}"/usr/bin/tkmib
124 else
125 rm -f "${D}"/usr/bin/mib2c "${D}"/usr/bin/snmpcheck "${D}"/usr/bin/tkmib
126 fi
127
128 dodoc AGENT.txt ChangeLog FAQ INSTALL NEWS PORTING README* TODO
129 newdoc EXAMPLE.conf.def EXAMPLE.conf
130
131 use doc && dohtml docs/html/*
132
133 keepdir /var/lib/net-snmp
134
135 newinitd "${FILESDIR}"/snmpd.init.2 snmpd
136 newconfd "${FILESDIR}"/snmpd.conf snmpd
137
138 newinitd "${FILESDIR}"/snmptrapd.init.2 snmptrapd
139 newconfd "${FILESDIR}"/snmptrapd.conf snmptrapd
140
141 insinto /etc/snmp
142 newins "${S}"/EXAMPLE.conf snmpd.conf.example
143
144 # Remove everything not required for an agent.
145 # Keep only the snmpd, snmptrapd, MIBs, headers and libraries.
146 if use minimal; then
147 rm -rf \
148 "${D}"/usr/bin/{encode_keychange,snmp{get,getnext,set,usm,walk,bulkwalk,table,trap,bulkget,translate,status,delta,test,df,vacm,netstat,inform,check,conf},fixproc,traptoemail} \
149 "${D}"/usr/share/snmp/snmpconf-data \
150 "${D}"/usr/share/snmp/*.conf \
151 "${D}"/**/*.pl
152 fi
153 }
154
155 pkg_postinst() {
156 if use python; then
157 python_mod_optimize netsnmp
158 fi
159
160 elog "An example configuration file has been installed in"
161 elog "/etc/snmp/snmpd.conf.example."
162 }
163
164 pkg_postrm() {
165 if use python; then
166 python_mod_cleanup netsnmp
167 fi
168 }

  ViewVC Help
Powered by ViewVC 1.1.20