/[gentoo-x86]/app-admin/sudo/sudo-1.8.5.ebuild
Gentoo

Contents of /app-admin/sudo/sudo-1.8.5.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.5 - (show annotations) (download)
Thu May 17 19:07:29 2012 UTC (2 years, 4 months ago) by vapier
Branch: MAIN
CVS Tags: HEAD
Changes since 1.4: +1 -1 lines
FILE REMOVED
Fix parsing of #includedir directives #416371 by Marcin Mirosław.

(Portage version: 2.2.0_alpha102/cvs/Linux x86_64, RepoMan options: --force)

1 # Copyright 1999-2012 Gentoo Foundation
2 # Distributed under the terms of the GNU General Public License v2
3 # $Header: /var/cvsroot/gentoo-x86/app-admin/sudo/sudo-1.8.5.ebuild,v 1.4 2012/05/17 18:46:01 klausman Exp $
4
5 EAPI="4"
6
7 inherit eutils pam multilib libtool
8
9 MY_P=${P/_/}
10 MY_P=${MY_P/beta/b}
11
12 uri_prefix=
13 case ${P} in
14 *_beta*|*_rc*) uri_prefix=beta/ ;;
15 esac
16
17 DESCRIPTION="Allows users or groups to run commands as other users"
18 HOMEPAGE="http://www.sudo.ws/"
19 SRC_URI="http://www.sudo.ws/sudo/dist/${uri_prefix}${MY_P}.tar.gz
20 ftp://ftp.sudo.ws/pub/sudo/${uri_prefix}${MY_P}.tar.gz"
21
22 # Basic license is ISC-style as-is, some files are released under
23 # 3-clause BSD license
24 LICENSE="as-is BSD"
25 SLOT="0"
26 KEYWORDS="alpha ~amd64 ~arm hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc x86 ~sparc-fbsd ~x86-fbsd ~sparc-solaris"
27 IUSE="ldap nls pam offensive selinux skey"
28
29 DEPEND="pam? ( virtual/pam )
30 skey? ( >=sys-auth/skey-1.1.5-r1 )
31 ldap? (
32 >=net-nds/openldap-2.1.30-r1
33 dev-libs/cyrus-sasl
34 )
35 sys-libs/zlib"
36 RDEPEND="${DEPEND}
37 selinux? ( sec-policy/selinux-sudo )
38 ldap? ( dev-lang/perl )
39 pam? ( sys-auth/pambase )
40 >=app-misc/editor-wrapper-3
41 virtual/editor
42 virtual/mta"
43 DEPEND="${DEPEND}
44 sys-devel/bison"
45
46 S=${WORKDIR}/${MY_P}
47
48 REQUIRED_USE="pam? ( !skey ) skey? ( !pam )"
49
50 MAKEOPTS+=" SAMPLES="
51
52 src_prepare() {
53 elibtoolize
54 }
55
56 set_rootpath() {
57 # FIXME: secure_path is a compile time setting. using ROOTPATH
58 # is not perfect, env-update may invalidate this, but until it
59 # is available as a sudoers setting this will have to do.
60 einfo "Setting secure_path ..."
61
62 # first extract the default ROOTPATH from build env
63 ROOTPATH=$(unset ROOTPATH; . "${EPREFIX}"/etc/profile.env; echo "${ROOTPATH}")
64 if [[ -z ${ROOTPATH} ]] ; then
65 ewarn " Failed to find ROOTPATH, please report this"
66 fi
67
68 # then remove duplicate path entries
69 cleanpath() {
70 local newpath thisp IFS=:
71 for thisp in $1 ; do
72 if [[ :${newpath}: != *:${thisp}:* ]] ; then
73 newpath+=:$thisp
74 else
75 einfo " Duplicate entry ${thisp} removed..."
76 fi
77 done
78 ROOTPATH=${newpath#:}
79 }
80 cleanpath /bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/opt/bin${ROOTPATH:+:${ROOTPATH}}
81
82 # finally, strip gcc paths #136027
83 rmpath() {
84 local e newpath thisp IFS=:
85 for thisp in ${ROOTPATH} ; do
86 for e ; do [[ $thisp == $e ]] && continue 2 ; done
87 newpath+=:$thisp
88 done
89 ROOTPATH=${newpath#:}
90 }
91 rmpath '*/gcc-bin/*' '*/gnat-gcc-bin/*' '*/gnat-gcc/*'
92
93 einfo "... done"
94 }
95
96 src_configure() {
97 local ROOTPATH
98 set_rootpath
99
100 # audit: somebody got to explain me how I can test this before I
101 # enable it.. - Diego
102 # plugindir: autoconf code is crappy and does not delay evaluation
103 # until `make` time, so we have to use a full path here rather than
104 # basing off other values.
105 econf \
106 --enable-zlib=system \
107 --with-secure-path="${ROOTPATH}" \
108 --with-editor="${EPREFIX}"/usr/libexec/editor \
109 --with-env-editor \
110 $(use_with offensive insults) \
111 $(use_with offensive all-insults) \
112 $(use_with ldap ldap_conf_file /etc/ldap.conf.sudo) \
113 $(use_with ldap) \
114 $(use_enable nls) \
115 $(use_with pam) \
116 $(use_with skey) \
117 $(use_with selinux) \
118 --without-opie \
119 --without-linux-audit \
120 --with-timedir="${EPREFIX}"/var/db/sudo \
121 --with-plugindir="${EPREFIX}"/usr/$(get_libdir)/sudo \
122 --docdir="${EPREFIX}"/usr/share/doc/${PF}
123 }
124
125 src_install() {
126 emake DESTDIR="${D}" install || die
127
128 if use ldap ; then
129 dodoc README.LDAP doc/schema.OpenLDAP
130 dosbin plugins/sudoers/sudoers2ldif
131
132 cat <<-EOF > "${T}"/ldap.conf.sudo
133 # See ldap.conf(5) and README.LDAP for details
134 # This file should only be readable by root
135
136 # supported directives: host, port, ssl, ldap_version
137 # uri, binddn, bindpw, sudoers_base, sudoers_debug
138 # tls_{checkpeer,cacertfile,cacertdir,randfile,ciphers,cert,key
139 EOF
140
141 insinto /etc
142 doins "${T}"/ldap.conf.sudo
143 fperms 0440 /etc/ldap.conf.sudo
144 fi
145
146 pamd_mimic system-auth sudo auth account session
147
148 keepdir /var/db/sudo
149 fperms 0700 /var/db/sudo
150 }
151
152 pkg_postinst() {
153 if use ldap ; then
154 ewarn
155 ewarn "sudo uses the /etc/ldap.conf.sudo file for ldap configuration."
156 ewarn
157 if grep -qs '^[[:space:]]*sudoers:' "${ROOT}"/etc/nsswitch.conf ; then
158 ewarn "In 1.7 series, LDAP is no more consulted, unless explicitly"
159 ewarn "configured in /etc/nsswitch.conf."
160 ewarn
161 ewarn "To make use of LDAP, add this line to your /etc/nsswitch.conf:"
162 ewarn " sudoers: ldap files"
163 ewarn
164 fi
165 fi
166 if use prefix ; then
167 ewarn
168 ewarn "To use sudo, you need to change file ownership and permissions"
169 ewarn "with root privileges, as follows:"
170 ewarn
171 ewarn " # chown root:root ${EPREFIX}/usr/bin/sudo"
172 ewarn " # chown root:root ${EPREFIX}/usr/lib/sudo/sudoers.so"
173 ewarn " # chown root:root ${EPREFIX}/etc/sudoers"
174 ewarn " # chmod 4111 ${EPREFIX}/usr/bin/sudo"
175 ewarn
176 fi
177
178 elog "To use the -A (askpass) option, you need to install a compatible"
179 elog "password program from the following list. Starred packages will"
180 elog "automatically register for the use with sudo (but will not force"
181 elog "the -A option):"
182 elog ""
183 elog " [*] net-misc/ssh-askpass-fullscreen"
184 elog " net-misc/x11-ssh-askpass"
185 elog ""
186 elog "You can override the choice by setting the SUDO_ASKPASS environmnent"
187 elog "variable to the program you want to use."
188 }

  ViewVC Help
Powered by ViewVC 1.1.20