summaryrefslogtreecommitdiffstats
path: root/remote/tools/ldm
diff options
context:
space:
mode:
Diffstat (limited to 'remote/tools/ldm')
-rw-r--r--remote/tools/ldm/ldm.build44
1 files changed, 22 insertions, 22 deletions
diff --git a/remote/tools/ldm/ldm.build b/remote/tools/ldm/ldm.build
index 76f53410..9f45e058 100644
--- a/remote/tools/ldm/ldm.build
+++ b/remote/tools/ldm/ldm.build
@@ -1,13 +1,8 @@
#tool/distro specific functions for fetching, building and installing dependencies
fetch_source () {
- if [ ! -e .fetched_source ]; then
- [ ! -d src ] && mkdir src
- wget $URL
- tar xf $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() {
@@ -15,29 +10,31 @@ install_dependencies() {
}
build () {
- BUILDDIR=$TOOL_DIR/$TOOL/build
-
+ BUILDDIR="$TOOL_DIR/$TOOL/build"
if [ ! -e .built ]; then
- cd src/$VERSION
- ./configure --prefix="/" --datarootdir="/usr/share"
- make
- [ ! -d $BUILDDIR ] && mkdir -p $BUILDDIR
- DESTDIR=$BUILDDIR make install
+ cd "src/$VERSION"
+ pinfo "Running configure"
+ ./configure --prefix="/" --datarootdir="/usr/share" || perror "failed."
+ pinfo "Running make"
+ make || perror "failed."
+ mkdir -p "$BUILDDIR"
+ pinfo "Running make install"
+ DESTDIR="$BUILDDIR" make install || perror "failed."
COPYLIST="list_dpkg_output"
- [ -e $COPYLIST ] && rm $COPYLIST
+ [ -e "$COPYLIST" ] && rm "$COPYLIST"
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
+ mkdir -p "$BUILDDIR"
+ tarcopy "$(cat "$COPYLIST" | sort -u)" "$BUILDDIR"
cd -
touch .built
@@ -46,11 +43,14 @@ build () {
}
post_copy() {
- [ ! -d ${INIT_DIR}/var/lib/lightdm ] && mkdir -p ${INIT_DIR}/var/lib/lightdm
- touch ${INIT_DIR}/var/lib/lightdm/.Xauthority
- chown -R lightdm:lightdm ${INIT_DIR}/var/lib/lightdm/
+ mkdir -p "${INIT_DIR}/var/lib/lightdm"
+ touch "${INIT_DIR}/var/lib/lightdm/.Xauthority" || perror "Cannot touch '${INIT_DIR}/var/lib/lightdm/.Xauthority'"
+ local LDMUID=$(add_user "lightdm")
+ local LDMGID=$(add_group "lightdm")
+ pinfo "lightdm user and group is $LDMUID $LDMGID"
+ chown -R "${LDMUID}:${LDMGID}" "${INIT_DIR}/var/lib/lightdm/" || perror "chowning '${INIT_DIR}/var/lib/lightdm/' failed."
#copyi static data files
- cp -r ${TOOL_DIR}/${TOOL}/data/* ${INIT_DIR}
+ cp -r "${TOOL_DIR}/${TOOL}/data/"* "${INIT_DIR}" || perror "Copying data/ failed."
}