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
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
|
#!/usr/bin/make -f
DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk
include /usr/share/dpkg/architecture.mk
export DH_VERBOSE = 1
# make clean does not clean properly, so building out of source
BUILD = $(CURDIR)/build-tree
LDFLAGS += -Wl,--as-needed
LISP := sbcl
oa_libdir := /usr/lib/open-axiom
PACKAGE := open-axiom
GIT_REPO := https://github.com/GabrielDosReis/open-axiom.git
DEBIAN_PATH := $(abspath $(dir $(firstword $(MAKEFILE_LIST))))
SRC_VERSION := $(shell dpkg-parsechangelog -l$(DEBIAN_PATH)/changelog | awk '/^Version:/ {sub(/-[^-]*/, "", $$2); print $$2}')
GIT_REVISION := $(shell echo $(SRC_VERSION) | sed -r 's,.+git\.(\w+).*,\1,')
TARBALL := $(PACKAGE)_$(SRC_VERSION).orig.tar.xz
DELETE = \
contrib/windows-installer \
.PHONY: get-orig-source
get-orig-source:
rm -rf get-orig-source $(TARBALL) && mkdir get-orig-source
git clone $(GIT_REPO) get-orig-source/$(PACKAGE)-$(SRC_VERSION)
git -C get-orig-source/$(PACKAGE)-$(SRC_VERSION) checkout $(GIT_REVISION)
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)
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"
debian/open-axiom.1: build-stamp
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 > $@
configure-stamp:
dh_testdir
$(LISP) --version </dev/null || true
dh_auto_configure -B $(BUILD) -- \
--with-lisp=$(LISP) \
--with-x
touch $@
build: build-arch build-indep
build-arch: build-stamp
build-indep: build-stamp
build-stamp: configure-stamp
dh_testdir
cd $(BUILD) && $(MAKE) \
open_axiom_installdir=$(oa_libdir)
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
cd $(BUILD) && $(MAKE) check
endif
touch $@
install: install-stamp
install-stamp: build-stamp
dh_testdir
dh_testroot
dh_prep
dh_auto_install -B $(BUILD) -- \
oa_installdir=$(oa_libdir)
touch $@
binary: binary-arch binary-indep
binary-indep: install
binary-arch: install debian/open-axiom.1
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
dh_install -p open-axiom usr/lib/open-axiom/interp/*.fasl
# 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
find debian/open-axiom -type f -name \*.fasl -exec \
sed -i '/^#!/ d; /compiled/ d' {} \;
else ifeq ($(LISP), clisp)
dh_install -p open-axiom usr/lib/open-axiom/lib/libopen-axiom-core.so
dh_install -p open-axiom usr/lib/open-axiom/algebra/*.fas
dh_install -p open-axiom usr/lib/open-axiom/interp/*.fas
else ifeq ($(LISP), gcl)
dh_install -p open-axiom usr/lib/open-axiom/algebra/*.o
endif
dh_install
dh_installman
dh_installdocs
dh_installexamples
dh_installchangelogs
dh_installmenu
dh_link
# AXIOMsys seems already stripped, and dh_strip breaks it:
dh_strip -X AXIOMsys
dh_compress
dh_fixperms
dh_makeshlibs
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_buildinfo
dh_lintian
dh_md5sums
dh_builddeb
clean:
dh_testdir
rm -rf $(BUILD)
dh_clean
|