#!/usr/bin/make -f # Sample debian/rules that uses debhelper. # GNU copyright 1997 to 1999 by Joey Hess. # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 -include /usr/share/dpkg/buildtools.mk include /usr/share/dpkg/buildflags.mk export DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) headers = err.h machine.h matrix.h meminfo.h sparse.h zmatrix.h \ iter.h matlab.h matrix2.h oldnames.h sparse2.h zmatrix2.h torm = macheps maxint torture sptort ztorture meschach.a libmeschach.a # shared library versions, option 1 version=1.2 major=$(shell expr `echo $(version)` : '\([0-9]*\).[0-9.]*') # option 2, assuming the library is created as src/.libs/libfoo.so.2.0.5 or so #version=`ls src/.libs/lib*.so.* | \ # awk '{if (match($$0,/[0-9]+\.[0-9]+\.[0-9]+$$/)) print substr($$0,RSTART)}'` #major=`ls src/.libs/lib*.so.* | \ # awk '{if (match($$0,/\.so\.[0-9]+$$/)) print substr($$0,RSTART+4)}'` %: dh $@ execute_after_dh_clean: rm -f config.log override_dh_autoreconf: echo "meschach is not maintained upstream" echo "configure.in no longer functions, so we must skip autoreconf" override_dh_auto_configure: ./configure --prefix=/usr --mandir=\$${prefix}/share/man --with-all override_dh_auto_build: $(MAKE) vers=$(version) CC=$(CC) CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS) -O3 -fPIC -D_REENTRANT" shared $(MAKE) clean $(MAKE) vers=$(version) CC=$(CC) CPPFLAGS="$(CPPFLAGS)" CFLAGS="$(CFLAGS) -O3 -D_REENTRANT" static override_dh_auto_install-arch: install -d debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/ cp libmeschach.so debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libmeschach.so.$(version) ln -s libmeschach.so.$(version) debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libmeschach.so.$(major) ln -s libmeschach.so.$(version) debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libmeschach.so cp libmeschach.a debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/libmeschach.a install -d debian/tmp/usr/include/meschach cp $(headers) debian/tmp/usr/include/meschach