diff options
Diffstat (limited to 'remote/tools/policykit/policykit.build')
-rw-r--r-- | remote/tools/policykit/policykit.build | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/remote/tools/policykit/policykit.build b/remote/tools/policykit/policykit.build index db216f22..871025a1 100644 --- a/remote/tools/policykit/policykit.build +++ b/remote/tools/policykit/policykit.build @@ -2,13 +2,8 @@ fetch_source () { - if [ ! -e .fetched_source ]; then - [ ! -d src ] && mkdir src - wget $URL - tar xfz $VERSION.tar.gz -C src/ - rm $VERSION.tar.gz - touch .fetched_source - fi + [ ! -e .fetched_source ] && download_untar "$URL" "src/" + touch .fetched_source } install_dependencies() { @@ -21,32 +16,41 @@ build () { if [ ! -e .built ]; then cd src/$VERSION - [ ! -d ${TOOL_DIR}/systemd/build ] && echo "[$TOOL] systemd build directory not found Build it first. Exiting." && exit 1 - - export LIBSYSTEMD_LOGIN_LIBS="-L${TOOL_DIR}/systemd/build/usr/lib/" - export 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" - - make - [ ! -d $BUILDDIR ] && mkdir -p $BUILDDIR - DESTDIR=$BUILDDIR make install + [ ! -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 + [ -e "$COPYLIST" ] && rm "$COPYLIST" + touch "$COPYLIST" + pinfo "determining required packages..." if [ ! -z ${REQUIRED_PACKAGES} ] then - for PACKAGE in ${REQUIRED_PACKAGES} + 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 + [ ! -d $FILE ] && echo $FILE >> "$COPYLIST" done done # prepare target dir & copy there - [ ! -d $BUILDDIR ] && mkdir -p $BUILDDIR - tar -cpv $(cat $COPYLIST|sort -u) | tar -xpv -C $BUILDDIR + if [ -s "$COPYLIST" ]; then + pinfo "using tar to copy all dependencies to $BUILDDIR" + tar -cpv $(cat $COPYLIST|sort -u) | tar -xpv -C $BUILDDIR + local RET=$? + [ $RET -ne 0 ] && perror "copy failed." + else + pinfo "no dependencies found!" + fi fi cd - @@ -58,11 +62,7 @@ build () { post_copy() { #Add Polkit User/Group/Shadow to Stage3.2 - local RET=$(add_user polkitd) - if ! [[ $RET ~= [0-9]+ ]] - then - echo "USERADD FAILED: $RET" 1>&2 - exit 1 - fi + pinfo "Adding polkitd user to target system..." + add_user "polkitd" } |