#!/bin/sh # # krb5.comp -- see ../../helper.sh for how this file works. # COMP_NAME="krb5" COMP_SOURCES=${BUILD_ROOT}/${COMP_NAME} function _setup_build_env { set_compiler_env cd ${COMP_SOURCES}/src CFLAGS="${_cflags} -fPIC" LDFLAGS="${_ldflags}" DEFINES="-D_FILE_OFFSET_BITS=64" CFLAGS="$CFLAGS $DEFINES" CPPFLAGS="$DEFINES" export DEFINES CFLAGS CPPFLAGS LDFLAGS } function component_configure { _setup_build_env run_autogen ${COMP_SOURCES}/src exit_on_error $? run_configure \ CC="${CC}" \ CFLAGS="${CFLAGS}" \ CPPFLAGS="${CPPFLAGS}" \ LDFLAGS="${LDFLAGS}" \ --prefix=${PREFIXDIR} \ --exec-prefix=${PREFIXDIR} \ --libdir=${PREFIXDIR}/${_lib} \ --includedir=${PREFIXDIR}/include \ --sysconfdir=${SYSCONFDIR} \ --enable-shared \ --without-tcl } function component_build { _setup_build_env # Now build it. Override the RPATH_FLAG and PROG_LIBPATH to drop the # rpath, and override LDCOMBINE to use gcc instead of ld to build # shared libraries. ${MAKE} \ RPATH_FLAG= \ RPATH_TAIL= \ PROG_RPATH= \ LDCOMBINE='${CC} -shared -Wl,-soname=lib$(LIB)$(SHLIBSEXT) $(CFLAGS)' \ SHLIB_EXPFLAGS='$(CFLAGS) $(SHLIB_DIRS) $(SHLIB_EXPLIBS) $(LDFLAGS)' \ ${_mflags} } function component_install { _setup_build_env 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}" [ "$INSTALL_ROOT" != "/" ] && [ -z "${BUILD_PRESERVE_STAGING}" ] && rm -rf $INSTALL_ROOT mkdir -p ${INSTALL_PREFIX_ROOT}/{share,bin,sbin,include,$_lib} mkdir -p ${INSTALL_ROOT}/${SYSCONFDIR} mkdir -p ${STAGE_INSTALL_DIR} ${MAKE} DESTDIR=${INSTALL_ROOT} install if [ -f ${INSTALL_PREFIX_DIR}/sbin/ktutil ]; then /bin/mv ${INSTALL_PREFIX_DIR}/sbin/ktutil ${INSTALL_PREFIX_DIR}/bin/ fi /bin/rm -rf ${INSTALL_PREFIX_DIR}/{sbin,share,var} for file in compile_et; do /bin/rm ${INSTALL_PREFIX_DIR}/bin/$file done cp -pf ${BUILD_ROOT}/config/krb5.conf.default \ ${INSTALL_ROOT}/etc/krb5.conf.default mkdir -m 0755 -p ${STAGING_PREFIX_DIR}/{bin,include,${_lib}} mkdir -m 0755 -p ${STAGING_SYSCONF_DIR} for file in kinit klist kdestroy kpasswd kvno ksu krb5-config; do cp ${INSTALL_PREFIX_DIR}/bin/${file} ${STAGING_PREFIX_DIR}/bin/. done rsync -a --exclude=kerberosIV ${INSTALL_PREFIX_DIR}/include/ ${STAGING_PREFIX_DIR}/include/. # Do we want to also exclude some others (libdes425, libgssrpc)? rsync -a --exclude=krb5 --exclude=bin --exclude="libkadm5*" --exclude="libkdb5*" \ ${INSTALL_PREFIX_DIR}/${_lib}/ ${STAGING_PREFIX_DIR}/${_lib}/. # Fix up libtool/dylib files 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" if [ -z "${POPULATE_DIR}" ] || [ ! -d "${POPULATE_DIR}" ]; then echo "Non-existent or invalid populate dircetory given: ${POPULATE_DIR}" return 1 fi rsync -a --exclude "include" ${INSTALL_ROOT}/ ${POPULATE_DIR}/ mkdir -p ${POPULATE_DIR}/etc/likewise install -m 0644 \ ${BUILD_ROOT}/config/krb5.conf.default \ ${POPULATE_DIR}/etc/likewise/krb5.conf }