File: rules

package info (click to toggle)
libbultitude-clojure 0.2.7-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 112 kB
  • ctags: 6
  • sloc: makefile: 35
file content (51 lines) | stat: -rwxr-xr-x 1,449 bytes parent folder | download
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
#!/usr/bin/make -f

include /usr/share/javahelper/java-vars.mk

DEB_VERSION := $(shell dpkg-parsechangelog | egrep '^Version:' | cut -f 2 -d ' ')
DEB_NOEPOCH_VERSION := $(shell echo $(DEB_VERSION) | cut -d: -f2-)
DEB_UPSTREAM_VERSION := $(shell echo $(DEB_NOEPOCH_VERSION) | sed 's/-[^-]*$$//')
MDWN_DOCS = $(patsubst %.markdown,%.html,$(wildcard $(CURDIR)/*.markdown))

export CLASSPATH=/usr/share/java/clojure.jar:/usr/share/java/dynapath.jar

PRODUCED_JAR=bultitude.jar

%:
	dh $@ --with javahelper

override_jh_build: $(MDWN_DOCS)
	jar cf $(PRODUCED_JAR) -C src .
	mkdir -p $(CURDIR)/doc/html && mv $(CURDIR)/*.html $(CURDIR)/doc/html

override_jh_classpath:
	jh_classpath $(PRODUCED_JAR)

override_jh_installlibs:
	jh_installlibs $(PRODUCED_JAR)

override_dh_installdocs:
	dh_installdocs $(CURDIR)/*.markdown $(CURDIR)/doc/*

#override_dh_installchangelogs:
#	dh_installchangelogs ChangeLog

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

get-orig-source:
	uscan --download-version $(DEB_UPSTREAM_VERSION) --force-download --rename

%.html:%.markdown
	@echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"' \
		'"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">' > $@
	@echo "<html>" >> $@
	@echo "<head>" >> $@
	@echo "<title>$(shell head -n 1 $< | sed 's/^#*\s*//')</title>" >> $@
	@echo "</head>" >> $@
	@echo "<body>" >> $@
	markdown $< >> $@
	@echo "</body>" >> $@
	@echo "</html>" >> $@