summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common.mk9
-rw-r--r--src/lib/.gitignore1
-rw-r--r--src/lib/Makefile2
-rw-r--r--src/lib/conf.sh.in (renamed from src/lib/conf.sh)12
4 files changed, 16 insertions, 8 deletions
diff --git a/common.mk b/common.mk
index bd0b0d5..e1051de 100644
--- a/common.mk
+++ b/common.mk
@@ -9,7 +9,10 @@ pkglibexecdir ?= $(libexecdir)/libretools
# Usage: <INPUT $(edit) >OUTPUT
# Expand m4_include macros to use librelib
# This is used when using sources grabbed from devtools
-edit = sed -e 's|^\#!\s*/bin/bash|\#!/usr/bin/env bash|' -e 's|m4_include(lib/\(.*\))|. "$$(librelib \1)"|'
+edit = sed \
+ -e 's|^\#!\s*/bin/bash|\#!/usr/bin/env bash|' \
+ -e 's|m4_include(lib/\(.*\))|. "$$(librelib \1)"|' \
+ -e 's|@sysconfdir@|$(sysconfdir)|g'
# Usage: $(call indent,FILENAME)
# Command to auto-indent a file.
@@ -94,6 +97,10 @@ $(sort $(_do_patch)): %: %.ugly Makefile
%: %.in
@echo 'EDIT < $< > $@'; $(edit) <"$<" >"$@"
$(if $(filter-out %.sh,$@),chmod 755 "$@")
+# work-around for what I currently believe to be a regression in Make
+%.sh: %.sh.in
+ @echo 'EDIT < $< > $@'; $(edit) <"$<" >"$@"
+ $(if $(filter-out %.sh,$@),chmod 755 "$@")
# Build ########################################################################
diff --git a/src/lib/.gitignore b/src/lib/.gitignore
index 9a0c402..e769566 100644
--- a/src/lib/.gitignore
+++ b/src/lib/.gitignore
@@ -1,3 +1,4 @@
common.sh
common.sh.in
common.sh.top
+conf.sh
diff --git a/src/lib/Makefile b/src/lib/Makefile
index 5226dda..97b30eb 100644
--- a/src/lib/Makefile
+++ b/src/lib/Makefile
@@ -2,7 +2,7 @@ copy_files = common.sh.in
libexecs = $(filter-out librelib,$(progs))
# include common.sh in libs explicitly, because it might not exist yet
# when the wildcard is performed
-libs = $(sort $(wildcard *.sh) common.sh)
+libs = $(sort $(wildcard *.sh) common.sh conf.sh)
include ../../common.mk
diff --git a/src/lib/conf.sh b/src/lib/conf.sh.in
index 3c4234f..fa66016 100644
--- a/src/lib/conf.sh
+++ b/src/lib/conf.sh.in
@@ -40,27 +40,27 @@ list_files() {
local slug=$1
case $slug in
abs)
- echo /etc/$slug.conf
+ echo @sysconfdir@/$slug.conf
echo "$LIBREHOME/.$slug.conf"
;;
makepkg)
- if [[ ${MAKEPKG_CONF:-} != /etc/$slug.conf && -r ${MAKEPKG_CONF:-} ]]; then
+ if [[ ${MAKEPKG_CONF:-} != @sysconfdir@/$slug.conf && -r ${MAKEPKG_CONF:-} ]]; then
echo "$MAKEPKG_CONF"
else
- echo /etc/$slug.conf
+ echo @sysconfdir@/$slug.conf
echo "$LIBREHOME/.$slug.conf"
fi
;;
xbs*)
- echo /etc/xbs/$slug.conf
+ echo @sysconfdir@/xbs/$slug.conf
echo "$XDG_CONFIG_HOME/xbs/$slug.conf"
;;
libretools)
- echo /etc/$slug.conf
+ echo @sysconfdir@/$slug.conf
echo "$XDG_CONFIG_HOME/libretools/$slug.conf"
;;
*)
- echo /etc/libretools.d/$slug.conf
+ echo @sysconfdir@/libretools.d/$slug.conf
echo "$XDG_CONFIG_HOME/libretools/$slug.conf"
;;
esac