1 # Copyright 1999-2015 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
7 PYTHON_COMPAT=( python2_7 )
8 PYTHON_REQ_USE="ncurses?,xml"
10 inherit eutils distutils-r1 linux-info readme.gentoo systemd
12 DESCRIPTION="A lightweight wired and wireless network manager for Linux"
13 HOMEPAGE="https://launchpad.net/wicd"
14 SRC_URI="http://launchpad.net/wicd/1.7/${PV}/+download/${P}.tar.gz
15 mac4lin? ( https://dev.gentoo.org/~anarchy/dist/wicd-mac4lin-icons.tar.xz )
16 ambiance? ( http://freetimesblog.altervista.org/blog/wp-content/uploads/downloads/2010/05/Icone-Wicd-Lucid.tar.gz )"
20 KEYWORDS="amd64 ~arm ~mips ppc ppc64 x86"
21 IUSE="doc X ambiance +gtk ioctl libnotify mac4lin ncurses nls +pm-utils"
23 DEPEND="nls? ( dev-python/Babel )"
24 RDEPEND="${PYTHON_DEPS}
25 dev-python/dbus-python[${PYTHON_USEDEP}]
27 gtk? ( dev-python/pygtk )
39 net-wireless/wireless-tools
40 net-wireless/wpa_supplicant
45 !gtk? ( dev-python/pygobject:2[${PYTHON_USEDEP}] )
46 ioctl? ( dev-python/python-iwscan dev-python/python-wpactrl )
47 libnotify? ( dev-python/notify-python[${PYTHON_USEDEP}] )
50 dev-python/pygobject:2[${PYTHON_USEDEP}]
52 pm-utils? ( sys-power/pm-utils )
56 CONFIG_CHECK="~CFG80211_WEXT"
57 local WARNING_CFG80211_WEXT="Wireless extensions have not been \
58 configured in your kernel. Wicd will not work unless CFG80211_WEXT is set."
61 # Fix bug 441966 (urwid-1.1.0 compatibility)
62 epatch "${FILESDIR}"/${P}-urwid.patch
63 epatch "${FILESDIR}"/${P}-second-urwid.patch
64 epatch "${FILESDIR}"/${PN}-1.7.1_beta2-init.patch
65 epatch "${FILESDIR}"/${PN}-init-sve-start.patch
66 # Add a template for hex psk's and wpa (Bug 306423)
67 epatch "${FILESDIR}"/${PN}-1.7.1_pre20111210-wpa-psk-hex-template.patch
68 # The Categories entry in the .desktop files is outdated
69 epatch "${FILESDIR}"/${P}-fix-desktop-categories.patch
70 # Fix bug 416579 (should be included in next release)
71 epatch "${FILESDIR}"/${P}-fix-dbus-error.patch
72 # get rid of opts variable to fix bug 381885
73 sed -i "/opts/d" "in/init=gentoo=wicd.in" || die
74 # Make init script provide net per bug 405775
75 epatch "${FILESDIR}"/${PN}-1.7.1-provide-net.patch
76 # Need to ensure that generated scripts use Python 2 at run time.
77 sed -e "s:self.python = '/usr/bin/python':self.python = '/usr/bin/python2':" \
78 -i setup.py || die "sed failed"
79 # Fix misc helper scripts:
80 sed -e "s:/usr/bin/env python:/usr/bin/env python2:" \
81 -i wicd/suspend.py wicd/autoconnect.py wicd/monitor.py
83 # Asturian is faulty with PyBabel
84 # (https://bugs.launchpad.net/wicd/+bug/928589)
86 # zh_CN fails with newer PyBabel (Aug 2013)
93 DOC_CONTENTS="To start wicd at boot with openRC, add
94 /etc/init.d/wicd to a runlevel and: (1) Remove all net.*
95 initscripts (except for net.lo) from all runlevels (2) Add these
96 scripts to the RC_PLUG_SERVICES line in /etc/rc.conf (For
97 example, rc_hotplug=\"!net.eth* !net.wlan*\")"
102 use gtk || myconf="${myconf} --no-install-gtk"
103 use libnotify || myconf="${myconf} --no-use-notifications"
104 use ncurses || myconf="${myconf} --no-install-ncurses"
105 use pm-utils || myconf="${myconf} --no-install-pmutils"
107 "${EPYTHON}" ./setup.py configure --no-install-docs \
108 --resume=/usr/share/wicd/scripts/ \
109 --suspend=/usr/share/wicd/scripts/ \
114 distutils-r1_src_install
115 keepdir /var/lib/wicd/configurations
116 keepdir /etc/wicd/scripts/{postconnect,disconnect,preconnect}
117 keepdir /var/log/wicd
118 use nls || rm -rf "${D}"/usr/share/locale
119 systemd_dounit "${S}/other/wicd.service"
122 rm -rf "${D}"/usr/share/pixmaps/wicd || die "Failed to remove old icons"
123 mv "${WORKDIR}"/wicd "${D}"/usr/share/pixmaps/
125 if use ambiance; then
126 # Overwrite tray icons with ambiance icon
127 rm "${WORKDIR}/Icone Wicd Lucid"/signal*
128 cp "${WORKDIR}/Icone Wicd Lucid"/*.png "${D}"/usr/share/pixmaps/wicd/
130 readme.gentoo_src_install
134 # Maintainer's note: the consolekit use flag short circuits a dbus rule and
135 # allows the connection. Else, you need to be in the group.
136 if ! has_version sys-auth/consolekit; then
137 ewarn "Wicd-1.6 and newer requires your user to be in the 'users' group. If"
138 ewarn "you are not in that group, then modify /etc/dbus-1/system.d/wicd.conf"
141 readme.gentoo_print_elog