]> git.ipfire.org Git - thirdparty/plymouth.git/commitdiff
[scripts] Don't hardcode LIBEXECDIR and DATADIR paths
authorScott James Remnant <scott@ubuntu.com>
Tue, 2 Mar 2010 20:06:43 +0000 (20:06 +0000)
committerScott James Remnant <scott@ubuntu.com>
Tue, 2 Mar 2010 20:08:22 +0000 (20:08 +0000)
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.

.gitignore
configure.ac
scripts/Makefile.am
scripts/plymouth-generate-initrd.in [moved from scripts/plymouth-generate-initrd with 67% similarity]
scripts/plymouth-populate-initrd.in
scripts/plymouth-set-default-theme.in

index bac92d9eebcb55d52a04af3def1c40f1b969353f..0d7e8d7d7b5845c9f2990f8970fab6d3cb8a9111 100644 (file)
@@ -27,6 +27,7 @@ aclocal.m4
 stamp-*
 *.rpm
 plymouth
+plymouth-generate-initrd
 plymouth-populate-initrd
 plymouth-set-default-theme
 plymouth-log-viewer
index 6ade4c8ca15d94797be7a13676daa834394c9ba0..fafef27345c6db2583bceeb3aa69fc3ce2ab313d 100644 (file)
@@ -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
 ])
index 3de5046fdc5cb47ec2c40ae6d13d9d11903e2c37..ba492df53806712f318e09d2736a434e0e00839f 100644 (file)
@@ -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
similarity index 67%
rename from scripts/plymouth-generate-initrd
rename to scripts/plymouth-generate-initrd.in
index 1a2ca831787ad88bd839d9ded9539948e530cc2d..35509a1084ac631fd39f0f7fd346bef42ab7172a 100755 (executable)
@@ -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)"
 
index 14eb6fc71c9aeed7307f782a4784d6b4107c2493..0214ee3cf8d66c589a3efbcdc7ba083f069402d6 100755 (executable)
@@ -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
index e5e2ef0e42d3808059981b5793866728e0a4cb30..215497263a8d98ee77b07379a9495fcacea02b38 100755 (executable)
@@ -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) || :)