| 1 |
tomka |
1.1 |
# Copyright 1999-2012 Gentoo Foundation
|
| 2 |
|
|
# Distributed under the terms of the GNU General Public License v2
|
| 3 |
blueness |
1.4 |
# $Header: /var/cvsroot/gentoo-x86/net-misc/wicd/wicd-1.7.2.4-r1.ebuild,v 1.3 2012/07/17 11:58:23 tomka Exp $
|
| 4 |
tomka |
1.1 |
|
| 5 |
|
|
EAPI=3
|
| 6 |
|
|
|
| 7 |
|
|
PYTHON_DEPEND="2"
|
| 8 |
|
|
PYTHON_USE_WITH="ncurses? xml"
|
| 9 |
|
|
SUPPORT_PYTHON_ABIS="1"
|
| 10 |
|
|
RESTRICT_PYTHON_ABIS="3.* *-jython"
|
| 11 |
|
|
DISTUTILS_USE_SEPARATE_SOURCE_DIRECTORIES="1"
|
| 12 |
|
|
|
| 13 |
|
|
inherit eutils distutils systemd
|
| 14 |
|
|
|
| 15 |
|
|
DESCRIPTION="A lightweight wired and wireless network manager for Linux"
|
| 16 |
tomka |
1.3 |
HOMEPAGE="https://launchpad.net/wicd"
|
| 17 |
tomka |
1.1 |
SRC_URI="http://launchpad.net/wicd/1.7/${PV}/+download/${P}.tar.gz
|
| 18 |
|
|
mac4lin? ( http://dev.gentoo.org/~anarchy/dist/wicd-mac4lin-icons.tar.xz )
|
| 19 |
|
|
ambiance? ( http://freetimesblog.altervista.org/blog/wp-content/uploads/downloads/2010/05/Icone-Wicd-Lucid.tar.gz )"
|
| 20 |
|
|
|
| 21 |
|
|
LICENSE="GPL-2"
|
| 22 |
|
|
SLOT="0"
|
| 23 |
blueness |
1.4 |
KEYWORDS="~amd64 ~arm ~mips ~x86"
|
| 24 |
tomka |
1.1 |
IUSE="X ambiance +gtk ioctl libnotify mac4lin ncurses nls +pm-utils"
|
| 25 |
|
|
|
| 26 |
|
|
DEPEND="nls? ( dev-python/Babel )"
|
| 27 |
|
|
# Maybe virtual/dhcp would work, but there are enough problems with
|
| 28 |
|
|
# net-misc/dhcp that I want net-misc/dhcpcd to be guarenteed to be considered
|
| 29 |
|
|
# first if none are installed.
|
| 30 |
|
|
RDEPEND="
|
| 31 |
|
|
dev-python/dbus-python
|
| 32 |
|
|
X? ( gtk? ( dev-python/pygtk
|
| 33 |
|
|
|| (
|
| 34 |
|
|
x11-misc/ktsuss
|
| 35 |
|
|
x11-libs/gksu
|
| 36 |
|
|
kde-base/kdesu
|
| 37 |
|
|
)
|
| 38 |
|
|
)
|
| 39 |
|
|
)
|
| 40 |
|
|
|| (
|
| 41 |
|
|
net-misc/dhcpcd
|
| 42 |
|
|
net-misc/dhcp
|
| 43 |
|
|
net-misc/pump
|
| 44 |
|
|
)
|
| 45 |
|
|
net-wireless/wireless-tools
|
| 46 |
|
|
net-wireless/wpa_supplicant
|
| 47 |
|
|
|| (
|
| 48 |
|
|
sys-apps/net-tools
|
| 49 |
|
|
sys-apps/ethtool
|
| 50 |
|
|
)
|
| 51 |
|
|
!gtk? ( dev-python/pygobject:2 )
|
| 52 |
|
|
ioctl? ( dev-python/python-iwscan dev-python/python-wpactrl )
|
| 53 |
|
|
libnotify? ( dev-python/notify-python )
|
| 54 |
|
|
ncurses? (
|
| 55 |
|
|
dev-python/urwid
|
| 56 |
|
|
dev-python/pygobject:2
|
| 57 |
|
|
)
|
| 58 |
|
|
pm-utils? ( >=sys-power/pm-utils-1.1.1 )
|
| 59 |
|
|
"
|
| 60 |
|
|
DOCS="CHANGES NEWS AUTHORS README"
|
| 61 |
|
|
|
| 62 |
|
|
src_prepare() {
|
| 63 |
|
|
epatch "${FILESDIR}"/${PN}-1.7.1_beta2-init.patch
|
| 64 |
|
|
epatch "${FILESDIR}"/${PN}-init-sve-start.patch
|
| 65 |
|
|
# Add a template for hex psk's and wpa (Bug 306423)
|
| 66 |
|
|
epatch "${FILESDIR}"/${PN}-1.7.1_pre20111210-wpa-psk-hex-template.patch
|
| 67 |
|
|
# Fix bug 416579 (should be included in next release)
|
| 68 |
|
|
epatch "${FILESDIR}"/${P}-fix-dbus-error.patch
|
| 69 |
|
|
# get rid of opts variable to fix bug 381885
|
| 70 |
|
|
sed -i "/opts/d" "in/init=gentoo=wicd.in" || die
|
| 71 |
|
|
# Make init script provide net per bug 405775
|
| 72 |
|
|
epatch "${FILESDIR}"/${PN}-1.7.1-provide-net.patch
|
| 73 |
|
|
# Need to ensure that generated scripts use Python 2 at run time.
|
| 74 |
|
|
sed -e "s:self.python = '/usr/bin/python':self.python = '/usr/bin/python2':" \
|
| 75 |
|
|
-i setup.py || die "sed failed"
|
| 76 |
|
|
if use nls; then
|
| 77 |
|
|
# Asturian is faulty with PyBabel
|
| 78 |
|
|
# (https://bugs.launchpad.net/wicd/+bug/928589)
|
| 79 |
|
|
rm po/ast.po
|
| 80 |
|
|
else
|
| 81 |
|
|
# nuke translations
|
| 82 |
|
|
rm po/*.po
|
| 83 |
|
|
fi
|
| 84 |
|
|
python_copy_sources
|
| 85 |
|
|
}
|
| 86 |
|
|
|
| 87 |
|
|
src_configure() {
|
| 88 |
|
|
local myconf
|
| 89 |
|
|
use gtk || myconf="${myconf} --no-install-gtk"
|
| 90 |
|
|
use libnotify || myconf="${myconf} --no-use-notifications"
|
| 91 |
|
|
use ncurses || myconf="${myconf} --no-install-ncurses"
|
| 92 |
|
|
use pm-utils || myconf="${myconf} --no-install-pmutils"
|
| 93 |
|
|
configuration() {
|
| 94 |
|
|
$(PYTHON) ./setup.py configure --no-install-docs --resume=/usr/share/wicd/scripts/ --suspend=/usr/share/wicd/scripts/ --verbose ${myconf}
|
| 95 |
|
|
}
|
| 96 |
|
|
python_execute_function -s configuration
|
| 97 |
|
|
}
|
| 98 |
|
|
|
| 99 |
|
|
src_install() {
|
| 100 |
|
|
distutils_src_install
|
| 101 |
|
|
keepdir /var/lib/wicd/configurations \
|
| 102 |
|
|
|| die "keepdir failed, critical for this app"
|
| 103 |
|
|
keepdir /etc/wicd/scripts/{postconnect,disconnect,preconnect} \
|
| 104 |
|
|
|| die "keepdir failed, critical for this app"
|
| 105 |
|
|
keepdir /var/log/wicd \
|
| 106 |
|
|
|| die "keepdir failed, critical for this app"
|
| 107 |
|
|
use nls || rm -rf "${D}"/usr/share/locale
|
| 108 |
|
|
systemd_dounit "${S}/other/wicd.service"
|
| 109 |
|
|
|
| 110 |
|
|
if use mac4lin; then
|
| 111 |
|
|
rm -rf "${D}"/usr/share/pixmaps/wicd || die "Failed to remove old icons"
|
| 112 |
|
|
mv "${WORKDIR}"/wicd "${D}"/usr/share/pixmaps/
|
| 113 |
|
|
fi
|
| 114 |
|
|
if use ambiance; then
|
| 115 |
|
|
# Overwrite tray icons with ambiance icon
|
| 116 |
|
|
rm "${WORKDIR}/Icone Wicd Lucid"/signal*
|
| 117 |
|
|
cp "${WORKDIR}/Icone Wicd Lucid"/*.png "${D}"/usr/share/pixmaps/wicd/
|
| 118 |
|
|
fi
|
| 119 |
|
|
}
|
| 120 |
|
|
|
| 121 |
|
|
pkg_postinst() {
|
| 122 |
|
|
distutils_pkg_postinst
|
| 123 |
|
|
|
| 124 |
|
|
elog "You may need to restart the dbus service after upgrading wicd."
|
| 125 |
|
|
echo
|
| 126 |
|
|
elog "To start wicd at boot, add /etc/init.d/wicd to a runlevel and:"
|
| 127 |
|
|
elog "- Remove all net.* initscripts (except for net.lo) from all runlevels"
|
| 128 |
|
|
elog "- Add these scripts to the RC_PLUG_SERVICES line in /etc/rc.conf"
|
| 129 |
|
|
elog "(For example, rc_hotplug=\"!net.eth* !net.wlan*\")"
|
| 130 |
|
|
# Maintainer's note: the consolekit use flag short circuits a dbus rule and
|
| 131 |
|
|
# allows the connection. Else, you need to be in the group.
|
| 132 |
|
|
if ! has_version sys-auth/pambase[consolekit]; then
|
| 133 |
|
|
ewarn "Wicd-1.6 and newer requires your user to be in the 'users' group. If"
|
| 134 |
|
|
ewarn "you are not in that group, then modify /etc/dbus-1/system.d/wicd.conf"
|
| 135 |
|
|
fi
|
| 136 |
|
|
}
|