debian swirl logo

Back to the packages list clojure1.4

#!/usr/bin/make -f

SOURCE = $(shell dpkg-parsechangelog | grep ^Source | sed "s/Source: //")
VER = $(shell echo $(SOURCE) | sed s/^clojure//)

VERSION = $(shell dpkg-parsechangelog | grep ^Version | sed "s/Version: //")
ORIG_VERSION = $(shell echo $(VERSION) | sed s/-.*//)
PRISTINE_VERSION = $(shell echo $(ORIG_VERSION) | sed s/\+dfsg//)
UPSTREAM_VERSION = $(shell echo $(PRISTINE_VERSION) | sed s/^0\.0\.//)
SRCDIR_NAME = $(SOURCE)-$(ORIG_VERSION).orig
MDWN_DOCS = $(patsubst %.md,%.html,$(wildcard *.md))

include /usr/share/javahelper/java-vars.mk
include /usr/share/cdbs/1/class/ant.mk
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/rules/patchsys-quilt.mk

DEB_JARS  := asm3 asm3-commons

DEB_INSTALL_CHANGELOGS_ALL := changes.md
DEB_INSTALL_DOCS_ALL := readme.txt changes.html

build/clojure1.4:: $(MDWN_DOCS)

binary-install/$(SOURCE)::
		$(JAVA_HOME)/bin/java -cp /usr/share/java/asm3.jar:/usr/share/java/asm3-commons.jar:clojure.jar clojure.main debian/gencompletions.clj > debian/$(SOURCE)/etc/rlwrap/clojure$(VER)

binary-post-install/$(SOURCE)::
		sed -i 's/@VER@/$(VER)/g' debian/$(SOURCE)/usr/bin/*
		prename 's/$$/$(VER)/' debian/$(SOURCE)/usr/bin/*
		prename 's/\.(.)$$/$(VER).$$1/' debian/$(SOURCE)/usr/share/man/*/*
		mh_installpom -p$(SOURCE) --no-parent pom.xml
		mh_installjar -p$(SOURCE) -l -s pom.xml clojure.jar /usr/share/java/clojure-$(VER).jar

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

clean::
		rm -f $(MDWN_DOCS)
		-mh_clean

get-orig-source:
		-uscan --verbose --force-download --no-symlink --upstream-version $(PRISTINE_VERSION)
		mkdir debian/$(SRCDIR_NAME)
		unzip -d debian/$(SRCDIR_NAME) ../clojure?$(UPSTREAM_VERSION).zip
		if test "`ls debian/$(SRCDIR_NAME) | wc -l`" -eq "1" ; then \
		subdir= `echo debian/$(SRCDIR_NAME)/*` && \
			mv $$subdir/* debian/$(SRCDIR_NAME) && \
			rmdir $$subdir ; \
		fi
		rm debian/$(SRCDIR_NAME)/clojure*.jar
		tar czf ../$(SOURCE)_$(ORIG_VERSION).orig.tar.gz -C debian $(SRCDIR_NAME)
		rm -rf debian/$(SRCDIR_NAME)

Builds:

clojure1.4
lisp dialect for the jvm