Gentoo Archives: gentoo-commits

From: Matt Thode <prometheanfire@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] repo/gentoo:master commit in: sys-apps/util-linux/files/, sys-apps/util-linux/
Date: Sun, 26 Feb 2017 00:18:40
Message-Id: 1488068280.842d4a25f18d382dd6b1ab906f1b2fa5410bae48.prometheanfire@gentoo
1 commit: 842d4a25f18d382dd6b1ab906f1b2fa5410bae48
2 Author: Matthew Thode <prometheanfire <AT> gentoo <DOT> org>
3 AuthorDate: Sun Feb 26 00:17:26 2017 +0000
4 Commit: Matt Thode <prometheanfire <AT> gentoo <DOT> org>
5 CommitDate: Sun Feb 26 00:18:00 2017 +0000
6 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=842d4a25
7
8 sys-apps/util-linux: install pam.d files for runuser(-l)
9
10 The files installed are the same as the ones installed as of today
11 from the sys-auth/pambase-20150213 package. Specifically the su
12 pam file for runuser and the login file for runuser-l.
13
14 robbat2 said it was ok
15
16 Package-Manager: Portage-2.3.3, Repoman-2.3.1
17
18 sys-apps/util-linux/files/runuser-l.pamd | 5 +
19 sys-apps/util-linux/files/runuser.pamd | 8 +
20 sys-apps/util-linux/util-linux-2.29.2-r1.ebuild | 198 ++++++++++++++++++++++++
21 3 files changed, 211 insertions(+)
22
23 diff --git a/sys-apps/util-linux/files/runuser-l.pamd b/sys-apps/util-linux/files/runuser-l.pamd
24 new file mode 100644
25 index 0000000000..764143558b
26 --- /dev/null
27 +++ b/sys-apps/util-linux/files/runuser-l.pamd
28 @@ -0,0 +1,5 @@
29 +auth include system-local-login
30 +account include system-local-login
31 +password include system-local-login
32 +session optional pam_lastlog.so
33 +session include system-local-login
34
35 diff --git a/sys-apps/util-linux/files/runuser.pamd b/sys-apps/util-linux/files/runuser.pamd
36 new file mode 100644
37 index 0000000000..30c2834eac
38 --- /dev/null
39 +++ b/sys-apps/util-linux/files/runuser.pamd
40 @@ -0,0 +1,8 @@
41 +auth sufficient pam_rootok.so
42 +auth required pam_wheel.so use_uid
43 +auth include system-auth
44 +account include system-auth
45 +password include system-auth
46 +session include system-auth
47 +session required pam_env.so
48 +session optional pam_xauth.so
49
50 diff --git a/sys-apps/util-linux/util-linux-2.29.2-r1.ebuild b/sys-apps/util-linux/util-linux-2.29.2-r1.ebuild
51 new file mode 100644
52 index 0000000000..a4dccc6ab0
53 --- /dev/null
54 +++ b/sys-apps/util-linux/util-linux-2.29.2-r1.ebuild
55 @@ -0,0 +1,198 @@
56 +# Copyright 1999-2017 Gentoo Foundation
57 +# Distributed under the terms of the GNU General Public License v2
58 +
59 +EAPI="5"
60 +
61 +PYTHON_COMPAT=( python2_7 python3_{4,5} )
62 +
63 +inherit eutils toolchain-funcs libtool flag-o-matic bash-completion-r1 \
64 + python-single-r1 multilib-minimal systemd
65 +
66 +MY_PV=${PV/_/-}
67 +MY_P=${PN}-${MY_PV}
68 +
69 +if [[ ${PV} == 9999 ]] ; then
70 + inherit git-2 autotools
71 + EGIT_REPO_URI="git://git.kernel.org/pub/scm/utils/util-linux/util-linux.git"
72 +else
73 + KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~s390 ~sh ~sparc ~x86 ~amd64-linux ~arm-linux ~x86-linux"
74 + SRC_URI="mirror://kernel/linux/utils/util-linux/v${PV:0:4}/${MY_P}.tar.xz"
75 +fi
76 +
77 +DESCRIPTION="Various useful Linux utilities"
78 +HOMEPAGE="https://www.kernel.org/pub/linux/utils/util-linux/"
79 +
80 +LICENSE="GPL-2 LGPL-2.1 BSD-4 MIT public-domain"
81 +SLOT="0"
82 +IUSE="build caps +cramfs fdformat kill ncurses nls pam python +readline selinux slang static-libs +suid systemd test tty-helpers udev unicode"
83 +
84 +# Most lib deps here are related to programs rather than our libs,
85 +# so we rarely need to specify ${MULTILIB_USEDEP}.
86 +RDEPEND="caps? ( sys-libs/libcap-ng )
87 + cramfs? ( sys-libs/zlib )
88 + ncurses? ( >=sys-libs/ncurses-5.2-r2:0=[unicode?] )
89 + pam? ( sys-libs/pam )
90 + python? ( ${PYTHON_DEPS} )
91 + readline? ( sys-libs/readline:0= )
92 + selinux? ( >=sys-libs/libselinux-2.2.2-r4[${MULTILIB_USEDEP}] )
93 + slang? ( sys-libs/slang )
94 + !build? ( systemd? ( sys-apps/systemd ) )
95 + udev? ( virtual/libudev:= )"
96 +DEPEND="${RDEPEND}
97 + virtual/pkgconfig
98 + nls? ( sys-devel/gettext )
99 + test? ( sys-devel/bc )
100 + virtual/os-headers"
101 +RDEPEND+="
102 + kill? (
103 + !sys-apps/coreutils[kill]
104 + !sys-process/procps[kill]
105 + )
106 + !sys-process/schedutils
107 + !sys-apps/setarch
108 + !<sys-apps/sysvinit-2.88-r7
109 + !sys-block/eject
110 + !<sys-libs/e2fsprogs-libs-1.41.8
111 + !<sys-fs/e2fsprogs-1.41.8
112 + !<app-shells/bash-completion-2.3-r2"
113 +
114 +REQUIRED_USE="python? ( ${PYTHON_REQUIRED_USE} )"
115 +
116 +S=${WORKDIR}/${MY_P}
117 +
118 +pkg_setup() {
119 + use python && python-single-r1_pkg_setup
120 +}
121 +
122 +src_prepare() {
123 + if [[ ${PV} == 9999 ]] ; then
124 + po/update-potfiles
125 + eautoreconf
126 + fi
127 + # Undo bad ncurses handling by upstream. #601530
128 + sed -i -E \
129 + -e '/NCURSES_/s:(ncursesw?)[56]-config:$PKG_CONFIG \1:' \
130 + -e 's:(ncursesw?)[56]-config --version:$PKG_CONFIG --exists --print-errors \1:' \
131 + configure || die
132 + elibtoolize
133 +}
134 +
135 +lfs_fallocate_test() {
136 + # Make sure we can use fallocate with LFS #300307
137 + cat <<-EOF > "${T}"/fallocate.${ABI}.c
138 + #define _GNU_SOURCE
139 + #include <fcntl.h>
140 + main() { return fallocate(0, 0, 0, 0); }
141 + EOF
142 + append-lfs-flags
143 + $(tc-getCC) ${CFLAGS} ${CPPFLAGS} ${LDFLAGS} "${T}"/fallocate.${ABI}.c -o /dev/null >/dev/null 2>&1 \
144 + || export ac_cv_func_fallocate=no
145 + rm -f "${T}"/fallocate.${ABI}.c
146 +}
147 +
148 +multilib_src_configure() {
149 + lfs_fallocate_test
150 + # The scanf test in a run-time test which fails while cross-compiling.
151 + # Blindly assume a POSIX setup since we require libmount, and libmount
152 + # itself fails when the scanf test fails. #531856
153 + tc-is-cross-compiler && export scanf_cv_alloc_modifier=ms
154 + export ac_cv_header_security_pam_misc_h=$(multilib_native_usex pam) #485486
155 + export ac_cv_header_security_pam_appl_h=$(multilib_native_usex pam) #545042
156 +
157 + local myeconfargs=(
158 + --enable-fs-paths-extra="${EPREFIX}/usr/sbin:${EPREFIX}/bin:${EPREFIX}/usr/bin"
159 + --docdir='${datarootdir}'/doc/${PF}
160 + $(multilib_native_use_enable nls)
161 + --enable-agetty
162 + --with-bashcompletiondir="$(get_bashcompdir)"
163 + --enable-bash-completion
164 + $(multilib_native_use_enable caps setpriv)
165 + --disable-chfn-chsh
166 + $(multilib_native_use_enable cramfs)
167 + $(multilib_native_use_enable fdformat)
168 + $(multilib_native_usex ncurses "$(use_with unicode ncursesw)" '--without-ncursesw')
169 + $(multilib_native_usex ncurses "$(use_with !unicode ncurses)" '--without-ncurses')
170 + $(usex ncurses '' '--without-tinfo')
171 + $(use_enable unicode widechar)
172 + $(use_enable kill)
173 + --disable-login
174 + $(multilib_native_use_enable tty-helpers mesg)
175 + --disable-nologin
176 + --enable-partx
177 + $(multilib_native_use_with python)
178 + --enable-raw
179 + $(multilib_native_use_with readline)
180 + --enable-rename
181 + --disable-reset
182 + --enable-schedutils
183 + --disable-su
184 + $(multilib_native_use_enable tty-helpers wall)
185 + $(multilib_native_use_enable tty-helpers write)
186 + $(multilib_native_use_enable suid makeinstall-chown)
187 + $(multilib_native_use_enable suid makeinstall-setuid)
188 + $(use_with selinux)
189 + $(multilib_native_use_with slang)
190 + $(use_enable static-libs static)
191 + $(multilib_native_use_with systemd)
192 + --with-systemdsystemunitdir=$(multilib_native_usex systemd "$(systemd_get_unitdir)" "no")
193 + $(multilib_native_use_with udev)
194 + $(tc-has-tls || echo --disable-tls)
195 + )
196 + ECONF_SOURCE=${S} \
197 + econf "${myeconfargs[@]}"
198 +}
199 +
200 +multilib_src_compile() {
201 + if multilib_is_native_abi; then
202 + default
203 + else
204 + # build libraries only
205 + emake -f Makefile -f - mylibs \
206 + <<< 'mylibs: $(usrlib_exec_LTLIBRARIES) $(pkgconfig_DATA)'
207 + fi
208 +}
209 +
210 +multilib_src_test() {
211 + multilib_is_native_abi && emake check
212 +}
213 +
214 +multilib_src_install() {
215 + if multilib_is_native_abi; then
216 + default
217 + else
218 + emake DESTDIR="${D}" install-usrlib_execLTLIBRARIES \
219 + install-pkgconfigDATA install-uuidincHEADERS \
220 + install-nodist_blkidincHEADERS install-nodist_mountincHEADERS \
221 + install-nodist_smartcolsincHEADERS install-nodist_fdiskincHEADERS
222 + fi
223 +
224 + if multilib_is_native_abi; then
225 + # need the libs in /
226 + gen_usr_ldscript -a blkid mount smartcols uuid
227 +
228 + use python && python_optimize
229 + fi
230 +}
231 +
232 +multilib_src_install_all() {
233 + dodoc AUTHORS NEWS README* Documentation/{TODO,*.txt,releases/*}
234 +
235 + # e2fsprogs-libs didnt install .la files, and .pc work fine
236 + prune_libtool_files
237 +
238 + if use pam; then
239 + dopamd "${FILESDIR}/runuser.pamd" runuser
240 + dopamd "${FILESDIR}/runuser-l.pamd" runuser-l
241 + fi
242 +}
243 +
244 +pkg_postinst() {
245 + if ! use tty-helpers; then
246 + elog "The mesg/wall/write tools have been disabled due to USE=-tty-helpers."
247 + fi
248 +
249 + if [[ -z ${REPLACING_VERSIONS} ]]; then
250 + elog "The agetty util now clears the terminal by default. You"
251 + elog "might want to add --noclear to your /etc/inittab lines."
252 + fi
253 +}