#!/usr/bin/make -f # make clean does not clean properly, so building out of source BUILD = $(CURDIR)/build-tree LDFLAGS = -Wl,--as-needed 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 := svn://svn.code.sf.net/p/open-axiom/code/trunk SRC_VERSION := $(shell dpkg-parsechangelog | 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.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) GZIP='--best --no-name' \ tar czf $(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 > $@ # --disable-gcl is for included GCL: configure-stamp: dh_testdir dh_auto_configure -B $(BUILD) -- \ --with-lisp=$(LISP) \ --with-x \ --disable-gcl \ LDFLAGS="$(LDFLAGS)" touch $@ build: build-arch build-indep build-arch: build-stamp build-indep: build-stamp build-stamp: configure-stamp dh_testdir cd $(BUILD) && $(MAKE) 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) 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 # 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 dh_install -p open-axiom usr/lib/open-axiom/algebra/*.o endif dh_install dh_installman 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 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_md5sums dh_builddeb clean: dh_testdir dh_testroot rm -rf $(BUILD) rm -f install-stamp build-stamp configure-stamp dh_clean