summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.gitignore1
-rw-r--r--Makefile13
-rw-r--r--jh.sh.in (renamed from jh.sh)2
3 files changed, 9 insertions, 7 deletions
diff --git a/.gitignore b/.gitignore
index b121c6e..2bff4aa 100644
--- a/.gitignore
+++ b/.gitignore
@@ -2,3 +2,4 @@
!COPYING
!Makefile
!*.*
+jh.sh
diff --git a/Makefile b/Makefile
index 810b0c4..c2465b5 100644
--- a/Makefile
+++ b/Makefile
@@ -1,11 +1,9 @@
prefix = /usr
bindir = $(prefix)/bin
-# pkgdatadir is hardcoded into jh.sh
-pkgdatadir = /usr/share/jh
-
+jh-bindir = $(prefix)/share/jh
subcommands = help list-commands mvn-basename mvn-install mvn-localrepo checksource
-dirs = $(DESTDIR)$(bindir) $(DESTDIR)$(pkgdatadir)
+dirs = $(DESTDIR)$(bindir) $(DESTDIR)$(jh-bindir)
####
@@ -17,11 +15,14 @@ all: PHONY build
####
build: PHONY jh $(subcommand_files)
-install: PHONY $(DESTDIR)$(bindir)/jh $(addprefix $(DESTDIR)$(pkgdatadir)/,$(subcommand_files) $(help_files))
+install: PHONY $(DESTDIR)$(bindir)/jh $(addprefix $(DESTDIR)$(jh-bindir)/,$(subcommand_files) $(help_files))
clean: PHONY
rm -f jh $(subcommand_files)
-$(DESTDIR)$(pkgdatadir)/%: % | $(DESTDIR)$(pkgdatadir)
+jh.sh: jh.sh.in
+ sed 's|@jh-bindir@|$(jh-bindir)|g' < $< > $@
+
+$(DESTDIR)$(jh-bindir)/%: % | $(DESTDIR)$(jh-bindir)
cp '$<' '$@'
$(DESTDIR)$(bindir)/jh: jh | $(DESTDIR)$(bindir)
diff --git a/jh.sh b/jh.sh.in
index dce758b..0d0b9f6 100644
--- a/jh.sh
+++ b/jh.sh.in
@@ -5,7 +5,7 @@
# as published by Sam Hocevar. See the COPYING file for more details.
if [[ -z $JH_PATH ]]; then
- export JH_PATH=/usr/share/jh
+ export JH_PATH=@jh-bindir@
fi
if [[ -z $jh_short ]]; then