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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (show annotations) (download)
Sat Jun 25 23:43:25 2005 UTC (8 years, 9 months ago) by pebenito
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +1 -1 lines
FILE REMOVED
new upstream release
(Portage version: 2.0.51.22-r1)

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

  ViewVC Help
Powered by ViewVC 1.1.20