summaryrefslogtreecommitdiff
path: root/debian/rules
blob: 846dadd35008b08bfe17aa8872d02ad917e5c523 (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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
#!/usr/bin/make -f

DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH)

# List of archs currently having SBCL
# Keep build-deb on sbcl in one line: sbcl (...) [...],
HAVE_SBCL := $(shell grep sbcl debian/control | sed -r 's,.*\[(.+)\].*,\1,')

ifneq ($(filter $(DEB_HOST_ARCH), $(HAVE_SBCL)),)
LISP := sbcl
else
LISP := gcl
endif


PACKAGE = open-axiom
SVN_REPO = https://open-axiom.svn.sf.net/svnroot/open-axiom/trunk
SRC_VERSION  := $(shell dpkg-parsechangelog | sed -ne 's/^Version: \(\([0-9]\+\):\)\?\(.*\)-.*/\3/p')
SVN_REVISION := $(shell echo $(SRC_VERSION) | awk -F"+" '{ print $$2 }' | sed 's/svn~//' )
TARBALL       = $(PACKAGE)_$(SRC_VERSION).orig.tar.gz
.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).orig
	GZIP='--best --no-name' \
		 tar czf $(TARBALL) -C get-orig-source \
		 $(PACKAGE)-$(SRC_VERSION).orig
	@rm -rf get-orig-source
	@echo "  "$(TARBALL)" created; move it to the right destination to build the package"

debian/open-axiom.1:
	help2man --no-info \
		--version-string='$(SRC_VERSION)' \
		-m 'The open scientific computation platform' \
		-n 'open source platform for symbolic, algebraic, and numerical computations' \
		$(BUILD)/src/driver/open-axiom > $@

# make clean does not clean properly
# so building out of source
BUILD = $(CURDIR)/build-tree

LDFLAGS = -Wl,--as-needed


# --disable-gcl is for included GCL:
override_dh_auto_configure:
	dh_auto_configure -B $(BUILD) -- \
		--with-lisp=$(LISP) \
		--with-x \
		--disable-gcl \
		LDFLAGS="$(LDFLAGS)"

# Remove shebangs and "compiled from ..." lines.
# This makes lintian happy and prevents disclosure
# of paths on build machine. E. g.:
## !$(BUILD)/src/interp/interpsys --script
## FASL
#   compiled from "$(BUILD)/src/algebra/IDECOMP.NRLIB/code.lsp"
#   using SBCL version 1.0.50.0.debian
#
override_dh_auto_install:
	dh_auto_install
	find debian/tmp -type f -name \*.fasl -exec \
		sed -i '/^#!/ d; /compiled/ d' {} \;

override_dh_auto_clean:
	rm -rf $(BUILD)

override_dh_install:
ifeq ($(LISP), sbcl)
	dh_install -p open-axiom  usr/lib/open-axiom/lib/libopen-axiom-core.so
	dh_install -p open-axiom  usr/lib/open-axiom/algebra/*.fasl
else
	dh_install -p open-axiom  usr/lib/open-axiom/algebra/*.o
endif
	dh_install

override_dh_installman: debian/open-axiom.1
	dh_installman

# AXIOMsys seems already stripped, and dh_strip breaks it:
override_dh_strip:
	dh_strip -X AXIOMsys

override_dh_installdocs:
	dh_installdocs -p open-axiom-graphics --link-doc=open-axiom
	dh_installdocs -p open-axiom-test     --link-doc=open-axiom
	dh_installdocs -p open-axiom-hypertex --link-doc=open-axiom
	dh_installdocs --remaining-packages

clean build build-arch build-indep install binary binary-arch binary-indep:
	dh $@ --builddir=$(BUILD)