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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Thu Dec 8 00:09:42 2005 UTC (9 years ago) by pebenito
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
Add compat symlink for genhomedircon.
(Portage version: 2.0.53)

1 # Copyright 1999-2005 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.24.ebuild,v 1.2 2005/07/11 03:21:46 pebenito Exp $
4
5 IUSE="build nls pam"
6
7 inherit eutils
8
9 EXTRAS_VER="1.12"
10 SEPOL_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="~x86 ~ppc ~sparc ~amd64"
19
20 RDEPEND=">=sys-libs/libselinux-${PV}
21 >=sys-libs/libsepol-${SEPOL_VER}
22 !build? ( pam? ( sys-libs/pam ) )
23 build? ( sys-apps/baselayout )"
24
25 DEPEND="${RDEPEND}
26 !build? ( nls? ( sys-devel/gettext ) )"
27
28 S2=${WORKDIR}/policycoreutils-extra
29
30 throw_pam_warning() {
31 # this is an extremely important message that needs to be seen
32 # thus it being shown at the beginning and end of the ebuild
33
34 if ! useq pam; then
35 eerror "PAM is disabled. This is not a supported config for"
36 eerror "general use. Disabling PAM decreases security with"
37 eerror "respect to SELinux protection of authentication."
38 eerror "It also requires policy changes."
39 ebeep 4
40 epause 4
41 fi
42 }
43
44 pkg_setup() {
45 throw_pam_warning
46 }
47
48 src_unpack() {
49 unpack ${A}
50 cd ${S}
51
52 epatch ${FILESDIR}/policycoreutils-1.24-genhomedircon-quiet.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