summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthony G. Basile <blueness@gentoo.org>2012-11-22 21:51:53 -0500
committerAnthony G. Basile <blueness@gentoo.org>2012-11-22 21:51:53 -0500
commitb396e02c4300b3797b651656b5602b82feb9b7bc (patch)
tree42be07edc44d53b15f73f6d663c5708ef04c07f7
parentcb7d6ade4157f691a3745e9df98dda7917249be9 (diff)
Fix keymap test during make distcheck
The keys/keymap test preformed by src/keymap/check-keymaps.sh must find both keys.txt and the keymap directory. When building out of the source tree, eg when doing `make distcheck`, these are located at ${top_builddir}/src/keymap/keys.txt and ${top_srcdir}/keymap/, respectively. This patch fixes the build so that these are now correctly found. Signed-off-by: Anthony G. Basile <blueness@gentoo.org>
-rw-r--r--configure.ac11
-rw-r--r--keymaps/Makefile.am8
-rw-r--r--[-rwxr-xr-x]src/keymap/check-keymaps.sh.in (renamed from src/keymap/check-keymaps.sh)16
-rw-r--r--[-rwxr-xr-x]src/keymap/keyboard-force-release.sh.in0
4 files changed, 28 insertions, 7 deletions
diff --git a/configure.ac b/configure.ac
index cf4934d762..796721a3c5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -299,6 +299,7 @@ AC_CONFIG_FILES([Makefile
src/gudev/Makefile
src/gudev/gudev-1.0.pc
src/keymap/Makefile
+ src/keymap/check-keymaps.sh
src/keymap/keyboard-force-release.sh
src/libudev/Makefile
src/libudev/libudev.pc
@@ -307,4 +308,14 @@ AC_CONFIG_FILES([Makefile
src/test/Makefile
test/Makefile])
+
AC_OUTPUT
+
+dnl Set configured scripts executable
+if test -f src/keymap/check-keymaps.sh; then
+ chmod +x src/keymap/check-keymaps.sh
+fi
+
+if test -f src/keymap/keyboard-force-release.sh; then
+ chmod +x src/keymap/keyboard-force-release.sh
+fi
diff --git a/keymaps/Makefile.am b/keymaps/Makefile.am
index ba53b030a5..a5dfecf339 100644
--- a/keymaps/Makefile.am
+++ b/keymaps/Makefile.am
@@ -4,7 +4,7 @@ rootprefix=@rootprefix@
udevlibexecdir=@udevlibexecdir@
udevkeymapdir = $(udevlibexecdir)/keymaps
-dist_udevkeymap_DATA = \
+KEYMAPS = \
acer \
acer-aspire_5720 \
acer-aspire_8930 \
@@ -65,3 +65,9 @@ dist_udevkeymap_DATA = \
toshiba-satellite_a110 \
toshiba-satellite_m30x \
zepto-znote
+
+dist_udevkeymap_DATA = \
+ $(KEYMAPS)
+
+EXTRA_DIST = \
+ $(KEYMAPS)
diff --git a/src/keymap/check-keymaps.sh b/src/keymap/check-keymaps.sh.in
index e3abe672d1..a62b48d4d5 100755..100644
--- a/src/keymap/check-keymaps.sh
+++ b/src/keymap/check-keymaps.sh.in
@@ -4,18 +4,22 @@
# and that all key maps listed in the rules are valid and present in
# Makefile.am
-SRCDIR=${1:-../..}
-KEYLIST=${2:-${SRCDIR}/src/keymap/keys.txt}
+top_srcdir=@top_srcdir@
+top_builddir=@top_builddir@
-[ -e "$KEYLIST" ] || {
- echo "need $KEYLIST please build first" >&2
- exit 1
-}
+SRCDIR=${1:-${top_srcdir}}
+BUILDDIR=${1:-${top_builddir}}
+KEYLIST=${2:-${BUILDDIR}/src/keymap/keys.txt}
KEYMAPS_DIR=${SRCDIR}/keymaps
KEYMAPS_LIST=$(ls ${KEYMAPS_DIR}/* | grep -v Makefile)
RULES=${SRCDIR}/rules/95-keymap.rules
+[ -e "$KEYLIST" ] || {
+ echo "need $KEYLIST please build first" >&2
+ exit 1
+}
+
missing=$(join -v 2 <(awk '{print tolower(substr($1,5))}' $KEYLIST | sort -u) \
<(grep -hv '^#' ${KEYMAPS_LIST}| awk '{print $2}' | sort -u))
[ -z "$missing" ] || {
diff --git a/src/keymap/keyboard-force-release.sh.in b/src/keymap/keyboard-force-release.sh.in
index b82674840f..b82674840f 100755..100644
--- a/src/keymap/keyboard-force-release.sh.in
+++ b/src/keymap/keyboard-force-release.sh.in