1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72
|
#!/usr/bin/make -f
include /usr/share/dpkg/pkg-info.mk
SHELL := /bin/bash
ver_parts := $(subst ., ,$(DEB_VERSION_UPSTREAM)))
# The effective version, major.minor, e.g. 1.12
eff_ver := $(word 1,$(ver_parts)).$(word 2,$(ver_parts))
java := /usr/lib/jvm/default-java/bin/java
clj_cp := clojure.jar
clj_cp := $(clj_cp):/usr/share/maven-repo/org/clojure/spec.alpha/debian/spec.alpha-debian.jar
clj_cp := $(clj_cp):/usr/share/maven-repo/org/clojure/core.specs.alpha/debian/core.specs.alpha-debian.jar
clj := $(java) -cp $(clj_cp) clojure.main
sub := sed -e 's/@CLJ_EFF_VER@/$(eff_ver)/'
%:
dh $@ --with javahelper,maven-repo-helper
gen_files := \
debian/clojure.alternatives \
debian/libclojure-java.alternatives \
debian/libclojure-java.classpath
debian/%: debian/%.in debian/changelog
$(sub) $< > $@.tmp
mv $@.tmp $@
execute_after_dh_auto_configure:
cp debian/maven-classpath.properties .
override_dh_auto_build:
dh_auto_build -- jar
override_dh_installalternatives: \
debian/clojure.alternatives debian/libclojure-java.alternatives
dh_installalternatives
override_dh_install:
dh_install
mkdir -p \
debian/clojure/etc/rlwrap \
debian/clojure/usr/bin \
debian/clojure/usr/share/man/man1
cp debian/clojure.1 debian/clojure/usr/share/man/man1/clojure$(eff_ver).1
cp debian/clojurec.1 debian/clojure/usr/share/man/man1/clojurec$(eff_ver).1
$(clj) debian/gencompletions.clj > debian/clojure/etc/rlwrap/clojure$(eff_ver)
$(sub) debian/scripts/clojure > debian/clojure/usr/bin/clojure$(eff_ver)
$(sub) debian/scripts/clojurec > debian/clojure/usr/bin/clojurec$(eff_ver)
mh_installpom -plibclojure-java --no-parent pom.xml
mh_installjar -plibclojure-java -l pom.xml clojure.jar /usr/share/java/clojure-$(eff_ver).jar
# Set unversioned link with alternatives instead
rm debian/libclojure-java/usr/share/java/clojure.jar
# Temporary fix for Bookworm. Provide 1.10.x maven target while clojure
# packages migrate to the new 1.x maven target
mkdir debian/libclojure-java/usr/share/maven-repo/org/clojure/clojure/1.10.x
mh_installpom -plibclojure-java -e1.10.x --no-parent pom.xml
ln -s ../../../../../java/clojure-$(DEB_VERSION_UPSTREAM).jar debian/libclojure-java/usr/share/maven-repo/org/clojure/clojure/1.10.x/clojure-1.10.x.jar
override_jh_classpath: debian/libclojure-java.classpath
jh_classpath -plibclojure-java
override_dh_installchangelogs:
dh_installchangelogs changes.md
override_dh_clean:
rm -f $(gen_files) debian/*.tmp
dh_clean
|