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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Sat Oct 20 05:00:03 2012 UTC (20 months, 2 weeks ago) by flameeyes
Branch: MAIN
Version bump to final 5.7.2 release.

(Portage version: 2.2.0_alpha137/cvs/Linux x86_64)

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_rc3.ebuild,v 1.1 2012/10/04 15:30:14 flameeyes Exp $
4
5 EAPI=4
6 PYTHON_DEPEND="python? 2"
7
8 WANT_AUTOMAKE=none
9
10 PATCHSET=1
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="HPND 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 pci netlink mysql"
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 pci? ( sys-apps/pciutils )
38 lm_sensors? ( sys-apps/lm_sensors )
39 netlink? ( dev-libs/libnl:1.1 )
40 mysql? ( virtual/mysql )"
41
42 RDEPEND="${COMMON}
43 perl? (
44 X? ( dev-perl/perl-tk )
45 !minimal? ( dev-perl/TermReadKey )
46 )
47 selinux? ( sec-policy/selinux-snmp )
48 sys-apps/openrc"
49
50 # Dependency on autoconf due to bug #225893
51 DEPEND="${COMMON}
52 >=sys-apps/sed-4
53 doc? ( app-doc/doxygen )"
54
55 REQUIRED_USE="rpm? ( bzip2 zlib )"
56
57 RESTRICT=test
58
59 S="${WORKDIR}/${MY_P}"
60
61 pkg_setup() {
62 if use python; then
63 python_set_active_version 2
64 python_pkg_setup
65 fi
66 }
67
68 src_prepare() {
69 # snmpconf generates config files with proper selinux context
70 use selinux && epatch "${FILESDIR}"/${PN}-5.1.2-snmpconf-selinux.patch
71
72 epatch "${WORKDIR}"/patches/*.patch
73 eautoconf
74 }
75
76 src_configure() {
77 # keep this in the same line, configure.ac arguments are passed down to config.h
78 local mibs="host ucd-snmp/dlmod ucd-snmp/diskio ucd-snmp/extensible mibII/mta_sendmail smux"
79 use lm_sensors && mibs="${mibs} ucd-snmp/lmsensorsMib"
80
81 use python && export PYTHON_DIR="$(python_get_sitedir)"
82
83 econf \
84 --with-install-prefix="${D}" \
85 --with-sys-location="Unknown" \
86 --with-sys-contact="root@Unknown" \
87 --with-default-snmp-version="3" \
88 --with-mib-modules="${mibs}" \
89 --with-logfile="/var/log/net-snmpd.log" \
90 --with-persistent-directory="/var/lib/net-snmp" \
91 $(use_enable ucd-compat ucd-snmp-compatibility) \
92 --enable-shared --disable-static \
93 --with-ldflags="${LDFLAGS}" \
94 $(use_enable ipv6) \
95 $(use_enable mfd-rewrites) \
96 $(use_enable perl embedded-perl) \
97 $(use_enable !ssl internal-md5) \
98 $(use_with elf) \
99 $(use_with perl perl-modules INSTALLDIRS=vendor) \
100 $(use_with python python-modules) \
101 $(use_with ssl openssl) \
102 $(use_with tcpd libwrap) \
103 $(use_with bzip2) \
104 $(use_with zlib) \
105 $(use_with rpm) \
106 $(use_with netlink nl) \
107 $(use_with pci) \
108 $(use_with mysql)
109 }
110
111 src_compile() {
112 emake OTHERLDFLAGS="${LDFLAGS}"
113
114 if use doc ; then
115 einfo "Building HTML Documentation"
116 emake docsdox
117 fi
118 }
119
120 src_install () {
121 # bug #317965
122 emake -j1 DESTDIR="${D}" install
123
124 if use perl ; then
125 fixlocalpod
126 use X || rm -f "${D}"/usr/bin/tkmib
127 else
128 rm -f "${D}"/usr/bin/mib2c "${D}"/usr/bin/snmpcheck "${D}"/usr/bin/tkmib
129 fi
130
131 dodoc AGENT.txt ChangeLog FAQ INSTALL NEWS PORTING README* TODO
132 newdoc EXAMPLE.conf.def EXAMPLE.conf
133
134 use doc && dohtml docs/html/*
135
136 keepdir /var/lib/net-snmp
137
138 newinitd "${FILESDIR}"/snmpd.init.2 snmpd
139 newconfd "${FILESDIR}"/snmpd.conf snmpd
140
141 newinitd "${FILESDIR}"/snmptrapd.init.2 snmptrapd
142 newconfd "${FILESDIR}"/snmptrapd.conf snmptrapd
143
144 insinto /etc/snmp
145 newins "${S}"/EXAMPLE.conf snmpd.conf.example
146
147 # Remove everything not required for an agent.
148 # Keep only the snmpd, snmptrapd, MIBs, headers and libraries.
149 if use minimal; then
150 rm -rf \
151 "${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} \
152 "${D}"/usr/share/snmp/snmpconf-data \
153 "${D}"/usr/share/snmp/*.conf \
154 "${D}"/**/*.pl
155 fi
156 }
157
158 pkg_postinst() {
159 if use python; then
160 python_mod_optimize netsnmp
161 fi
162
163 elog "An example configuration file has been installed in"
164 elog "/etc/snmp/snmpd.conf.example."
165 }
166
167 pkg_postrm() {
168 if use python; then
169 python_mod_cleanup netsnmp
170 fi
171 }

  ViewVC Help
Powered by ViewVC 1.1.20