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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.8 - (show annotations) (download)
Tue May 13 02:22:47 2008 UTC (6 years, 7 months ago) by pebenito
Branch: MAIN
CVS Tags: HEAD
Changes since 1.7: +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.28.ebuild,v 1.7 2006/02/22 17:01:06 spb Exp $
4
5 IUSE="build nls pam"
6
7 inherit eutils
8
9 EXTRAS_VER="1.14"
10 SEMNG_VER="1.4"
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 epatch ${FILESDIR}/policycoreutils-unsigned-char-ppc.diff
53
54 # This warning makes no sense, in this context
55 sed -i -e '/FILE/ s/;/=NULL;/' ${S}/audit2why/audit2why.c \
56 || die "audit2why sed failed"
57
58 # fixfiles is extremely dangerous
59 sed -i -e '/^all/s/fixfiles//' ${S}/scripts/Makefile \
60 || die "fixfiles sed 1 failed"
61 sed -i -e '/fixfiles/d' ${S}/scripts/Makefile \
62 || die "fixfiles sed 2 failed"
63
64 if ! useq pam; then
65 # disable pam
66 sed -i -e s/-lpam/-lcrypt/ -e s/-lpam_misc// -e s/-DUSE_PAM// \
67 ${S}/run_init/Makefile || die "PAM sed 1 failed"
68 sed -i -e s/-lpam/-lcrypt/ -e s/-lpam_misc// -e s/-DUSE_PAM// \
69 ${S}/newrole/Makefile || die "PAM sed 2 failed"
70 sed -i -e s/-lpam/-lcrypt/ -e s/-lpam_misc// -e s/-DUSE_PAM// \
71 ${S2}/src/Makefile || die "PAM sed 3 failed"
72 fi
73
74 if ! useq nls; then
75 # disable locale stuff
76 sed -i -e s/-DUSE_NLS// ${S}/run_init/Makefile \
77 || die "NLS sed 1 failed"
78 sed -i -e s/-DUSE_NLS// ${S}/newrole/Makefile \
79 || die "NLS sed 2 failed"
80 sed -i -e s/-DUSE_NLS// ${S}/load_policy/Makefile \
81 || die "NLS sed 3 failed"
82 sed -i -e 's/ po //' ${S}/Makefile \
83 || die "NLS sed 4 failed"
84 fi
85
86 # fix up to accept Gentoo CFLAGS
87 local SUBDIRS="`cd ${S} && find -type d | cut -d/ -f2`"
88 for i in ${SUBDIRS}; do
89 sed -i -e "s:-Wall:-Wall ${CFLAGS}:g" ${S}/${i}/Makefile \
90 || die "${i} Makefile CFLAGS fix failed."
91 done
92 }
93
94 src_compile() {
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} || die
101 einfo "Compiling policycoreutils-extra"
102 emake -C ${S2} || die
103 fi
104 }
105
106 src_install() {
107 if useq build; then
108 dosbin ${S}/setfiles/setfiles
109 else
110 einfo "Installing policycoreutils"
111 make DESTDIR="${D}" -C ${S} install || die
112 einfo "Installing policycoreutils-extra"
113 make DESTDIR="${D}" -C ${S2} install || die
114 fi
115
116 useq pam || rm -fR ${D}/etc/pam.d
117 }
118
119 pkg_postinst() {
120 if useq build; then
121 # need to ensure these
122 mkdir -p ${ROOT}/selinux
123 touch ${ROOT}/selinux/.keep
124 mkdir -p ${ROOT}/sys
125 touch ${ROOT}/sys/.keep
126 mkdir -p ${ROOT}/dev/pts
127 touch ${ROOT}/dev/pts/.keep
128 chmod 0666 ${ROOT}/dev/{ptmx,tty}
129 fi
130
131 throw_pam_warning
132 }

  ViewVC Help
Powered by ViewVC 1.1.20