source: scripts/native-scripts/native-shadow.sh@ f118837

clfs-1.2 clfs-2.1 clfs-3.0.0-systemd clfs-3.0.0-sysvinit systemd sysvinit
Last change on this file since f118837 was 617118d, checked in by Jim Gifford <clfs@…>, 19 years ago

r561@server (orig r559): root | 2005-06-05 02:38:49 -0700
Fixed Directory Structure

  • Property mode set to 100755
File size: 2.7 KB
Line 
1#!/bin/bash
2
3# cross-lfs native shadow build
4# -----------------------------
5# $LastChangedBy$
6# $LastChangedDate$
7# $LastChangedRevision$
8# $HeadURL$
9#
10
11cd ${SRC}
12LOG="shadow-native.log"
13
14SELF=`basename ${0}`
15set_buildenv
16set_libdirname
17setup_multiarch
18
19if [ ! "${libdirname}" = "lib" ]; then
20 extra_conf="--libdir=/usr/${libdirname}"
21fi
22
23unpack_tarball shadow-${SHADOW_VER} &&
24cd ${PKGDIR}
25
26# HACK
27# Issue noted with glibc-2.3-20040701 and linux-libc-headers-2.6.7
28test -f libmisc/xmalloc.c-ORIG ||
29 cp -p libmisc/xmalloc.c libmisc/xmalloc.c-ORIG
30
31sed 's@^extern char \*malloc ();@/* & */@g' \
32 libmisc/xmalloc.c-ORIG > libmisc/xmalloc.c
33
34# fix lastlog for shadow-4.0.7
35case ${SHADOW_VER} in
36 4.0.7 )
37 apply_patch shadow-4.0.7-fix_lastlog-1
38 ;;
39esac
40
41# Set to Y if you want a shared libmisc and libshadow and have
42# passwd etc linked dynamically to these
43BUILD_SHADOW_SHARED="Y"
44
45# If not there touch /usr/bin/passwd
46test -f /usr/bin/passwd || touch /usr/bin/passwd
47
48test Y = "${BUILD_SHADOW_SHARED}" &&
49 extra_conf="${extra_conf} --enable-shared"
50
51max_log_init Shadow ${SHADOW_VER} "native (shared)" ${CONFLOGS} ${LOG}
52CC="${CC-gcc} ${ARCH_CFLAGS}" \
53CFLAGS="-O2 -pipe ${TGT_CFLAGS}" \
54./configure --prefix=/usr ${extra_conf} \
55 --mandir=/usr/share/man \
56 >> ${LOGFILE} 2>&1 &&
57echo " o Configure OK" &&
58
59min_log_init ${BUILDLOGS} &&
60make LDFLAGS="-s" \
61 >> ${LOGFILE} 2>&1 &&
62echo " o Build OK" &&
63
64min_log_init ${TESTLOGS} &&
65make check \
66 >> ${LOGFILE} 2>&1 &&
67echo " o Test OK" &&
68
69min_log_init ${INSTLOGS} &&
70make install \
71 >> ${LOGFILE} 2>&1 &&
72echo " o ALL OK" || barf
73
74shadowfiles="limits login.access"
75for file in ${shadowfiles} ; do
76 test -f /etc/${file} ||
77 {
78 cp -v etc/${file} /etc
79 chmod -c 644 /etc/limits
80 }
81done
82
83# LFS: User mailboxes belong in /var/mail not /var/spool/mail
84# From Nico's: use MD5
85sed -e 's%/var/spool/mail%/var/mail%' \
86 -e 's%^#MD5_CRYPT_ENAB.*no%MD5_CRYPT_ENAB yes%' \
87 etc/login.defs.linux > /etc/login.defs
88
89ln -sf vipw /usr/sbin/vigr
90# Nico: create symlink for vigr man page
91ln -sf vipw.8 /usr/share/man/man8/vigr.8
92rm -f /bin/vipw
93mv -f /bin/sg /usr/bin
94
95# Only need to move these if we built shared
96# TODO: 4.0.6 seems we only need to move libshadow...
97# 4.0.7, the below shouldn't be required
98# Must revisit this script... though what we do here doesn't hurt...
99test Y = "${BUILD_SHADOW_SHARED}" &&
100{
101 mv -f /usr/${libdirname}/lib{shadow,misc}.so.0* /${libdirname}
102 ln -sf ../../${libdirname}/libshadow.so.0 /usr/${libdirname}/libshadow.so
103 ln -sf ../../${libdirname}/libmisc.so.0 /usr/${libdirname}/libmisc.so
104 ldconfig
105}
106
107# Create shadow password file if not already built
108test -f /etc/shadow ||
109 /usr/sbin/pwconv
110
Note: See TracBrowser for help on using the repository browser.