summaryrefslogtreecommitdiff
path: root/debian/rules
blob: 258a059a49531cc24d79c87882a757a69aad7a0a (plain)
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
#!/usr/bin/make -f

APL_CONFIGURE_FULL = \
 --with-erlang \
 --with-gtk3 \
 --with-libapl \
 --with-pcre \
 --without-python \
 --without-postgresql \
 --without-sqlite3 \

%:
	dh $@

override_dh_auto_configure:
	dh_auto_configure -- $(APL_CONFIGURE_FULL) --libdir=/usr/lib

override_dh_missing:
	dh_missing --list-missing

override_dh_auto_clean:
	dh_auto_clean
	rm -f \
		makefile.h \
		src/Gtk/Gtk_events1.asciidoc \
		src/Gtk/Gtk_events2.asciidoc \
		src/Gtk/Gtk_functions.asciidoc \
		workspaces/Makefile

PACKAGE      := apl
SVN_REPO     := http://svn.savannah.gnu.org/svn/apl/trunk
DEBIAN_PATH  := $(abspath $(dir $(firstword $(MAKEFILE_LIST))))
SRC_VERSION  := $(shell dpkg-parsechangelog -l$(DEBIAN_PATH)/changelog | awk '/^Version:/ {sub(/-[^-]*/, "", $$2); print $$2}')
SVN_REVISION := $(shell echo $(SRC_VERSION) | sed -r 's,.+svn\.([0-9]+).*,\1,')
TARBALL      := $(PACKAGE)_$(SRC_VERSION).orig.tar.xz
DELETE := \
	aclocal.m4 autom4te.cache build config.guess config.h \
	config.rpath config.status config.sub configure debian depcomp \
	libtool ltmain.sh Makefile missing stamp-h1
.PHONY: get-orig-source
get-orig-source:
	rm -rf get-orig-source $(TARBALL) && mkdir get-orig-source
	svn export -r $(SVN_REVISION) $(SVN_REPO) get-orig-source/$(PACKAGE)-$(SRC_VERSION)
	find get-orig-source/$(PACKAGE)-$(SRC_VERSION) -name '.*' -print0 | xargs -0 --no-run-if-empty rm -rfv
	cd get-orig-source/$(PACKAGE)-$(SRC_VERSION) && \
		rm -rfv $(DELETE) && \
		echo '#define BUILDTAG PACKAGE_NAME, "$(SRC_VERSION)"' > buildtag.hh && \
		echo '#define ARCHIVE_SVN "$(SVN_REVISION)"' >> buildtag.hh
	tar cJf $(TARBALL) -C get-orig-source $(PACKAGE)-$(SRC_VERSION)
	rm -rf get-orig-source
	@echo "  "$(TARBALL)" created; move it to the right destination to build the package"