]> www.ginac.de Git - ginac.git/blobdiff - debian/rules
- added structure template
[ginac.git] / debian / rules
index b3856a320e46f5be2978c6150e2a40bf54b5195c..a6d80b1937391037d2704a659c36c62c91522f25 100755 (executable)
@@ -1,53 +1,85 @@
 #!/usr/bin/make -f
 
-package=ginac
+# Uncomment this to turn on verbose mode.
+#export DH_VERBOSE=1
 
-version=$(shell expr `pwd` : '.*-\([0-9.]*\)')
-version_major=$(shell expr `pwd` : '.*-\([0-9]*\).[0-9.]*')
+# This is the debhelper compatability version to use.
+export DH_COMPAT=4
+# This has to be exported to make some magic below work.
+export DH_OPTIONS
 
-build:
+# These are used for cross-compiling and for saving the configure script
+# from having to guess our platform (since we know it already)
+DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
+
+
+ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
+       export CXXFLAGS = -O0
+else
+       export CXXFLAGS = -O2 -fomit-frame-pointer -finline-limit=1200
+endif
+ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
+       INSTALL_PROGRAM += -s
+endif
+
+config.status: configure
        dh_testdir
-       ./configure --prefix=/usr
-       $(MAKE) CXXFLAGS="-O2"
-       touch build
+       # Add here commands to configure the package.
+       ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info
+
+build: build-arch
+
+build-arch: build-arch-stamp
+build-arch-stamp:  config.status
+       # Add here commands to compile the arch part of the package.
+       $(MAKE) prefix=$(CURDIR)/debian/tmp/usr infodir=$(CURDIR)/debian/tmp/usr/share/info mandir=$(CURDIR)/debian/tmp/usr/share/man
 
 clean:
        dh_testdir
-       dh_clean
-       -rm -f build
+       dh_testroot
+       rm -f build-arch-stamp config-stamp
        -$(MAKE) distclean
-       -rm -f `find . -name "*~"`
-       -rm -rf debian/tmp `find debian/* -type d ! -name CVS` debian/files* core
-       -rm -f debian/*substvars
+       dh_clean
 
-binary-indep: build
+install: install-arch
+install-arch:
        dh_testdir
        dh_testroot
+       dh_clean -k -a
+       dh_installdirs -a
+       # Add here commands to install the arch part of the package into 
+       # debian/tmp.
+       $(MAKE) install prefix=$(CURDIR)/debian/tmp/usr
+       mkdir -p $(CURDIR)/debian/tmp/usr/X11R6/include/X11/pixmaps
+       cp $(CURDIR)/debian/ginac.xpm $(CURDIR)/debian/tmp/usr/X11R6/include/X11/pixmaps/
 
-binary-arch: build
+# Must not depend on anything. This is to be called by
+# binary-arch/binary-multi
+# in another 'make' thread.
+binary-common:
        dh_testdir
        dh_testroot
-       dh_installdirs
-       # When is Automake going to honor FHS?
-       $(MAKE) install prefix=`pwd`/debian/tmp/usr infodir=`pwd`/debian/tmp/usr/share/info mandir=`pwd`/debian/tmp/usr/share/man
-       # Automake generated Makefile.in do install-info, which is bad for us:
-       -rm -f `pwd`/debian/tmp/usr/share/info/dir*
-       dh_installdocs ChangeLog NEWS README
-       dh_installchangelogs
+       dh_installdocs
        dh_installmenu
-       mkdir -p `pwd`/debian/tmp/usr/X11R6/include/X11/pixmaps
-       cp `pwd`/debian/ginac.xpm `pwd`/debian/tmp/usr/X11R6/include/X11/pixmaps/
+       dh_installman
+       dh_installinfo
+       dh_installchangelogs ChangeLog
        dh_movefiles
+       dh_link
        dh_strip
        dh_compress
        dh_fixperms
        dh_makeshlibs
-       dh_installdeb
-       dh_shlibdeps
+       dh_shlibdeps --libpackage=libginac1.1 -l debian/libginac1.1/usr/lib
        dh_gencontrol
+       dh_installdeb
        dh_md5sums
        dh_builddeb
 
-binary: binary-indep binary-arch
+# Build architecture dependant packages using the common target.
+binary-arch: build-arch install-arch
+       $(MAKE) -f debian/rules DH_OPTIONS=-a binary-common
 
-.PHONY: binary binary-arch binary-indep clean
+binary: binary-arch
+.PHONY: build clean binary-arch binary install install-arch