From: Scott James Remnant Date: Tue, 2 Mar 2010 20:06:43 +0000 (+0000) Subject: [scripts] Don't hardcode LIBEXECDIR and DATADIR paths X-Git-Tag: 0.8.0~62^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=df26cfe6ed372f843873a18fc3a6cbf6ce3336c7;p=thirdparty%2Fplymouth.git [scripts] Don't hardcode LIBEXECDIR and DATADIR paths The scripts hard-coded the paths for LIBEXECDIR and DATADIR, unless passed as environment variables. Instead of doing this, which breaks if plymouth is installed outside of /usr, set these derived from the configure $libexecdir and $datadir variables just as we do for pkg-config, etc. Since we use so many variables, it makes more sense to generate these scripts from config.status rather than having special Makefile rules for them. --- diff --git a/.gitignore b/.gitignore index bac92d9e..0d7e8d7d 100644 --- a/.gitignore +++ b/.gitignore @@ -27,6 +27,7 @@ aclocal.m4 stamp-* *.rpm plymouth +plymouth-generate-initrd plymouth-populate-initrd plymouth-set-default-theme plymouth-log-viewer diff --git a/configure.ac b/configure.ac index 6ade4c8c..fafef273 100644 --- a/configure.ac +++ b/configure.ac @@ -208,6 +208,10 @@ AS_AC_EXPAND(PLYMOUTH_THEME_PATH, $plymouththemedir) plymouthplugindir=$libdir/plymouth/ AS_AC_EXPAND(PLYMOUTH_PLUGIN_PATH, $plymouthplugindir) +AS_AC_EXPAND(PLYMOUTH_LIBDIR, $libdir) +AS_AC_EXPAND(PLYMOUTH_LIBEXECDIR, $libexecdir) +AS_AC_EXPAND(PLYMOUTH_DATADIR, $datadir) + AC_OUTPUT([Makefile src/libply/Makefile src/libply-splash-core/Makefile @@ -245,6 +249,9 @@ AC_OUTPUT([Makefile themes/glow/Makefile themes/script/Makefile images/Makefile + scripts/plymouth-generate-initrd + scripts/plymouth-populate-initrd + scripts/plymouth-set-default-theme scripts/Makefile docs/Makefile ]) diff --git a/scripts/Makefile.am b/scripts/Makefile.am index 3de5046f..ba492df5 100644 --- a/scripts/Makefile.am +++ b/scripts/Makefile.am @@ -6,25 +6,9 @@ initrdscript_SCRIPTS = plymouth-update-initrd plymouth-generate-initrd plymouth- sbinscriptsdir = $(sbindir) sbinscripts_SCRIPTS = plymouth-set-default-theme -plymouth-populate-initrd: $(srcdir)/plymouth-populate-initrd.in - sed -e 's,[@]logofile[@],$(logofile),g' \ - -e 's,[@]plymouthclientdir[@],$(plymouthclientdir),g' \ - -e 's,[@]plymouthdaemondir[@],$(plymouthdaemondir),g' \ - -e 's,[@]RELEASE_FILE[@],$(RELEASE_FILE),g' \ - $(srcdir)/plymouth-populate-initrd.in > plymouth-populate-initrd - -plymouth-set-default-theme: $(srcdir)/plymouth-set-default-theme.in - sed -e 's,[@]logofile[@],$(logofile),g' \ - -e 's,[@]plymouthclientdir[@],$(plymouthclientdir),g' \ - -e 's,[@]plymouthdaemondir[@],$(plymouthdaemondir),g' \ - $(srcdir)/plymouth-set-default-theme.in > plymouth-set-default-theme - EXTRA_DIST= plymouth-update-initrd \ - plymouth-generate-initrd \ + plymouth-generate-initrd.in \ plymouth-populate-initrd.in \ plymouth-set-default-theme.in \ $(noinst_SCRIPTS) \ default.cfg - -CLEANFILES = plymouth-populate-initrd plymouth-set-default-theme -MAINTAINERCLEANFILES = Makefile.in plymouth-populate-initrd plymouth-set-default-theme diff --git a/scripts/plymouth-generate-initrd b/scripts/plymouth-generate-initrd.in similarity index 67% rename from scripts/plymouth-generate-initrd rename to scripts/plymouth-generate-initrd.in index 1a2ca831..35509a10 100755 --- a/scripts/plymouth-generate-initrd +++ b/scripts/plymouth-generate-initrd.in @@ -2,11 +2,11 @@ [ -z "$DESTDIR" ] || exit 0 -[ -z "$PLYMOUTH_LIBEXECDIR" ] && PLYMOUTH_LIBEXECDIR="/usr/libexec" -[ -z "$PLYMOUTH_DATADIR" ] && PLYMOUTH_DATADIR="/usr/share" -[ -z "$PLYMOUTH_POPULATE_INITRD" ] && PLYMOUTH_POPULATE_INITRD="$PLYMOUTH_LIBEXECDIR/plymouth/plymouth-populate-initrd" +[ -z "$PLYMOUTH_LIBEXECDIR" ] && PLYMOUTH_LIBEXECDIR="@PLYMOUTH_LIBEXECDIR@" +[ -z "$PLYMOUTH_DATADIR" ] && PLYMOUTH_DATADIR="@PLYMOUTH_DATADIR@" +[ -z "$PLYMOUTH_POPULATE_INITRD" ] && PLYMOUTH_POPULATE_INITRD="${PLYMOUTH_LIBEXECDIR}/plymouth/plymouth-populate-initrd" [ -z "$PLYMOUTH_DESTDIR" ] && PLYMOUTH_DESTDIR="/boot" -[ -z "$PLYMOUTH_IMAGE_FILE" ] && PLYMOUTH_IMAGE_FILE="$PLYMOUTH_DESTDIR/initrd-plymouth.img" +[ -z "$PLYMOUTH_IMAGE_FILE" ] && PLYMOUTH_IMAGE_FILE="${PLYMOUTH_DESTDIR}/initrd-plymouth.img" PLYMOUTH_INITRD_DIR="$(mktemp --tmpdir -d plymouth-XXXXXXX)" diff --git a/scripts/plymouth-populate-initrd.in b/scripts/plymouth-populate-initrd.in index 14eb6fc7..0214ee3c 100755 --- a/scripts/plymouth-populate-initrd.in +++ b/scripts/plymouth-populate-initrd.in @@ -2,20 +2,20 @@ [ -z "$DESTDIR" ] || exit 0 -[ -z "$LIBEXECDIR" ] && LIBEXECDIR="/usr/libexec" -[ -z "$DATADIR" ] && DATADIR="/usr/share" +[ -z "$PLYMOUTH_LIBEXECDIR" ] && PLYMOUTH_LIBEXECDIR="@PLYMOUTH_LIBEXECDIR@" +[ -z "$PLYMOUTH_DATADIR" ] && PLYMOUTH_DATADIR="@PLYMOUTH_DATADIR@" [ -z "$PLYMOUTH_PLUGIN_PATH" ] && PLYMOUTH_PLUGIN_PATH="$(plymouth --get-splash-plugin-path)" [ -z "$PLYMOUTH_LOGO_FILE" ] && PLYMOUTH_LOGO_FILE="@logofile@" [ -z "$PLYMOUTH_THEME_NAME" ] && PLYMOUTH_THEME_NAME=$(plymouth-set-default-theme) if [ -z "$PLYMOUTH_POPULATE_SOURCE_FUNCTIONS" ]; then - if [ -f "${LIBEXECDIR}/initrd-functions" ]; then - PLYMOUTH_POPULATE_SOURCE_FUNCTIONS="${LIBEXECDIR}/initrd-functions" + if [ -f "${PLYMOUTH_LIBEXECDIR}/initrd-functions" ]; then + PLYMOUTH_POPULATE_SOURCE_FUNCTIONS="${PLYMOUTH_LIBEXECDIR}/initrd-functions" fi - if [ -f "${DATADIR}/dracut/dracut-functions" ]; then - PLYMOUTH_POPULATE_SOURCE_FUNCTIONS="${DATADIR}/dracut/dracut-functions" + if [ -f "${PLYMOUTH_DATADIR}/dracut/dracut-functions" ]; then + PLYMOUTH_POPULATE_SOURCE_FUNCTIONS="${PLYMOUTH_DATADIR}/dracut/dracut-functions" fi fi @@ -69,12 +69,12 @@ set_verbose $verbose || : [ -z "$INITRDDIR" ] && usage error -mkdir -p ${INITRDDIR}${DATADIR}/plymouth/themes +mkdir -p ${INITRDDIR}${PLYMOUTH_DATADIR}/plymouth/themes inst /sbin/plymouthd $INITRDDIR /bin/plymouthd inst /bin/plymouth $INITRDDIR -inst ${DATADIR}/plymouth/themes/text/text.plymouth $INITRDDIR +inst ${PLYMOUTH_DATADIR}/plymouth/themes/text/text.plymouth $INITRDDIR inst ${PLYMOUTH_PLUGIN_PATH}/text.so $INITRDDIR -inst ${DATADIR}/plymouth/themes/details/details.plymouth $INITRDDIR +inst ${PLYMOUTH_DATADIR}/plymouth/themes/details/details.plymouth $INITRDDIR inst ${PLYMOUTH_PLUGIN_PATH}/details.so $INITRDDIR inst ${PLYMOUTH_LOGO_FILE} $INITRDDIR inst @RELEASE_FILE@ $INITRDDIR @@ -84,7 +84,7 @@ if [ -z "$PLYMOUTH_THEME_NAME" ]; then exit 1 fi -PLYMOUTH_MODULE_NAME=$(grep "ModuleName *= *" ${DATADIR}/plymouth/themes/${PLYMOUTH_THEME_NAME}/${PLYMOUTH_THEME_NAME}.plymouth | sed 's/ModuleName *= *//') +PLYMOUTH_MODULE_NAME=$(grep "ModuleName *= *" ${PLYMOUTH_DATADIR}/plymouth/themes/${PLYMOUTH_THEME_NAME}/${PLYMOUTH_THEME_NAME}.plymouth | sed 's/ModuleName *= *//') if [ ! -f ${PLYMOUTH_PLUGIN_PATH}/${PLYMOUTH_MODULE_NAME}.so ]; then echo "The default plymouth plugin (${PLYMOUTH_MODULE_NAME}) doesn't exist" > /dev/stderr @@ -96,15 +96,15 @@ inst ${PLYMOUTH_PLUGIN_PATH}/${PLYMOUTH_MODULE_NAME}.so $INITRDDIR inst ${PLYMOUTH_PLUGIN_PATH}/renderers/drm.so $INITRDDIR inst ${PLYMOUTH_PLUGIN_PATH}/renderers/frame-buffer.so $INITRDDIR -if [ -d ${DATADIR}/plymouth/themes/${PLYMOUTH_THEME_NAME} ]; then - for x in ${DATADIR}/plymouth/themes/${PLYMOUTH_THEME_NAME}/* ; do +if [ -d ${PLYMOUTH_DATADIR}/plymouth/themes/${PLYMOUTH_THEME_NAME} ]; then + for x in ${PLYMOUTH_DATADIR}/plymouth/themes/${PLYMOUTH_THEME_NAME}/* ; do [ ! -f "$x" ] && break inst $x $INITRDDIR done fi -if [ -L ${DATADIR}/plymouth/themes/default.plymouth ]; then - cp -a ${DATADIR}/plymouth/themes/default.plymouth $INITRDDIR${DATADIR}/plymouth/themes +if [ -L ${PLYMOUTH_DATADIR}/plymouth/themes/default.plymouth ]; then + cp -a ${PLYMOUTH_DATADIR}/plymouth/themes/default.plymouth $INITRDDIR${PLYMOUTH_DATADIR}/plymouth/themes fi # vim:ts=8:sw=4:sts=4:et diff --git a/scripts/plymouth-set-default-theme.in b/scripts/plymouth-set-default-theme.in index e5e2ef0e..21549726 100755 --- a/scripts/plymouth-set-default-theme.in +++ b/scripts/plymouth-set-default-theme.in @@ -2,14 +2,14 @@ set -e -[ -z "$LIBEXECDIR" ] && LIBEXECDIR="/usr/libexec" -[ -z "$DATADIR" ] && DATADIR="/usr/share" +[ -z "$PLYMOUTH_LIBEXECDIR" ] && PLYMOUTH_LIBEXECDIR="@PLYMOUTH_LIBEXECDIR@" +[ -z "$PLYMOUTH_DATADIR" ] && PLYMOUTH_DATADIR="@PLYMOUTH_DATADIR@" if [ -z "$PLYMOUTH_PLUGIN_PATH" ]; then if [ -z "$LIB" ]; then PLYMOUTH_PLUGIN_PATH="$(plymouth --get-splash-plugin-path)" else - [ -z "$LIBDIR" ] && LIBDIR="/usr/$LIB" - PLYMOUTH_PLUGIN_PATH=${LIBDIR}/plymouth/ + [ -z "$PLYMOUTH_LIBDIR" ] && PLYMOUTH_LIBDIR="@PLYMOUTH_LIBDIR@" + PLYMOUTH_PLUGIN_PATH=${PLYMOUTH_LIBDIR}/plymouth/ fi fi @@ -34,7 +34,7 @@ EOF function list_themes () { - for theme in ${DATADIR}/plymouth/themes/*/*.plymouth; do + for theme in ${PLYMOUTH_DATADIR}/plymouth/themes/*/*.plymouth; do [ -f $theme ] || continue; echo "$(basename $theme .plymouth)" done @@ -42,10 +42,10 @@ function list_themes () function get_default_theme () { - THEME_NAME=$(basename $(readlink ${DATADIR}/plymouth/themes/default.plymouth) .plymouth) + THEME_NAME=$(basename $(readlink ${PLYMOUTH_DATADIR}/plymouth/themes/default.plymouth) .plymouth) if [ "$THEME_NAME" = ".plymouth" ]; then $0 --reset - THEME_NAME=$(basename $(readlink ${DATADIR}/plymouth/themes/default.plymouth) .plymouth) + THEME_NAME=$(basename $(readlink ${PLYMOUTH_DATADIR}/plymouth/themes/default.plymouth) .plymouth) fi [ "$THEME_NAME" = ".so" ] || echo $THEME_NAME && exit 1 } @@ -144,27 +144,27 @@ if [ `id -u` -ne 0 ]; then fi if [ $DO_RESET -ne 0 ]; then - THEME_NAME=$(basename $(ls -1 -t ${DATADIR}/plymouth/themes/*/*.plymouth 2> /dev/null | tail -n 1) .plymouth) + THEME_NAME=$(basename $(ls -1 -t ${PLYMOUTH_DATADIR}/plymouth/themes/*/*.plymouth 2> /dev/null | tail -n 1) .plymouth) if [ $THEME_NAME = .plymouth ]; then - rm -f ${DATADIR}/plymouth/themes/default.plymouth + rm -f ${PLYMOUTH_DATADIR}/plymouth/themes/default.plymouth exit 0 fi fi -if [ ! -e ${DATADIR}/plymouth/themes/${THEME_NAME}/${THEME_NAME}.plymouth ]; then - echo "${DATADIR}/plymouth/themes/${THEME_NAME}/${THEME_NAME}.plymouth does not exist" > /dev/stderr +if [ ! -e ${PLYMOUTH_DATADIR}/plymouth/themes/${THEME_NAME}/${THEME_NAME}.plymouth ]; then + echo "${PLYMOUTH_DATADIR}/plymouth/themes/${THEME_NAME}/${THEME_NAME}.plymouth does not exist" > /dev/stderr exit 1 fi -MODULE_NAME=$(grep "ModuleName *= *" ${DATADIR}/plymouth/themes/${THEME_NAME}/${THEME_NAME}.plymouth | sed 's/ModuleName *= *//') +MODULE_NAME=$(grep "ModuleName *= *" ${PLYMOUTH_DATADIR}/plymouth/themes/${THEME_NAME}/${THEME_NAME}.plymouth | sed 's/ModuleName *= *//') if [ ! -e ${PLYMOUTH_PLUGIN_PATH}${MODULE_NAME}.so ]; then echo "${PLYMOUTH_PLUGIN_PATH}${MODULE_NAME}.so does not exist" > /dev/stderr exit 1 fi -(cd ${DATADIR}/plymouth/themes; +(cd ${PLYMOUTH_DATADIR}/plymouth/themes; ln -sf ${THEME_NAME}/${THEME_NAME}.plymouth default.plymouth && \ ([ $DO_INITRD_REBUILD -ne 0 ] && \ - $LIBEXECDIR/plymouth/plymouth-update-initrd) || :) + ${PLYMOUTH_LIBEXECDIR}/plymouth/plymouth-update-initrd) || :)