#tool/distro specific functions for fetching, building and installing dependencies fetch_source () { [ ! -e .fetched_source ] && download_untar "$URL" "src/" touch .fetched_source } build () { BUILDDIR=$TOOL_DIR/$TOOL/build if [ ! -e .built ]; then cd src/$VERSION [ ! -d "${TOOL_DIR}/systemd/build" ] && perror "systemd build directory not found. Build it first." pinfo "configuring..." LIBSYSTEMD_LOGIN_LIBS="-L${TOOL_DIR}/systemd/build/usr/lib/" \ LIBSYSTEMD_LOGIN_CFLAGS="-I${TOOL_DIR}/systemd/build/usr/include -I${TOOL_DIR}/systemd/build/usr/include/systemd -lsystemd-login -lsystemd-daemon" \ ./configure --enable-libsystemd-login=yes --with-systemdsystemunitdir=/etc/systemd/system -prefix="/" --datarootdir="/usr/share" --enable-man-pages=no --enable-gtk-doc-html=no --enable-examples=no --enable-static=no pinfo "calling make..." make || perror "make failed." [ ! -d "$BUILDDIR" ] && mkdir -p "$BUILDDIR" pinfo "installing to $BUILDDIR..." DESTDIR="$BUILDDIR" make install || perror "make install failed..." COPYLIST="list_dpkg_output" [ -e "$COPYLIST" ] && rm "$COPYLIST" touch "$COPYLIST" pinfo "determining required packages..." if [ ! -z ${REQUIRED_PACKAGES} ] then for PACKAGE in ${REQUIRED_PACKAGES} do for FILE in $(dpkg -L ${PACKAGE} | grep -v share/doc | grep -v share/man) do [ ! -d $FILE ] && echo $FILE >> "$COPYLIST" done done # prepare target dir & copy there if [ -s "$COPYLIST" ]; then pinfo "using tar to copy all dependencies to $BUILDDIR" tarcopy "$(cat "$COPYLIST" | sort -u)" "$BUILDDIR" else pinfo "no dependencies found!" fi fi cd - touch .built fi } post_copy() { #Add Polkit User/Group/Shadow to Stage3.2 pinfo "Adding polkitd user to target system..." add_user "polkitd" }