#!/bin/bash COMP_NAME="lsass" COMP_SOURCES="${BUILD_ROOT}/${COMP_NAME}" function _setup_dirs { NSS_DIR="/usr/${_lib}" PAM_DIR="/usr/${_lib}/security" case `uname -s` in Linux) NSS_DIR="/${_lib}" PAM_DIR="/${_lib}/security" ;; FreeBSD) NSS_DIR="/usr/local/${_lib}" PAM_DIR="/usr/local/${_lib}" ;; esac export NSS_DIR PAM_DIR } function _setup_build_env { set_compiler_env cd ${COMP_SOURCES}/. exit_on_error $? CFLAGS="${_cflags}" LDFLAGS="${_ldflags}" CPPFLAGS="${_cppflags}" PATH=${STAGE_INSTALL_DIR}/${PREFIXDIR}/bin:$PATH case `uname -s` in NetBSD) CPPFLAGS="${CPPFLAGS} -DNO_STATIC_MODULES=1" CFLAGS="${CFLAGS} -DNO_STATIC_MODULES=1" ;; esac export PATH CPPFLAGS LDFLAGS CFLAGS CC } function component_configure { local lsass_version="" local build_version="${OFFICIAL_BUILD_NUMBER}" local enable_debug="" local enable_compat="" _setup_build_env _setup_dirs run_autogen ${COMP_SOURCES} exit_on_error $? run_configure \ --prefix=${PREFIXDIR} \ --libdir=${PREFIXDIR}/${_lib} \ --sysconfdir=${SYSCONFDIR} \ --localstatedir=${LOCALSTATEDIR} \ --with-pam-libdir=${PAM_DIR} \ --with-nss-libdir=${NSS_DIR} } function component_build { _setup_build_env ${MAKE} ${_mflags} all } function component_install { _setup_build_env local INSTALL_ROOT="${STAGE_COMP_DIR}/${COMP_NAME}" [ "$INSTALL_ROOT" != "/" ] && [ -z "${BUILD_PRESERVE_STAGING}" ] && rm -rf $INSTALL_ROOT mkdir -p ${INSTALL_ROOT} mkdir -p ${STAGE_INSTALL_DIR} ${MAKE} DESTDIR=${INSTALL_ROOT} install if [ ! -d ${INSTALL_ROOT}${INITDIR} ]; then mkdir -p ${INSTALL_ROOT}${INITDIR} exit_on_error $? fi cat ${BUILD_ROOT}/config/${COMP_NAME}d | sed \ -e s:PREFIX_DIR:${PREFIXDIR}: \ -e s:EXECDIR:${PREFIXDIR}/bin: \ -e s:#LWI_STARTUP_TYPE_REDHAT:: \ > ${INSTALL_ROOT}${INITDIR}/${COMP_NAME}d chmod 755 ${INSTALL_ROOT}${INITDIR}/${COMP_NAME}d cp -pf ${BUILD_ROOT}/config/likewise-krb5-ad.conf \ ${INSTALL_ROOT}/${SYSCONFDIR} rsync -a ${INSTALL_ROOT}/ ${STAGE_INSTALL_DIR}/ libtool_rewrite_staging } function component_populate { local INSTALL_ROOT="${STAGE_COMP_DIR}/${COMP_NAME}" local INSTALL_PREFIX_DIR="${INSTALL_ROOT}/${PREFIXDIR}" local STAGING_PREFIX_DIR="${STAGE_INSTALL_DIR}/${PREFIXDIR}" local STAGING_SYSCONF_DIR="${STAGE_INSTALL_DIR}/${SYSCONFDIR}" local POPULATE_DIR="$1" local EXCLUDE_FILE="${POPULATE_DIR}/../exclude.files" if [ -z "${POPULATE_DIR}" ] || [ ! -d "${POPULATE_DIR}" ]; then echo "Non-existent or invalid populate dircetory given: ${POPULATE_DIR}" return 1 fi cat < ${EXCLUDE_FILE} include share *.a *.la test EOF rsync -a --exclude-from=${EXCLUDE_FILE} ${INSTALL_ROOT}/ ${POPULATE_DIR}/ }