/[gentoo-x86]/net-misc/quagga/quagga-0.99.7-r1.ebuild
Gentoo

Contents of /net-misc/quagga/quagga-0.99.7-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Wed Feb 20 05:19:32 2008 UTC (11 years, 7 months ago) by mrness
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Correct broken pam file (#210785).
(Portage version: 2.1.3.19, RepoMan options: --force)

1 # Copyright 1999-2007 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/net-misc/quagga/quagga-0.99.7-r1.ebuild,v 1.1 2007/09/12 07:25:05 mrness Exp $
4
5 WANT_AUTOMAKE="latest"
6 WANT_AUTOCONF="latest"
7
8 inherit eutils multilib autotools linux-info
9
10 DESCRIPTION="A free routing daemon replacing Zebra supporting RIP, OSPF and BGP. Includes OSPFAPI, NET-SNMP and IPV6 support."
11 HOMEPAGE="http://quagga.net/"
12 SRC_URI="http://www.quagga.net/download/${P}.tar.gz
13 mirror://gentoo/${P}-patches-20070912.tar.gz"
14
15 LICENSE="GPL-2"
16 SLOT="0"
17 KEYWORDS="~alpha ~amd64 ~arm ~hppa ~ppc ~s390 ~sparc ~x86"
18 IUSE="ipv6 snmp pam tcpmd5 bgpas4 bgpclassless ospfapi realms multipath tcp-zebra"
19 RESTRICT="userpriv"
20
21 DEPEND=">=sys-libs/libcap-1.10-r5
22 snmp? ( net-analyzer/net-snmp )
23 pam? ( sys-libs/pam )"
24 RDEPEND="${DEPEND}
25 sys-apps/iproute2"
26
27 pkg_setup() {
28 if use tcpmd5 ; then
29 get_version || get_running_version
30 fi
31 return 0
32 }
33
34 src_unpack() {
35 unpack ${A} || die "failed to unpack sources"
36 cd "${S}" || die "source dir not found"
37 epatch "${WORKDIR}/patch/${P}-link-libcap.patch"
38
39 # AS4 support (original found at http://quagga.ncc.eurodata.de)
40 use bgpas4 && epatch "${WORKDIR}/patch/quagga-cvs20070307-as4-v05_adapted.patch"
41
42 if use tcpmd5 ; then
43 if kernel_is lt 2 6 20 ; then
44 # TCP MD5 for BGP patch for Linux (RFC 2385)
45 # original found at http://hasso.linux.ee/doku.php/english:network:rfc2385
46 epatch "${WORKDIR}/patch/ht-20050321-${PV}-bgp-md5_adapted.patch"
47 else
48 # TCP MD5 in-kernel support for kernels >=2.6.20 (by Leigh Brown)
49 # original found at http://www.solinno.co.uk/md5sig/quagga_linux-2.6.20_md5sig.diff
50 epatch "${WORKDIR}/patch/quagga_linux-2.6.20_md5sig_adapted.diff"
51 fi
52 fi
53
54 # Classless prefixes for BGP - http://hasso.linux.ee/doku.php/english:network:quagga
55 use bgpclassless && epatch "${WORKDIR}/patch/ht-20040304-classless-bgp_adapted.patch"
56
57 # Realms support (Calin Velea) - http://vcalinus.gemenii.ro/quaggarealms.html
58 use realms && epatch "${WORKDIR}/patch/${P}-realms.diff"
59
60 # Security patches
61 epatch "${WORKDIR}/patch/${P}-backports.patch"
62
63 eautoreconf
64 }
65
66 src_compile() {
67 local myconf="--disable-static --enable-dynamic"
68
69 use ipv6 \
70 && myconf="${myconf} --enable-ipv6 --enable-ripng --enable-ospf6d --enable-rtadv" \
71 || myconf="${myconf} --disable-ipv6 --disable-ripngd --disable-ospf6d"
72 use ospfapi \
73 && myconf="${myconf} --enable-opaque-lsa --enable-ospf-te --enable-ospfclient"
74 use snmp && myconf="${myconf} --enable-snmp"
75 use pam && myconf="${myconf} --with-libpam"
76 use tcpmd5 && myconf="${myconf} --enable-tcp-md5"
77 use realms && myconf="${myconf} --enable-realms"
78 use multipath && myconf="${myconf} --enable-multipath=0"
79 use tcp-zebra && myconf="${myconf} --enable-tcp-zebra"
80
81 econf \
82 --enable-nssa \
83 --enable-user=quagga \
84 --enable-group=quagga \
85 --enable-vty-group=quagga \
86 --with-cflags="${CFLAGS}" \
87 --enable-vtysh \
88 --sysconfdir=/etc/quagga \
89 --enable-exampledir=/etc/quagga/samples \
90 --localstatedir=/var/run/quagga \
91 --libdir=/usr/$(get_libdir)/quagga \
92 ${myconf} \
93 || die "configure failed"
94 emake || die "make failed"
95 }
96
97 src_install() {
98 einstall \
99 localstatedir="${D}/var/run/quagga" \
100 sysconfdir="${D}/etc/quagga" \
101 exampledir="${D}/etc/quagga/samples" \
102 libdir="${D}/usr/$(get_libdir)/quagga" || die "make install failed"
103
104 keepdir /var/run/quagga
105
106 local i MY_SERVICES_LIST="zebra ripd ospfd bgpd"
107 use ipv6 && MY_SERVICES_LIST="${MY_SERVICES_LIST} ripngd ospf6d"
108 for i in ${MY_SERVICES_LIST} ; do
109 newinitd "${FILESDIR}/${i}.init" ${i} || die "failed to install ${i} init.d script"
110 done
111 newconfd "${FILESDIR}/zebra.conf" zebra || die "failed to install zebra conf.d script"
112
113 if use pam; then
114 insinto /etc/pam.d
115 newins "${FILESDIR}/quagga.pam" quagga
116 fi
117
118 newenvd "${FILESDIR}/quagga.env" 99quagga
119 }
120
121 pkg_preinst() {
122 enewgroup quagga
123 enewuser quagga -1 -1 /var/empty quagga
124 }
125
126 pkg_postinst() {
127 # empty dir for pid files for the new priv separation auth
128 #set proper owner/group/perms even if dir already existed
129 install -d -m0770 -o root -g quagga "${ROOT}/etc/quagga"
130 install -d -m0755 -o quagga -g quagga "${ROOT}/var/run/quagga"
131
132 einfo "Sample configuration files can be found in /etc/quagga/samples."
133 einfo "You have to create config files in /etc/quagga before"
134 einfo "starting one of the daemons."
135
136 if use tcpmd5; then
137 echo
138 if kernel_is lt 2 6 20; then
139 ewarn "TCP MD5 for BGP needs a patched kernel!"
140 ewarn "See http://hasso.linux.ee/doku.php/english:network:rfc2385 for more info."
141 else
142 CONFIG_CHECK="~TCP_MD5SIG"
143 local ERROR_TCP_MD5SIG="CONFIG_TCP_MD5SIG:\t missing TCP MD5 signature support (RFC2385)"
144
145 check_extra_config
146 fi
147 fi
148 }

  ViewVC Help
Powered by ViewVC 1.1.20