File: rules

package info (click to toggle)
complete-clojure 0.2.4-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 128 kB
  • sloc: xml: 64; makefile: 29
file content (36 lines) | stat: -rwxr-xr-x 1,103 bytes parent folder | download | duplicates (3)
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
#!/usr/bin/make -f

include /usr/share/javahelper/java-vars.mk
export JAVA_HOME=/usr/lib/jvm/default-java
export CLASSPATH=/usr/share/java/clojure.jar

MDWN_DOCS = $(patsubst %.md,%.html,$(wildcard $(CURDIR)/*.md))
PRODUCED_JAR=clojure-complete.jar
NAMESPACE=clojure-complete/clojure-complete
MAVEN_META=META-INF/maven/$(NAMESPACE)
LEIN_META=META-INF/leiningen/$(NAMESPACE)

%:
	dh $@ --with javahelper,jh_maven_repo_helper

override_jh_build: $(MDWN_DOCS)
	jar cf $(PRODUCED_JAR) -C src .
	mkdir -p $(CURDIR)/doc/html && mv $(CURDIR)/*.html $(CURDIR)/doc/html
	mkdir -p $(CURDIR)/meta/$(MAVEN_META)
	mkdir -p $(CURDIR)/meta/$(LEIN_META)
	cp $(CURDIR)/project.clj $(CURDIR)/meta/$(LEIN_META)
	cp $(CURDIR)/debian/maven-meta/* $(CURDIR)/meta/$(MAVEN_META)
	jar uf $(PRODUCED_JAR) -C meta/ META-INF
	jar uf $(PRODUCED_JAR) project.clj

override_jh_clean:
	jh_clean
	rm -f $(CURDIR)/$(PRODUCED_JAR)
	rm -rf $(CURDIR)/doc
	rm -rf $(CURDIR)/meta

%.html:%.md
	cat debian/header.html > $@
	sed -i'' -e 's/@TITLE@/$(shell head -n 1 $< | sed 's/^#*\s*//')/g' $@
	markdown $< >> $@
	cat debian/footer.html >> $@