[617118d] | 1 | #!/bin/sh
|
---|
| 2 |
|
---|
| 3 | # cross-lfs target sysklogd build
|
---|
| 4 | # -------------------------------
|
---|
| 5 | # $LastChangedBy$
|
---|
| 6 | # $LastChangedDate$
|
---|
| 7 | # $LastChangedRevision$
|
---|
| 8 | # $HeadURL$
|
---|
| 9 | #
|
---|
| 10 |
|
---|
| 11 | cd ${SRC}
|
---|
| 12 | LOG=sysklogd-target.log
|
---|
| 13 |
|
---|
| 14 | set_libdirname
|
---|
| 15 | setup_multiarch
|
---|
| 16 |
|
---|
| 17 | unpack_tarball sysklogd-${SYSKLOGD_VER} &&
|
---|
| 18 | cd ${PKGDIR}
|
---|
| 19 |
|
---|
| 20 | if [ "${USE_SYSROOT}" = "Y" ]; then
|
---|
| 21 | BUILD_PREFIX="/usr"
|
---|
| 22 | INSTALL_PREFIX="${LFS}${BUILD_PREFIX}"
|
---|
| 23 | else
|
---|
| 24 | INSTALL_PREFIX="${TGT_TOOLS}"
|
---|
| 25 | fi
|
---|
| 26 |
|
---|
| 27 | # If using 2.5+ kernels, patch (klogd linux/modules.h)
|
---|
| 28 | case ${KERNEL_VER} in
|
---|
| 29 | 2.[56].* )
|
---|
| 30 | case ${SYSKLOGD_VER} in
|
---|
| 31 | 1.4.[1-9]* )
|
---|
| 32 | apply_patch sysklogd-${SYSKLOGD_VER}
|
---|
| 33 | ;;
|
---|
| 34 | esac
|
---|
| 35 | ;;
|
---|
| 36 | esac
|
---|
| 37 |
|
---|
| 38 | apply_patch sysklogd-${SYSKLOGD_VER}-cross
|
---|
| 39 |
|
---|
| 40 | # This package defaults to optimisation level -O3
|
---|
| 41 | # Following strips this out, allowing us to set CFLAGS
|
---|
| 42 | # with whatever optimisation we want via RPM_OPT_FLAGS
|
---|
| 43 | test -f Makefile-ORIG ||
|
---|
| 44 | cp Makefile Makefile-ORIG
|
---|
| 45 | sed 's@CFLAGS= $(RPM_OPT_FLAGS) -O3@CFLAGS= $(RPM_OPT_FLAGS)@g' \
|
---|
| 46 | Makefile-ORIG > Makefile
|
---|
| 47 |
|
---|
| 48 | max_log_init Sysklogd ${SYSKLOGD_VER} "Final (shared)" ${BUILDLOGS} ${LOG}
|
---|
| 49 | make -k CC="${TARGET}-gcc ${ARCH_CFLAGS}" \
|
---|
| 50 | LDFLAGS="-s" RPM_OPT_FLAGS="-O2 -pipe ${TGT_CFLAGS}" \
|
---|
| 51 | >> ${LOGFILE} 2>&1 &&
|
---|
| 52 | echo " o Build OK" &&
|
---|
| 53 |
|
---|
| 54 | min_log_init ${INSTLOGS} &&
|
---|
| 55 | if [ ! -d ${INSTALL_PREFIX}/man/man8 ]; then mkdir -p ${INSTALL_PREFIX}/man/man8 ; fi
|
---|
| 56 | if [ ! -d ${LFS}/usr/sbin ]; then mkdir -p ${LFS}/usr/sbin ; fi
|
---|
| 57 |
|
---|
| 58 | echo "Password: " &&
|
---|
| 59 | if [ "${USE_SYSROOT}" = "Y" ]; then
|
---|
| 60 | su -c "make BINDIR=${INSTALL_PREFIX}/sbin MANDIR=${INSTALL_PREFIX}/man install &&
|
---|
| 61 | ln -fs ${TGT_TOOLS}/sbin/syslogd ${LFS}/usr/sbin &&
|
---|
| 62 | ln -fs ${TGT_TOOLS}/sbin/klogd ${LFS}/usr/sbin "
|
---|
| 63 | >> ${LOGFILE} 2>&1 &&
|
---|
| 64 | echo " o ALL OK" || barf
|
---|
| 65 | else
|
---|
| 66 | su -c "make BINDIR=${INSTALL_PREFIX}/sbin MANDIR=${INSTALL_PREFIX}/man install"
|
---|
| 67 | >> ${LOGFILE} 2>&1 &&
|
---|
| 68 | echo " o ALL OK" || barf
|
---|
| 69 | fi
|
---|
| 70 |
|
---|
| 71 | # Create /etc/syslog.conf
|
---|
| 72 | # NOTE: Using LFS syslog.conf, copy in real one later
|
---|
| 73 | cat > ${LFS}/etc/syslog.conf << "EOF"
|
---|
| 74 | # Begin /etc/syslog.conf
|
---|
| 75 |
|
---|
| 76 | auth,authpriv.* -/var/log/auth.log
|
---|
| 77 | *.*;auth,authpriv.none -/var/log/sys.log
|
---|
| 78 | daemon.* -/var/log/daemon.log
|
---|
| 79 | kern.* -/var/log/kern.log
|
---|
| 80 | mail.* -/var/log/mail.log
|
---|
| 81 | user.* -/var/log/user.log
|
---|
| 82 | *.emerg *
|
---|
| 83 |
|
---|
| 84 | # End /etc/syslog.conf
|
---|
| 85 | EOF
|
---|
| 86 |
|
---|