1 |
# Copyright 1999-2011 Gentoo Foundation |
2 |
# Distributed under the terms of the GNU General Public License v2 |
3 |
# $Header: /var/cvsroot/gentoo-x86/net-misc/networkmanager/networkmanager-0.8.2-r10.ebuild,v 1.2 2011/06/09 01:41:03 sping Exp $ |
4 |
|
5 |
EAPI="2" |
6 |
|
7 |
inherit autotools eutils gnome.org linux-info |
8 |
|
9 |
# NetworkManager likes itself with capital letters |
10 |
MY_PN=${PN/networkmanager/NetworkManager} |
11 |
MY_P=${MY_PN}-${PV} |
12 |
|
13 |
DESCRIPTION="Network configuration and management in an easy way. Desktop environment independent." |
14 |
HOMEPAGE="http://www.gnome.org/projects/NetworkManager/" |
15 |
SRC_URI="${SRC_URI//${PN}/${MY_PN}}" |
16 |
|
17 |
LICENSE="GPL-2" |
18 |
SLOT="0" |
19 |
KEYWORDS="~amd64 ~arm ~ppc ~ppc64 ~x86" |
20 |
IUSE="avahi bluetooth doc nss gnutls dhclient dhcpcd kernel_linux resolvconf connection-sharing" |
21 |
|
22 |
RDEPEND=">=sys-apps/dbus-1.2 |
23 |
>=dev-libs/dbus-glib-0.75 |
24 |
>=net-wireless/wireless-tools-28_pre9 |
25 |
|| ( >=sys-fs/udev-171[gudev] >=sys-fs/udev-145[extras] ) |
26 |
>=dev-libs/glib-2.18 |
27 |
>=sys-auth/polkit-0.92 |
28 |
>=dev-libs/libnl-1.1 |
29 |
>=net-misc/modemmanager-0.4 |
30 |
>=net-wireless/wpa_supplicant-0.5.10[dbus] |
31 |
bluetooth? ( net-wireless/bluez ) |
32 |
|| ( sys-libs/e2fsprogs-libs <sys-fs/e2fsprogs-1.41.0 ) |
33 |
avahi? ( net-dns/avahi[autoipd] ) |
34 |
gnutls? ( |
35 |
nss? ( >=dev-libs/nss-3.11 ) |
36 |
!nss? ( dev-libs/libgcrypt |
37 |
net-libs/gnutls ) ) |
38 |
!gnutls? ( >=dev-libs/nss-3.11 ) |
39 |
dhclient? ( |
40 |
dhcpcd? ( >=net-misc/dhcpcd-4.0.0_rc3 ) |
41 |
!dhcpcd? ( net-misc/dhcp ) ) |
42 |
!dhclient? ( >=net-misc/dhcpcd-4.0.0_rc3 ) |
43 |
resolvconf? ( net-dns/openresolv ) |
44 |
connection-sharing? ( |
45 |
net-dns/dnsmasq |
46 |
net-firewall/iptables )" |
47 |
|
48 |
DEPEND="${RDEPEND} |
49 |
dev-util/pkgconfig |
50 |
dev-util/intltool |
51 |
>=net-dialup/ppp-2.4.5 |
52 |
doc? ( >=dev-util/gtk-doc-1.8 )" |
53 |
|
54 |
S=${WORKDIR}/${MY_P} |
55 |
|
56 |
sysfs_deprecated_check() { |
57 |
ebegin "Checking for SYSFS_DEPRECATED support" |
58 |
|
59 |
if { linux_chkconfig_present SYSFS_DEPRECATED_V2; }; then |
60 |
eerror "Please disable SYSFS_DEPRECATED_V2 support in your kernel config and recompile your kernel" |
61 |
eerror "or NetworkManager will not work correctly." |
62 |
eerror "See http://bugs.gentoo.org/333639 for more info." |
63 |
die "CONFIG_SYSFS_DEPRECATED_V2 support detected!" |
64 |
fi |
65 |
eend $? |
66 |
} |
67 |
|
68 |
pkg_setup() { |
69 |
# FIXME. Required by -confchanges.patch, but the patch is invalid as |
70 |
# ConsoleKit and PolicyKit is enough to get authorization. |
71 |
enewgroup plugdev |
72 |
|
73 |
if use kernel_linux; then |
74 |
get_version |
75 |
if linux_config_exists; then |
76 |
sysfs_deprecated_check |
77 |
else |
78 |
ewarn "Was unable to determine your kernel .config" |
79 |
ewarn "Please note that if CONFIG_SYSFS_DEPRECATED_V2 is set in your kernel .config, NetworkManager will not work correctly." |
80 |
ewarn "See http://bugs.gentoo.org/333639 for more info." |
81 |
fi |
82 |
|
83 |
fi |
84 |
} |
85 |
|
86 |
src_prepare() { |
87 |
# dbus policy patch |
88 |
epatch "${FILESDIR}/${P}-confchanges.patch" |
89 |
# accept "gw" in /etc/conf.d/net (bug #339215) |
90 |
epatch "${FILESDIR}/${P}-accept-gw.patch" |
91 |
# fix shared connection wrt bug #350476 |
92 |
# fix parsing dhclient.conf wrt bug #352638 |
93 |
epatch "${FILESDIR}/${P}-shared-connection.patch" |
94 |
# Backports #1 |
95 |
epatch "${FILESDIR}/${P}-1.patch" |
96 |
# won't crash upon startup for 32bit machines wrt bug #353807 |
97 |
epatch "${FILESDIR}/${P}-fix-timestamp.patch" |
98 |
# fix tests wrt bug #353549 |
99 |
epatch "${FILESDIR}/${P}-fix-tests.patch" |
100 |
# fix temporary files creation bug #349003 |
101 |
epatch "${FILESDIR}/${P}-fix-tempfiles.patch" |
102 |
# won't write when nothing changed (bug #356339) |
103 |
epatch "${FILESDIR}/${P}-ifnet-smarter-write.patch" |
104 |
# don't pass trash arguments to dnsmasq. Fixes bug #357671 |
105 |
epatch "${FILESDIR}/${P}-fix-dnsmasq-config.patch" |
106 |
# fix some crashes at shutdown |
107 |
epatch "${FILESDIR}/${P}-fix-shutdown.patch" |
108 |
eautoreconf |
109 |
} |
110 |
|
111 |
src_configure() { |
112 |
ECONF="--disable-more-warnings |
113 |
--localstatedir=/var |
114 |
--with-distro=gentoo |
115 |
--with-dbus-sys-dir=/etc/dbus-1/system.d |
116 |
--with-udev-dir=/etc/udev |
117 |
--with-iptables=/sbin/iptables |
118 |
$(use_enable doc gtk-doc) |
119 |
$(use_with doc docs) |
120 |
$(use_with resolvconf)" |
121 |
|
122 |
# default is dhcpcd (if none or both are specified), ISC dchclient otherwise |
123 |
if use dhclient ; then |
124 |
if use dhcpcd ; then |
125 |
ECONF="${ECONF} --with-dhcpcd --without-dhclient" |
126 |
else |
127 |
ECONF="${ECONF} --with-dhclient --without-dhcpcd" |
128 |
fi |
129 |
else |
130 |
ECONF="${ECONF} --with-dhcpcd --without-dhclient" |
131 |
fi |
132 |
|
133 |
# default is NSS (if none or both are specified), GnuTLS otherwise |
134 |
if use gnutls ; then |
135 |
if use nss ; then |
136 |
ECONF="${ECONF} --with-crypto=nss" |
137 |
else |
138 |
ECONF="${ECONF} --with-crypto=gnutls" |
139 |
fi |
140 |
else |
141 |
ECONF="${ECONF} --with-crypto=nss" |
142 |
fi |
143 |
|
144 |
econf ${ECONF} |
145 |
} |
146 |
|
147 |
src_install() { |
148 |
emake DESTDIR="${D}" install || die "emake install failed" |
149 |
|
150 |
# Need to keep the /var/run/NetworkManager directory |
151 |
keepdir /var/run/NetworkManager |
152 |
|
153 |
# Need to keep the /etc/NetworkManager/dispatched.d for dispatcher scripts |
154 |
keepdir /etc/NetworkManager/dispatcher.d |
155 |
|
156 |
dodoc AUTHORS ChangeLog NEWS README TODO || die "dodoc failed" |
157 |
|
158 |
# Add keyfile plugin support |
159 |
keepdir /etc/NetworkManager/system-connections |
160 |
insinto /etc/NetworkManager |
161 |
newins "${FILESDIR}/nm-system-settings.conf-ifnet" nm-system-settings.conf \ |
162 |
|| die "newins failed" |
163 |
} |
164 |
|
165 |
pkg_postinst() { |
166 |
elog "You will need to reload DBus if this is your first time installing" |
167 |
elog "NetworkManager, or if you're upgrading from 0.7 or older." |
168 |
elog "" |
169 |
} |