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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations) (download)
Tue May 13 02:22:47 2008 UTC (5 years, 11 months ago) by pebenito
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +1 -1 lines
FILE REMOVED
sys-apps/policycoreutils: Mark 1.34.15 stable, clear old ebuilds.
(Portage version: 2.1.5_rc6)

1 # Copyright 1999-2007 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.34.1.ebuild,v 1.4 2007/06/26 02:48:24 mr_bones_ Exp $
4
5 IUSE="nls pam"
6
7 inherit eutils python
8
9 EXTRAS_VER="1.17"
10 SEMNG_VER="1.10"
11 SELNX_VER="1.34"
12
13 # BUGFIX_PATCH="${FILESDIR}/policycoreutils-1.30.6.diff"
14
15 DESCRIPTION="SELinux core utilities"
16 HOMEPAGE="http://www.nsa.gov/selinux"
17 SRC_URI="http://www.nsa.gov/selinux/archives/${P}.tgz
18 mirror://gentoo/policycoreutils-extra-${EXTRAS_VER}.tar.bz2"
19 LICENSE="GPL-2"
20 SLOT="0"
21 KEYWORDS="alpha amd64 mips ppc sparc x86"
22
23 RDEPEND=">=sys-libs/libselinux-${SELNX_VER}
24 >=sys-libs/glibc-2.4
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 # This warning makes no sense, in this context
58 sed -i -e '/FILE/ s/;/=NULL;/' ${S}/audit2why/audit2why.c \
59 || die "audit2why sed failed"
60
61 # rlpkg is more useful than fixfiles
62 sed -i -e '/^all/s/fixfiles//' ${S}/scripts/Makefile \
63 || die "fixfiles sed 1 failed"
64 sed -i -e '/fixfiles/d' ${S}/scripts/Makefile \
65 || die "fixfiles sed 2 failed"
66
67 if ! useq pam; then
68 # disable pam
69 sed -i -e s/-lpam/-lcrypt/ -e s/-lpam_misc// -e s/-DUSE_PAM// \
70 ${S}/run_init/Makefile || die "PAM sed 1 failed"
71 sed -i -e s/-lpam/-lcrypt/ -e s/-lpam_misc// -e s/-DUSE_PAM// \
72 ${S}/newrole/Makefile || die "PAM sed 2 failed"
73 sed -i -e s/-lpam/-lcrypt/ -e s/-lpam_misc// -e s/-DUSE_PAM// \
74 ${S2}/src/Makefile || die "PAM sed 3 failed"
75 fi
76
77 if ! useq nls; then
78 # disable locale stuff
79 sed -i -e s/-DUSE_NLS// ${S}/run_init/Makefile \
80 || die "NLS sed 1 failed"
81 sed -i -e s/-DUSE_NLS// ${S}/newrole/Makefile \
82 || die "NLS sed 2 failed"
83 sed -i -e s/-DUSE_NLS// ${S}/load_policy/Makefile \
84 || die "NLS sed 3 failed"
85 sed -i -e 's/ po //' ${S}/Makefile \
86 || die "NLS sed 4 failed"
87 fi
88
89 # fix up to accept Gentoo CFLAGS
90 local SUBDIRS="`cd ${S} && find -type d | cut -d/ -f2`"
91 for i in ${SUBDIRS}; do
92 sed -i -e "s:-Wall:-Wall ${CFLAGS}:g" \
93 -e '/^AUDITH/d' \
94 ${S}/${i}/Makefile \
95 || die "${i} Makefile CFLAGS fix failed."
96
97 # disable audit support because the required version
98 # in portage does not exist yet
99 done
100 }
101
102 src_compile() {
103 python_version
104
105 einfo "Compiling policycoreutils"
106 emake -C ${S} PYLIBVER="python${PYVER}" || die
107 einfo "Compiling policycoreutils-extra"
108 emake -C ${S2} || die
109 }
110
111 src_install() {
112 python_version
113
114 einfo "Installing policycoreutils"
115 make DESTDIR="${D}" -C ${S} PYLIBVER="python${PYVER}" install || die
116 einfo "Installing policycoreutils-extra"
117 make DESTDIR="${D}" -C ${S2} install || die
118
119 # remove redhat-style init script
120 rm -fR ${D}/etc/rc.d
121
122 # compatibility symlink
123 dosym /sbin/setfiles /usr/sbin/setfiles
124
125 if ! useq pam; then
126 rm -fR ${D}/etc/pam.d
127 else
128 if has_version '<sys-libs/pam-0.99'; then
129 # install compat pam.d entries
130 # for older pam
131 make DESTDIR="${D}" -C ${S2}/pam.d install || die
132 fi
133 fi
134 }
135
136 pkg_postinst() {
137 python_version
138 python_mod_optimize ${ROOT}usr/lib/python${PYVER}/site-packages
139
140 throw_pam_warning
141 }
142
143 pkg_postrm() {
144 python_version
145 python_mod_cleanup ${ROOT}usr/lib/python${PYVER}/site-packages
146 }

  ViewVC Help
Powered by ViewVC 1.1.20