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

Contents of /app-admin/sudo/sudo-1.8.14_p3.ebuild

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations) (download)
Thu Jul 23 20:01:21 2015 UTC (4 years, 5 months ago) by polynomial-c
Branch: MAIN
CVS Tags: HEAD
Version bump. Removed old

(Portage version: 2.2.20/cvs/Linux x86_64, signed Manifest commit with key 981CA6FC)

1 # Copyright 1999-2015 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.14_p1.ebuild,v 1.1 2015/07/20 10:57:20 polynomial-c Exp $
4
5 EAPI=5
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="ISC BSD"
25 SLOT="0"
26 KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-fbsd ~sparc-fbsd ~x86-fbsd ~x64-freebsd ~sparc-solaris"
27 IUSE="ldap nls pam offensive selinux skey +sendmail"
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 sendmail? ( 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 $(use_with sendmail) \
119 --without-opie \
120 --without-linux-audit \
121 --with-rundir="${EPREFIX}"/var/run/sudo \
122 --with-vardir="${EPREFIX}"/var/db/sudo \
123 --with-plugindir="${EPREFIX}"/usr/$(get_libdir)/sudo \
124 --docdir="${EPREFIX}"/usr/share/doc/${PF}
125 }
126
127 src_install() {
128 default
129
130 if use ldap ; then
131 dodoc README.LDAP doc/schema.OpenLDAP
132 dosbin plugins/sudoers/sudoers2ldif
133
134 cat <<-EOF > "${T}"/ldap.conf.sudo
135 # See ldap.conf(5) and README.LDAP for details
136 # This file should only be readable by root
137
138 # supported directives: host, port, ssl, ldap_version
139 # uri, binddn, bindpw, sudoers_base, sudoers_debug
140 # tls_{checkpeer,cacertfile,cacertdir,randfile,ciphers,cert,key
141 EOF
142
143 insinto /etc
144 doins "${T}"/ldap.conf.sudo
145 fperms 0440 /etc/ldap.conf.sudo
146 fi
147
148 pamd_mimic system-auth sudo auth account session
149
150 keepdir /var/db/sudo
151 fperms 0700 /var/db/sudo
152
153 # Don't install into /var/run as that is a tmpfs most of the time
154 # (bug #504854)
155 rm -rf "${D}"/var/run
156 }
157
158 pkg_postinst() {
159 if use ldap ; then
160 ewarn
161 ewarn "sudo uses the /etc/ldap.conf.sudo file for ldap configuration."
162 ewarn
163 if grep -qs '^[[:space:]]*sudoers:' "${ROOT}"/etc/nsswitch.conf ; then
164 ewarn "In 1.7 series, LDAP is no more consulted, unless explicitly"
165 ewarn "configured in /etc/nsswitch.conf."
166 ewarn
167 ewarn "To make use of LDAP, add this line to your /etc/nsswitch.conf:"
168 ewarn " sudoers: ldap files"
169 ewarn
170 fi
171 fi
172 if use prefix ; then
173 ewarn
174 ewarn "To use sudo, you need to change file ownership and permissions"
175 ewarn "with root privileges, as follows:"
176 ewarn
177 ewarn " # chown root:root ${EPREFIX}/usr/bin/sudo"
178 ewarn " # chown root:root ${EPREFIX}/usr/lib/sudo/sudoers.so"
179 ewarn " # chown root:root ${EPREFIX}/etc/sudoers"
180 ewarn " # chown root:root ${EPREFIX}/etc/sudoers.d"
181 ewarn " # chown root:root ${EPREFIX}/var/db/sudo"
182 ewarn " # chmod 4111 ${EPREFIX}/usr/bin/sudo"
183 ewarn
184 fi
185
186 elog "To use the -A (askpass) option, you need to install a compatible"
187 elog "password program from the following list. Starred packages will"
188 elog "automatically register for the use with sudo (but will not force"
189 elog "the -A option):"
190 elog ""
191 elog " [*] net-misc/ssh-askpass-fullscreen"
192 elog " net-misc/x11-ssh-askpass"
193 elog ""
194 elog "You can override the choice by setting the SUDO_ASKPASS environmnent"
195 elog "variable to the program you want to use."
196 }

  ViewVC Help
Powered by ViewVC 1.1.20