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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Sat Mar 7 14:11:54 2009 UTC (10 years, 6 months ago) by mrness
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
Remove obsolete test version.
(Portage version: 2.1.6.7/cvs/Linux x86_64)

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

  ViewVC Help
Powered by ViewVC 1.1.20