Line 0
Link Here
|
0 |
- |
1 |
# Copyright 1999-2010 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-r1.ebuild,v 1.1 2010/11/30 09:35:18 qiaomuf Exp $ |
4 |
|
5 |
EAPI="2" |
6 |
|
7 |
inherit 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 systemd" |
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-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 |
|
70 |
if use kernel_linux; then |
71 |
get_version |
72 |
if linux_config_exists; then |
73 |
sysfs_deprecated_check |
74 |
else |
75 |
ewarn "Was unable to determine your kernel .config" |
76 |
ewarn "Please note that if CONFIG_SYSFS_DEPRECATED_V2 is set in your kernel .config, NetworkManager will not work correctly." |
77 |
ewarn "See http://bugs.gentoo.org/333639 for more info." |
78 |
fi |
79 |
|
80 |
fi |
81 |
} |
82 |
|
83 |
src_prepare() { |
84 |
# accept "gw" in /etc/conf.d/net (bug #339215) |
85 |
epatch "${FILESDIR}/${P}-accept-gw.patch" |
86 |
|
87 |
if use systemd; then |
88 |
epatch "${FILESDIR}/networkmanager-0.8.2-gentoo-no-openrc.patch" |
89 |
fi |
90 |
} |
91 |
|
92 |
src_configure() { |
93 |
ECONF="--disable-more-warnings |
94 |
--localstatedir=/var |
95 |
--with-distro=gentoo |
96 |
--with-dbus-sys-dir=/etc/dbus-1/system.d |
97 |
--with-udev-dir=/etc/udev |
98 |
--with-iptables=/sbin/iptables |
99 |
$(use_enable doc gtk-doc) |
100 |
$(use_with doc docs) |
101 |
$(use_with resolvconf)" |
102 |
|
103 |
# default is dhcpcd (if none or both are specified), ISC dchclient otherwise |
104 |
if use dhclient ; then |
105 |
if use dhcpcd ; then |
106 |
ECONF="${ECONF} --with-dhcpcd --without-dhclient" |
107 |
else |
108 |
ECONF="${ECONF} --with-dhclient --without-dhcpcd" |
109 |
fi |
110 |
else |
111 |
ECONF="${ECONF} --with-dhcpcd --without-dhclient" |
112 |
fi |
113 |
|
114 |
# default is NSS (if none or both are specified), GnuTLS otherwise |
115 |
if use gnutls ; then |
116 |
if use nss ; then |
117 |
ECONF="${ECONF} --with-crypto=nss" |
118 |
else |
119 |
ECONF="${ECONF} --with-crypto=gnutls" |
120 |
fi |
121 |
else |
122 |
ECONF="${ECONF} --with-crypto=nss" |
123 |
fi |
124 |
|
125 |
econf ${ECONF} |
126 |
} |
127 |
|
128 |
src_install() { |
129 |
emake DESTDIR="${D}" install || die "emake install failed" |
130 |
|
131 |
# Need to keep the /var/run/NetworkManager directory |
132 |
keepdir /var/run/NetworkManager |
133 |
|
134 |
# Need to keep the /etc/NetworkManager/dispatched.d for dispatcher scripts |
135 |
keepdir /etc/NetworkManager/dispatcher.d |
136 |
|
137 |
dodoc AUTHORS ChangeLog NEWS README TODO || die "dodoc failed" |
138 |
|
139 |
# Add keyfile plugin support |
140 |
keepdir /etc/NetworkManager/system-connections |
141 |
insinto /etc/NetworkManager |
142 |
newins "${FILESDIR}/nm-system-settings.conf-ifnet" nm-system-settings.conf \ |
143 |
|| die "newins failed" |
144 |
} |
145 |
|
146 |
pkg_postinst() { |
147 |
elog "You will need to reload DBus if this is your first time installing" |
148 |
elog "NetworkManager, or if you're upgrading from 0.7 or older." |
149 |
elog "" |
150 |
} |