/[gentoo-x86]/sys-apps/entropy/entropy-254.ebuild
Gentoo

Contents of /sys-apps/entropy/entropy-254.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Wed Dec 18 05:03:03 2013 UTC (4 years, 9 months ago) by lxnay
Branch: MAIN
CVS Tags: HEAD
version bump

(Portage version: 2.2.7/cvs/Linux x86_64, signed Manifest commit with key ADC916E5)

1 # Copyright 1999-2013 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: $
4
5 EAPI=5
6
7 PYTHON_COMPAT=( python2_7 )
8 PYTHON_REQ_USE="sqlite"
9
10 inherit eutils python-single-r1 user
11
12 DESCRIPTION="Entropy Package Manager foundation library"
13 HOMEPAGE="http://www.sabayon.org"
14
15 LICENSE="GPL-2"
16 SLOT="0"
17 KEYWORDS="~amd64 ~arm ~ia64 ~ppc ~ppc64 ~x86"
18
19 IUSE=""
20 SRC_URI="mirror://sabayon/${CATEGORY}/${P}.tar.bz2"
21
22 RDEPEND=">=app-misc/pax-utils-0.7
23 dev-db/sqlite:3[soundex(+)]
24 net-misc/rsync
25 sys-apps/diffutils
26 sys-apps/sandbox
27 >=sys-apps/portage-2.1.9[${PYTHON_USEDEP}]
28 sys-devel/gettext
29 ${PYTHON_DEPS}"
30 DEPEND="${RDEPEND}
31 dev-util/intltool"
32
33 REQUIRED_USE="${PYTHON_REQUIRED_USE}"
34
35 S="${S}/lib"
36
37 REPO_CONFPATH="${ROOT}/etc/entropy/repositories.conf"
38 REPO_D_CONFPATH="${ROOT}/etc/entropy/repositories.conf.d"
39 ENTROPY_CACHEDIR="${ROOT}/var/lib/entropy/caches"
40
41 pkg_setup() {
42 python-single-r1_pkg_setup
43 # Can:
44 # - update repos
45 # - update security advisories
46 # - handle on-disk cache (atm)
47 enewgroup entropy || die "failed to create entropy group"
48 # Create unprivileged entropy user
49 enewgroup entropy-nopriv || die "failed to create entropy-nopriv group"
50 enewuser entropy-nopriv -1 -1 -1 entropy-nopriv || die "failed to create entropy-nopriv user"
51 }
52
53 src_install() {
54 emake DESTDIR="${D}" LIBDIR="usr/lib" install || die "make install failed"
55
56 python_optimize "${D}/usr/lib/entropy/lib/entropy"
57 }
58
59 pkg_postinst() {
60 for ex_conf in "${REPO_D_CONFPATH}"/_entropy_sabayon-limbo.example; do
61 real_conf="${ex_conf%.example}"
62 if [ -f "${real_conf}" ] || [ -f "${real_conf/_}" ]; then
63 # skip installation then
64 continue
65 fi
66 elog "Installing: ${real_conf}"
67 cp "${ex_conf}" "${real_conf}" -p
68 done
69
70 # Copy config file over
71 if [ -f "${REPO_CONFPATH}.example" ] && [ ! -f "${REPO_CONFPATH}" ]; then
72 elog "Copying ${REPO_CONFPATH}.example over to ${REPO_CONFPATH}"
73 cp "${REPO_CONFPATH}.example" "${REPO_CONFPATH}" -p
74 fi
75
76 if [ -d "${ENTROPY_CACHEDIR}" ]; then
77 einfo "Purging current Entropy cache"
78 rm -rf "${ENTROPY_CACHEDIR}"/*
79 fi
80
81 # Fixup Entropy Resources Lock, and /etc/entropy/packages
82 # files permissions. This fixes unprivileged Entropy Library usage
83 local res_file="${ROOT}"/var/lib/entropy/client/database/*/.using_resources
84 if [ -f "${res_file}" ]; then
85 chown root:entropy "${res_file}"
86 chmod g+rw "${res_file}"
87 chmod o+r "${res_file}"
88 fi
89 local pkg_files="package.mask package.unmask package.mask.d package.unmask.d"
90 local pkg_file
91 for pkg_file in ${pkg_files}; do
92 pkg_file="${ROOT}/etc/entropy/packages/${pkg_file}"
93 recursive=""
94 if [ -d "${pkg_file}" ]; then
95 recursive="-R"
96 fi
97 if [ -e "${pkg_file}" ]; then
98 chown ${recursive} root:entropy "${pkg_file}"
99 chmod ${recursive} go+r "${pkg_file}"
100 fi
101 done
102
103 # Setup Entropy Library directories ownership
104 chown root:entropy "${ROOT}/var/lib/entropy" # no recursion
105 chown root:entropy "${ROOT}/var/lib/entropy/client/packages" # no recursion
106 chown root:entropy "${ROOT}/var/log/entropy" # no recursion
107
108 echo
109 elog "If you want to enable Entropy packages delta download support, please"
110 elog "install dev-util/bsdiff."
111 echo
112 }

  ViewVC Help
Powered by ViewVC 1.1.20