1 # Build recipe for shadow.
3 # Copyright (c) 2016-2019 Matias Fonzo, <selk@dragora.org>.
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
21 # Define a category for the output of the package name
24 tarname=${program}-${version}.tar.gz
27 fetch=http://github.com/shadow-maint/shadow/releases/download/${version}/$tarname
30 The shadow tool suite.
32 The shadow package contains programs for handling
33 passwords in a secure way.
36 homepage=http://pkg-shadow.alioth.debian.org
39 # Source documentation
40 docs="COPYING NEWS README TODO"
41 docsdir="${docdir}/${pkgname}"
47 unpack "${tardir}/$tarname"
51 # Set sane permissions
52 chmod -R u+w,go-w,a+rX-s .
56 # Disable the installation of the groups program and its man pages,
57 # as coreutils provides a better version. Also prevent the
58 # installation of manual pages that were already installed by the
59 # man pages package (thanks to "Linux From Scratch")
60 patch -Np0 -i "${worktree}/patches/shadow/shadow-manpages"
62 # ruserok(3) is missing from musl
63 patch -Np0 -i "${worktree}/patches/shadow/shadow-no_rlogin"
65 # Apply to use our custom definitions
66 patch -Np0 -i "${worktree}/patches/shadow/shadow-login.defs.diff"
68 ./configure CFLAGS="$QICFLAGS" LDFLAGS="$QILDFLAGS" \
76 --with-group-name-max-length=32 \
79 --build="$(cc -dumpmachine)"
83 make -j${jobs} DESTDIR="$destdir" install
85 # Include Dragora version of "shadowconfig.sh"
86 cp -p "${worktree}/archive/shadow/usr/sbin/shadowconfig" \
87 "${destdir}/usr/sbin/"
88 chmod 755 "${destdir}/usr/sbin/shadowconfig"
90 # Make the default useradd consistent with our /etc/group file
91 sed -i 's/1000/100/' "${destdir}/etc/default/useradd"
93 # Set mksh(1) as the default shell
94 sed -i 's@SHELL=/bin/bash@SHELL=/bin/mksh@' \
95 "${destdir}/etc/default/useradd"
97 # To handle config file(s)
98 touch "${destdir}/etc/.graft-config" "${destdir}/etc/default/.graft-config"
100 # Compress info documents deleting index file for the package
101 if test -d "${destdir}/$infodir"
103 rm -f "${destdir}/${infodir}/dir"
104 lzip -9 "${destdir}/${infodir}"/*
107 # Compress and link man pages (if needed)
108 if test -d "${destdir}/$mandir"
111 cd "${destdir}/$mandir"
112 find . -type f -exec lzip -9 '{}' +
113 find . -type l | while read -r file
115 ln -sf "$(readlink -- "$file").lz" "${file}.lz"
122 mkdir -p "${destdir}${docsdir}"
126 cp -p $file "${destdir}${docsdir}"