/[gentoo-x86]/sys-apps/policycoreutils/policycoreutils-1.30.30.ebuild
Gentoo

Contents of /sys-apps/policycoreutils/policycoreutils-1.30.30.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations) (download)
Mon Jun 4 00:52:47 2007 UTC (7 years, 3 months ago) by pebenito
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +1 -1 lines
FILE REMOVED
mark policycoreutils stable, remove old ebuild
(Portage version: 2.1.2.2)

1 # Copyright 1999-2006 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/sys-apps/policycoreutils/policycoreutils-1.30.30.ebuild,v 1.4 2006/10/24 00:12:29 pebenito Exp $
4
5 IUSE="nls pam"
6
7 inherit eutils python
8
9 EXTRAS_VER="1.16"
10 SEMNG_VER="1.6.17"
11 #SELNX_VER="${PV}"
12 SELNX_VER="1.30.29"
13
14 # BUGFIX_PATCH="${FILESDIR}/policycoreutils-1.30.6.diff"
15
16 DESCRIPTION="SELinux core utilities"
17 HOMEPAGE="http://www.nsa.gov/selinux"
18 SRC_URI="http://www.nsa.gov/selinux/archives/${P}.tgz
19 mirror://gentoo/policycoreutils-extra-${EXTRAS_VER}.tar.bz2"
20 LICENSE="GPL-2"
21 SLOT="0"
22 KEYWORDS="alpha amd64 mips ppc sparc x86"
23
24 RDEPEND=">=sys-libs/libselinux-${SELNX_VER}
25 pam? ( sys-libs/pam )
26 =sys-libs/libsemanage-${SEMNG_VER}*"
27
28 DEPEND="${RDEPEND}
29 nls? ( sys-devel/gettext )"
30
31 S2=${WORKDIR}/policycoreutils-extra
32
33 throw_pam_warning() {
34 # this is an extremely important message that needs to be seen
35 # thus it being shown at the beginning and end of the ebuild
36
37 if ! useq pam; then
38 eerror "PAM is disabled. This is not a supported config for"
39 eerror "general use. Disabling PAM decreases security with"
40 eerror "respect to SELinux protection of authentication."
41 eerror "It also requires policy changes."
42 ebeep 4
43 epause 4
44 fi
45 }
46
47 pkg_setup() {
48 throw_pam_warning
49 }
50
51 src_unpack() {
52 unpack ${A}
53 cd ${S}
54
55 [ ! -z "${BUGFIX_PATCH}" ] && epatch "${BUGFIX_PATCH}"
56
57 epatch ${FILESDIR}/policycoreutils-1.32-quietlp.diff
58
59 # This warning makes no sense, in this context
60 sed -i -e '/FILE/ s/;/=NULL;/' ${S}/audit2why/audit2why.c \
61 || die "audit2why sed failed"
62
63 # rlpkg is more useful than fixfiles
64 sed -i -e '/^all/s/fixfiles//' ${S}/scripts/Makefile \
65 || die "fixfiles sed 1 failed"
66 sed -i -e '/fixfiles/d' ${S}/scripts/Makefile \
67 || die "fixfiles sed 2 failed"
68
69 if ! has_version '>=sys-libs/glibc-2.4'; then
70 ewarn "Glibc 2.4 or newer is not available. Disabling restorecond."
71 sed -i -e '/^SUBDIRS/s/restorecond//' ${S}/Makefile
72 fi
73
74 if ! useq pam; then
75 # disable pam
76 sed -i -e s/-lpam/-lcrypt/ -e s/-lpam_misc// -e s/-DUSE_PAM// \
77 ${S}/run_init/Makefile || die "PAM sed 1 failed"
78 sed -i -e s/-lpam/-lcrypt/ -e s/-lpam_misc// -e s/-DUSE_PAM// \
79 ${S}/newrole/Makefile || die "PAM sed 2 failed"
80 sed -i -e s/-lpam/-lcrypt/ -e s/-lpam_misc// -e s/-DUSE_PAM// \
81 ${S2}/src/Makefile || die "PAM sed 3 failed"
82 fi
83
84 if ! useq nls; then
85 # disable locale stuff
86 sed -i -e s/-DUSE_NLS// ${S}/run_init/Makefile \
87 || die "NLS sed 1 failed"
88 sed -i -e s/-DUSE_NLS// ${S}/newrole/Makefile \
89 || die "NLS sed 2 failed"
90 sed -i -e s/-DUSE_NLS// ${S}/load_policy/Makefile \
91 || die "NLS sed 3 failed"
92 sed -i -e 's/ po //' ${S}/Makefile \
93 || die "NLS sed 4 failed"
94 fi
95
96 # fix up to accept Gentoo CFLAGS
97 local SUBDIRS="`cd ${S} && find -type d | cut -d/ -f2`"
98 for i in ${SUBDIRS}; do
99 sed -i -e "s:-Wall:-Wall ${CFLAGS}:g" ${S}/${i}/Makefile \
100 || die "${i} Makefile CFLAGS fix failed."
101 done
102 }
103
104 src_compile() {
105 python_version
106
107 einfo "Compiling policycoreutils"
108 emake -C ${S} PYLIBVER="python${PYVER}" || die
109 einfo "Compiling policycoreutils-extra"
110 emake -C ${S2} || die
111 }
112
113 src_install() {
114 python_version
115
116 einfo "Installing policycoreutils"
117 make DESTDIR="${D}" -C ${S} PYLIBVER="python${PYVER}" install || die
118 einfo "Installing policycoreutils-extra"
119 make DESTDIR="${D}" -C ${S2} install || die
120
121 # remove redhat-style init script
122 rm -fR ${D}/etc/rc.d
123
124 # compatibility symlink
125 dosym /sbin/setfiles /usr/sbin/setfiles
126
127 useq pam || rm -fR ${D}/etc/pam.d
128 }
129
130 pkg_postinst() {
131 python_version
132 python_mod_optimize ${ROOT}usr/lib/python${PYVER}/site-packages
133
134 throw_pam_warning
135 }
136
137 pkg_postrm() {
138 python_version
139 python_mod_cleanup ${ROOT}usr/lib/python${PYVER}/site-packages
140 }

  ViewVC Help
Powered by ViewVC 1.1.20