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
|
#!/usr/bin/make -f
# Uncomment this to turn on verbose mode.
# export DH_VERBOSE=1
# FIXME:
# Gentoo report a bug that parallel builds don't work. subst -j 1.
# magic debhelper rule
%:
dh $@ --sourcedirectory=src
DESTDIR:=`pwd`/debian/tmp/
DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH)
LIBDIR:=/usr/lib/$(DEB_HOST_MULTIARCH)
export FC=gfortran
export CC=gcc
export NEQN="neqn -Tutf8"
# Path for runtime files, during build-time. Use this to avoid putting build path in fortc exe
export FORTC_LIBPATH=$(CURDIR)/src/port/fortc
override_dh_auto_configure:
cd src && ./configure --prefix=/usr FC="$(FC)" CC="$(CC)" NEQN=$(NEQN) \
CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" CPPFLAGS="$(CPPFLAGS)"
override_dh_auto_build:
# build process uses libs in their _installed_ location, so we need these:
mkdir -p $(DESTDIR)/$(LIBDIR) $(DESTDIR)/usr/bin $(DESTDIR)/usr/include
$(MAKE) -j1 -C src all DESTDIR=$(DESTDIR)
# And for multi-arch ...
sed -e 's@LIBDIR@$(LIBDIR)@' < debian/xgks.pc.in > debian/xgks.pc
override_dh_auto_install:
$(MAKE) -j1 -C src install DESTDIR=$(DESTDIR)
$(MAKE) -j1 -C src/progs install DESTDIR=$(DESTDIR)
$(MAKE) -j1 -C src/port/fortc install DESTDIR=$(DESTDIR)
$(MAKE) -j1 -C src/port/misc install DESTDIR=$(DESTDIR)
dh_auto_install
mkdir -p debian/libxgks2/$(LIBDIR)
mkdir -p debian/libxgks-dev/$(LIBDIR)/pkgconfig
cp src/lib/c/libxgks.so* src/port/misc/libudport.so* debian/libxgks2/$(LIBDIR)
cp debian/tmp/usr/lib/*.a debian/libxgks-dev/$(LIBDIR)
cp debian/xgks.pc debian/libxgks-dev/$(LIBDIR)/pkgconfig
dh_link -p libxgks2 $(LIBDIR)/libxgks.so.2.6 $(LIBDIR)/libxgks.so.2
dh_link -p libxgks2 $(LIBDIR)/libudport.so.2.6 $(LIBDIR)/libudport.so.2
dh_link -p libxgks-dev $(LIBDIR)/libxgks.so.2.6 $(LIBDIR)/libxgks.so
dh_link -p libxgks-dev $(LIBDIR)/libudport.so.2.6 $(LIBDIR)/libudport.so
override_dh_auto_test:
@echo "Testing disabled as tests are interactive"
override_dh_clean:
[ -f src/Makefile ] && $(MAKE) -C src clean || echo "Makefile not present"
rm -f src/lib/c/mkerrmsg
rm -f debian/xgks.pc src/doc/xgks.3
rm -f src/doc/binding/Makefile src/doc/userdoc/Makefile src/lib/c/gksm/Makefile
dh_clean
|