| 1 |
# Copyright 1999-2012 Gentoo Foundation |
| 2 |
# Distributed under the terms of the GNU General Public License v2 |
| 3 |
# $Header: /var/cvsroot/gentoo-x86/app-admin/packagekit-base/packagekit-base-0.7.4.ebuild,v 1.7 2012/10/16 00:48:17 jer Exp $ |
| 4 |
|
| 5 |
EAPI="3" |
| 6 |
|
| 7 |
# 0.7.x is untested with Python 3.x |
| 8 |
PYTHON_DEPEND="2" |
| 9 |
|
| 10 |
inherit eutils multilib python nsplugins bash-completion-r1 |
| 11 |
|
| 12 |
MY_PN="PackageKit" |
| 13 |
MY_P=${MY_PN}-${PV} |
| 14 |
|
| 15 |
DESCRIPTION="Manage packages in a secure way using a cross-distro and cross-architecture API" |
| 16 |
HOMEPAGE="http://www.packagekit.org/" |
| 17 |
SRC_URI="http://www.packagekit.org/releases/${MY_P}.tar.xz" |
| 18 |
|
| 19 |
LICENSE="GPL-2" |
| 20 |
SLOT="0" |
| 21 |
KEYWORDS="~alpha ~amd64 ~arm ~mips ~ppc ~ppc64 ~x86" |
| 22 |
IUSE="connman cron doc +introspection networkmanager nsplugin pm-utils +policykit entropy static-libs test udev" |
| 23 |
|
| 24 |
CDEPEND="connman? ( net-misc/connman ) |
| 25 |
introspection? ( >=dev-libs/gobject-introspection-0.9.9 ) |
| 26 |
networkmanager? ( >=net-misc/networkmanager-0.6.4 ) |
| 27 |
nsplugin? ( |
| 28 |
>=dev-libs/nspr-4.8 |
| 29 |
x11-libs/cairo |
| 30 |
>=x11-libs/gtk+-2.14.0:2 |
| 31 |
x11-libs/pango |
| 32 |
) |
| 33 |
policykit? ( >=sys-auth/polkit-0.98 ) |
| 34 |
udev? ( virtual/udev[gudev] ) |
| 35 |
dev-db/sqlite:3 |
| 36 |
>=dev-libs/dbus-glib-0.74 |
| 37 |
>=dev-libs/glib-2.26.1:2 |
| 38 |
>=sys-apps/dbus-1.3.0" |
| 39 |
DEPEND="${CDEPEND} |
| 40 |
doc? ( dev-util/gtk-doc ) |
| 41 |
nsplugin? ( <net-misc/npapi-sdk-0.27.1 ) |
| 42 |
dev-libs/libxslt |
| 43 |
>=dev-util/intltool-0.35.0 |
| 44 |
virtual/pkgconfig |
| 45 |
sys-devel/gettext" |
| 46 |
|
| 47 |
RDEPEND="${CDEPEND} |
| 48 |
entropy? ( >=sys-apps/entropy-1.0_rc27 ) |
| 49 |
pm-utils? ( sys-power/pm-utils ) |
| 50 |
>=app-portage/layman-1.2.3 |
| 51 |
>=sys-apps/portage-2.1.9 |
| 52 |
sys-auth/consolekit" |
| 53 |
|
| 54 |
APP_LINGUAS="as bg bn ca cs da de el en_GB es fi fr gu he hi hu it ja kn ko ml mr |
| 55 |
ms nb nl or pa pl pt pt_BR ro ru sk sr sr@latin sv ta te th tr uk zh_CN zh_TW" |
| 56 |
for X in ${APP_LINGUAS}; do |
| 57 |
IUSE=" ${IUSE} linguas_${X}" |
| 58 |
done |
| 59 |
|
| 60 |
S="${WORKDIR}/${MY_P}" |
| 61 |
RESTRICT="test" # tests are failing atm |
| 62 |
|
| 63 |
# NOTES: |
| 64 |
# do not use a specific user, useless and not more secure according to upstream |
| 65 |
# doc is in the tarball and always installed |
| 66 |
# mono doesn't install anything (RDEPEND dev-dotnet/gtk-sharp-gapi:2 |
| 67 |
# (R)DEPEND dev-dotnet/glib-sharp:2 dev-lang/mono), upstream bug 23247 |
| 68 |
# >=npapi-sdk-0.27.1 has slightly changed API, once it is unmasked in tree |
| 69 |
# drop the npapi-api-change patch below and relax the dependency constraints |
| 70 |
|
| 71 |
# UPSTREAM: |
| 72 |
# documentation/website with --enable-doc-install |
| 73 |
# failing tests |
| 74 |
|
| 75 |
src_prepare() { |
| 76 |
epatch "${FILESDIR}"/${PN}-0.7.x-npapi-sdk.patch #383141 |
| 77 |
epatch "${FILESDIR}"/${PN}-0.7.x-npapi-api-change.patch #416711 |
| 78 |
# http://pkgs.fedoraproject.org/gitweb/?p=PackageKit.git;a=commit;h=0b378668288db34890b82c7be007fc76c7fcd956 |
| 79 |
sed -i -e '/polkit-backend-1/d' configure || die #423431 |
| 80 |
} |
| 81 |
|
| 82 |
src_configure() { |
| 83 |
local myconf="" |
| 84 |
|
| 85 |
if use policykit; then |
| 86 |
myconf+=" --with-security-framework=polkit" |
| 87 |
else |
| 88 |
myconf+=" --with-security-framework=dummy" |
| 89 |
fi |
| 90 |
|
| 91 |
if [[ -z "${LINGUAS}" ]]; then |
| 92 |
myconf+=" --disable-nls" |
| 93 |
else |
| 94 |
myconf+=" --enable-nls" |
| 95 |
fi |
| 96 |
|
| 97 |
# localstatedir: for gentoo it's /var/lib but for $PN it's /var |
| 98 |
# dep-tracking,option-check,libtool-lock,strict,local: obvious reasons |
| 99 |
# command,debuginfo,gstreamer,service-packs: not supported by backend |
| 100 |
|
| 101 |
# NOTE: default backend is autodetected at runtime, also |
| 102 |
if use entropy; then |
| 103 |
myconf+=" --with-default-backend=entropy" |
| 104 |
else |
| 105 |
myconf+=" --with-default-backend=portage" |
| 106 |
fi |
| 107 |
econf \ |
| 108 |
${myconf} \ |
| 109 |
--enable-introspection=$(use introspection && echo -n "yes" || echo -n "no") \ |
| 110 |
--localstatedir=/var \ |
| 111 |
--disable-dependency-tracking \ |
| 112 |
--enable-option-checking \ |
| 113 |
--enable-libtool-lock \ |
| 114 |
--disable-strict \ |
| 115 |
--disable-local \ |
| 116 |
$(use_enable doc gtk-doc) \ |
| 117 |
--enable-command-not-found \ |
| 118 |
--disable-debuginfo-install \ |
| 119 |
--disable-gstreamer-plugin \ |
| 120 |
--disable-service-packs \ |
| 121 |
--enable-man-pages \ |
| 122 |
--enable-portage \ |
| 123 |
$(use_enable entropy) \ |
| 124 |
$(use_enable cron) \ |
| 125 |
--disable-gtk-module \ |
| 126 |
$(use_enable introspection) \ |
| 127 |
$(use_enable networkmanager) \ |
| 128 |
$(use_enable nsplugin browser-plugin) \ |
| 129 |
$(use_enable connman) \ |
| 130 |
$(use_enable pm-utils) \ |
| 131 |
--disable-qt \ |
| 132 |
$(use_enable static-libs static) \ |
| 133 |
$(use_enable test tests) \ |
| 134 |
$(use_enable udev device-rebind) |
| 135 |
} |
| 136 |
|
| 137 |
src_install() { |
| 138 |
emake DESTDIR="${D}" install || die "emake install failed" |
| 139 |
|
| 140 |
dodoc AUTHORS MAINTAINERS NEWS README TODO || die "dodoc failed" |
| 141 |
dodoc ChangeLog || die "dodoc failed" |
| 142 |
|
| 143 |
if use nsplugin; then |
| 144 |
dodir "/usr/$(get_libdir)/${PLUGINS_DIR}" |
| 145 |
mv "${D}"/usr/$(get_libdir)/mozilla/plugins/* \ |
| 146 |
"${D}/usr/$(get_libdir)/${PLUGINS_DIR}/" |
| 147 |
fi |
| 148 |
|
| 149 |
if ! use static-libs; then |
| 150 |
find "${D}" -name *.la | xargs rm || die "removing .la files failed" |
| 151 |
fi |
| 152 |
|
| 153 |
# Remove precompiled python modules, we handle byte compiling |
| 154 |
rm -f "${D}/$(python_get_sitedir)"/${PN}*.py[co] |
| 155 |
|
| 156 |
newbashcomp "${S}/contrib/pk-completion.bash" ${PN} |
| 157 |
# Remove bashcomp file installed by build-system |
| 158 |
rm -f "${D}/bash_completion.d/pk-completion.bash" |
| 159 |
|
| 160 |
# Remove unwanted PackageKit website stuff |
| 161 |
rm -rf "${D}/usr/share/PackageKit/website" |
| 162 |
|
| 163 |
} |
| 164 |
|
| 165 |
pkg_postinst() { |
| 166 |
python_mod_optimize ${PN/-base} |
| 167 |
|
| 168 |
if ! use policykit; then |
| 169 |
ewarn "You are not using policykit, the daemon can't be considered as secure." |
| 170 |
ewarn "All users will be able to do anything through ${MY_PN}." |
| 171 |
ewarn "Please, consider rebuilding ${MY_PN} with policykit USE flag." |
| 172 |
ewarn "THIS IS A SECURITY ISSUE." |
| 173 |
echo |
| 174 |
fi |
| 175 |
} |
| 176 |
|
| 177 |
pkg_prerm() { |
| 178 |
einfo "Removing downloaded files with ${MY_PN}..." |
| 179 |
[[ -d "${ROOT}"/var/cache/${MY_PN}/downloads/ ]] && \ |
| 180 |
rm -rf /var/cache/PackageKit/downloads/* |
| 181 |
} |
| 182 |
|
| 183 |
pkg_postrm() { |
| 184 |
python_mod_cleanup ${PN/-base} |
| 185 |
} |