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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.3 - (show annotations) (download)
Sun Mar 13 13:41:29 2005 UTC (9 years, 4 months ago) by pebenito
Branch: MAIN
CVS Tags: HEAD
Changes since 1.2: +1 -1 lines
FILE REMOVED
new upstream release
(Portage version: 2.0.51.19)

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.18-r1.ebuild,v 1.2 2005/01/08 03:13:06 pebenito Exp $
4
5 IUSE="build nls pam"
6
7 inherit eutils
8
9 EXTRAS_VER="1.10"
10 SEPOL_VER="1.2"
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 !build? ( pam? ( sys-libs/pam ) >=sys-libs/libsepol-${SEPOL_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 # patch in code for nls option
52 epatch ${FILESDIR}/policycoreutils-nonls.diff
53
54 # fixfiles is extremely dangerous
55 sed -i -e '/^all/s/fixfiles//' ${S}/scripts/Makefile \
56 || die "fixfiles sed 1 failed"
57 sed -i -e '/fixfiles/d' ${S}/scripts/Makefile \
58 || die "fixfiles sed 2 failed"
59
60 if ! useq pam; then
61 # disable pam
62 sed -i -e s/-lpam/-lcrypt/ -e s/-lpam_misc// -e s/-DUSE_PAM// \
63 ${S}/run_init/Makefile || die "PAM sed 1 failed"
64 sed -i -e s/-lpam/-lcrypt/ -e s/-lpam_misc// -e s/-DUSE_PAM// \
65 ${S}/newrole/Makefile || die "PAM sed 2 failed"
66 sed -i -e s/-lpam/-lcrypt/ -e s/-lpam_misc// -e s/-DUSE_PAM// \
67 ${S2}/src/Makefile || die "PAM sed 3 failed"
68 fi
69
70 if ! useq nls; then
71 # disable locale stuff
72 sed -i -e s/-DUSE_NLS// ${S}/run_init/Makefile \
73 || die "NLS sed 1 failed"
74 sed -i -e s/-DUSE_NLS// ${S}/newrole/Makefile \
75 || die "NLS sed 2 failed"
76 sed -i -e s/-DUSE_NLS// ${S}/load_policy/Makefile \
77 || die "NLS sed 3 failed"
78 sed -i -e 's/ po //' ${S}/Makefile \
79 || die "NLS sed 4 failed"
80 fi
81
82 # fix up to accept Gentoo CFLAGS
83 local SUBDIRS="`cd ${S} && find -type d | cut -d/ -f2`"
84 for i in ${SUBDIRS}; do
85 sed -i -e "s:-Wall:-Wall ${CFLAGS}:g" ${S}/${i}/Makefile \
86 || die "${i} Makefile CFLAGS fix failed."
87 done
88 }
89
90 src_compile() {
91 if useq build; then
92 einfo "Compiling setfiles"
93 emake -C ${S}/setfiles || die
94 else
95 einfo "Compiling policycoreutils"
96 emake -C ${S} || die
97 einfo "Compiling policycoreutils-extra"
98 emake -C ${S2} || die
99 fi
100 }
101
102 src_install() {
103 if useq build; then
104 dosbin ${S}/setfiles/setfiles
105 else
106 einfo "Installing policycoreutils"
107 make DESTDIR="${D}" -C ${S} install || die
108 einfo "Installing policycoreutils-extra"
109 make DESTDIR="${D}" -C ${S2} install || die
110 fi
111
112 useq pam || rm -fR ${D}/etc/pam.d
113 }
114
115 pkg_postinst() {
116 if useq build; then
117 # need to ensure these
118 mkdir -p ${ROOT}/selinux
119 touch ${ROOT}/selinux/.keep
120 mkdir -p ${ROOT}/sys
121 touch ${ROOT}/sys/.keep
122 mkdir -p ${ROOT}/dev/pts
123 touch ${ROOT}/dev/pts/.keep
124 chmod 0666 ${ROOT}/dev/{ptmx,tty}
125 fi
126
127 throw_pam_warning
128 }

  ViewVC Help
Powered by ViewVC 1.1.20