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

Contents of /sys-apps/policycoreutils/policycoreutils-1.30-r1.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Tue May 13 02:22:47 2008 UTC (6 years, 3 months ago) by pebenito
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +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-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-r1.ebuild,v 1.2 2006/07/31 01:30:13 pebenito Exp $
4
5 IUSE="build nls pam"
6
7 inherit eutils python
8
9 EXTRAS_VER="1.15"
10 SEMNG_VER="1.6"
11
12 DESCRIPTION="SELinux core utilities"
13 HOMEPAGE="http://www.nsa.gov/selinux"
14 SRC_URI="http://www.nsa.gov/selinux/archives/${P}.tgz
15 mirror://gentoo/policycoreutils-extra-${EXTRAS_VER}.tar.bz2"
16 LICENSE="GPL-2"
17 SLOT="0"
18 KEYWORDS="~alpha amd64 ~mips ppc ~sparc x86"
19
20 RDEPEND=">=sys-libs/libselinux-${PV}
21 !build? ( pam? ( sys-libs/pam ) =sys-libs/libsemanage-${SEMNG_VER}* )
22 build? ( sys-apps/baselayout )"
23
24 DEPEND="${RDEPEND}
25 !build? ( nls? ( sys-devel/gettext ) )"
26
27 S2=${WORKDIR}/policycoreutils-extra
28
29 throw_pam_warning() {
30 # this is an extremely important message that needs to be seen
31 # thus it being shown at the beginning and end of the ebuild
32
33 if ! useq pam; then
34 eerror "PAM is disabled. This is not a supported config for"
35 eerror "general use. Disabling PAM decreases security with"
36 eerror "respect to SELinux protection of authentication."
37 eerror "It also requires policy changes."
38 ebeep 4
39 epause 4
40 fi
41 }
42
43 pkg_setup() {
44 throw_pam_warning
45 }
46
47 src_unpack() {
48 unpack ${A}
49 cd ${S}
50
51 epatch ${FILESDIR}/policycoreutils-1.28-quietlp.diff
52
53 # This warning makes no sense, in this context
54 sed -i -e '/FILE/ s/;/=NULL;/' ${S}/audit2why/audit2why.c \
55 || die "audit2why sed failed"
56
57 # fixfiles is extremely dangerous
58 sed -i -e '/^all/s/fixfiles//' ${S}/scripts/Makefile \
59 || die "fixfiles sed 1 failed"
60 sed -i -e '/fixfiles/d' ${S}/scripts/Makefile \
61 || die "fixfiles sed 2 failed"
62
63 if ! useq pam; then
64 # disable pam
65 sed -i -e s/-lpam/-lcrypt/ -e s/-lpam_misc// -e s/-DUSE_PAM// \
66 ${S}/run_init/Makefile || die "PAM sed 1 failed"
67 sed -i -e s/-lpam/-lcrypt/ -e s/-lpam_misc// -e s/-DUSE_PAM// \
68 ${S}/newrole/Makefile || die "PAM sed 2 failed"
69 sed -i -e s/-lpam/-lcrypt/ -e s/-lpam_misc// -e s/-DUSE_PAM// \
70 ${S2}/src/Makefile || die "PAM sed 3 failed"
71 fi
72
73 if ! useq nls; then
74 # disable locale stuff
75 sed -i -e s/-DUSE_NLS// ${S}/run_init/Makefile \
76 || die "NLS sed 1 failed"
77 sed -i -e s/-DUSE_NLS// ${S}/newrole/Makefile \
78 || die "NLS sed 2 failed"
79 sed -i -e s/-DUSE_NLS// ${S}/load_policy/Makefile \
80 || die "NLS sed 3 failed"
81 sed -i -e 's/ po //' ${S}/Makefile \
82 || die "NLS sed 4 failed"
83 fi
84
85 # fix up to accept Gentoo CFLAGS
86 local SUBDIRS="`cd ${S} && find -type d | cut -d/ -f2`"
87 for i in ${SUBDIRS}; do
88 sed -i -e "s:-Wall:-Wall ${CFLAGS}:g" ${S}/${i}/Makefile \
89 || die "${i} Makefile CFLAGS fix failed."
90 done
91 }
92
93 src_compile() {
94 python_version
95 if useq build; then
96 einfo "Compiling setfiles"
97 emake -C ${S}/setfiles || die
98 else
99 einfo "Compiling policycoreutils"
100 emake -C ${S} PYLIBVER="python${PYVER}" || die
101 einfo "Compiling policycoreutils-extra"
102 emake -C ${S2} || die
103 fi
104 }
105
106 src_install() {
107 python_version
108 if useq build; then
109 dosbin ${S}/setfiles/setfiles
110 else
111 einfo "Installing policycoreutils"
112 make DESTDIR="${D}" -C ${S} PYLIBVER="python${PYVER}" install || die
113 einfo "Installing policycoreutils-extra"
114 make DESTDIR="${D}" -C ${S2} install || die
115 fi
116
117 useq pam || rm -fR ${D}/etc/pam.d
118 }
119
120 pkg_postinst() {
121 python_version
122
123 if useq build; then
124 # need to ensure these
125 mkdir -p ${ROOT}/selinux
126 touch ${ROOT}/selinux/.keep
127 mkdir -p ${ROOT}/sys
128 touch ${ROOT}/sys/.keep
129 mkdir -p ${ROOT}/dev/pts
130 touch ${ROOT}/dev/pts/.keep
131 chmod 0666 ${ROOT}/dev/{ptmx,tty}
132 fi
133
134 python_mod_optimize ${ROOT}usr/lib/python${PYVER}/site-packages
135
136 throw_pam_warning
137 }
138
139 pkg_postrm() {
140 python_version
141 python_mod_cleanup ${ROOT}usr/lib/python${PYVER}/site-packages
142 }

  ViewVC Help
Powered by ViewVC 1.1.20