[petsc] 01/02: update build to use debhelper (dh) 9
Drew Parsons
dparsons at moszumanska.debian.org
Wed Sep 30 10:23:36 UTC 2015
This is an automated email from the git hooks/post-receive script.
dparsons pushed a commit to branch master
in repository petsc.
commit dcce37fe7615b8764ef6c340bca436623bceeb41
Author: Drew Parsons <dparsons at debian.org>
Date: Wed Sep 30 17:07:55 2015 +0800
update build to use debhelper (dh) 9
Allows for a simpler debian/rules.
Upstream provides "make install" for installing the required files to
a destination directory, cf.
http://www.mcs.anl.gov/petsc/documentation/installation.html#packagemanagers
---
debian/compat | 2 +-
debian/control | 2 +-
debian/rules | 475 +++++++++------------------------------------------------
3 files changed, 77 insertions(+), 402 deletions(-)
diff --git a/debian/compat b/debian/compat
index 7f8f011..ec63514 100644
--- a/debian/compat
+++ b/debian/compat
@@ -1 +1 @@
-7
+9
diff --git a/debian/control b/debian/control
index e6f4093..d0334b3 100644
--- a/debian/control
+++ b/debian/control
@@ -4,7 +4,7 @@ Priority: extra
Maintainer: Debian Science Maintainers <debian-science-maintainers at lists.alioth.debian.org>
Uploaders: "Adam C. Powell, IV" <hazelsct at debian.org>, Drew Parsons <dparsons at debian.org>
Standards-Version: 3.9.5
-Build-Depends: debhelper (>= 7.0.50), quilt, python (>= 2.2), gfortran, autotools-dev,
+Build-Depends: debhelper (>= 9), quilt, python (>= 2.2), gfortran, autotools-dev,
libx11-dev, mpi-default-dev (>= 1.0.2),
libblas-dev, liblapack-dev,
libsuitesparse-dev (>= 1:4.2.1),
diff --git a/debian/rules b/debian/rules
index ed3f214..fdaa538 100755
--- a/debian/rules
+++ b/debian/rules
@@ -1,27 +1,30 @@
#!/usr/bin/make -f
-# Sample debian/rules file - for GNU Hello (1.3).
-# Copyright 1994,1995 by Ian Jackson.
-# I hereby give you perpetual unlimited permission to copy,
-# modify and relicense this file, provided that you do not remove
-# my name from the file itself. (I assert my moral right of
-# paternity under the Copyright, Designs and Patents Act 1988.)
-# This file may have to be extensively modified
+# See debhelper(7) (uncomment to enable)
+# output every command that modifies files on the build system.
+#export DH_VERBOSE = 1
-DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+# see EXAMPLES in dpkg-buildflags(1) and read /usr/share/dpkg/*
+DPKG_EXPORT_BUILDFLAGS = 1
+include /usr/share/dpkg/default.mk
-# Uncomment this to turn on verbose mode.
-#export DH_VERBOSE=1
+# see FEATURE AREAS in dpkg-buildflags(1)
+#export DEB_BUILD_MAINT_OPTIONS = hardening=+all
-# This is the debhelper compatability version to use.
-#export DH_COMPAT=4
-# Deprecated, now provided in file debian/compat
+# see ENVIRONMENT in dpkg-buildflags(1)
+# package maintainers to append CFLAGS
+#export DEB_CFLAGS_MAINT_APPEND = -Wall -pedantic
+# package maintainers to append LDFLAGS
+#export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
+
+DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
+DEB_BUILD_GNU_SYSTEM ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_SYSTEM)
+DEB_BUILD_MULTIARCH ?= $(shell dpkg-architecture -qDEB_BUILD_MULTIARCH)
# On Alpha, override this with debian/rules PETSC_ARCH=linux_alpha_dec binary
# to build PETSc libs with the Compaq compilers, though that requires at least:
# libots, cpml-ev(5|6), cxml-ev(5|6), cfal and ccc.
# Note that only arch-dependent .debs are generated when you do this.
-DEB_BUILD_GNU_SYSTEM ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_SYSTEM)
-PETSC_ARCH=$(DEB_BUILD_GNU_SYSTEM)
+PETSC_ARCH=$(DEB_BUILD_MULTIARCH)
# This defines the MPI implementation to use. The easiest way to override this
# default is to specify while building, e.g. debian/rules PETSC_MPI=lam binary.
@@ -33,16 +36,10 @@ include /usr/share/mpi-default-dev/debian_defaults
PETSC_MPI=$(ARCH_DEFAULT_MPI_IMPL)
PETSC_MPI_DIR=/usr/lib/$(PETSC_MPI)
-# Overriding this with "contrib" attempts to link with parmetis (unimplemented).
-DEBIAN_DIST=main
-
-# PETSC_EXT is non-empty if a non-standard compiler (e.g. Compaq compilers on
-# alpha), non-standard MPI implementation (e.g. lam), non-standard option (e.g.
-# complex) or non-standard distribution (e.g. contrib) is being used.
-PETSC_EXT=$(shell chmod +x debian/petsc-ext && debian/petsc-ext $(PETSC_ARCH) $(PETSC_MPI) $(DEBIAN_DIST) && chmod -x debian/petsc-ext)
-
PETSC_HDF5_FLAGS=$(shell if [ -e /usr/lib/libhdf5.so ]; then echo "--with-hdf5=1 --with-hdf5-dir=/usr"; fi)
-PETSC_BABEL_FLAGS=$(shell if [ -e /usr/lib/libsidl.so ]; then echo "--with-babel=1 --with-babel-dir=/usr"; fi)
+
+PETSC_BUILD_DIR=$(PETSC_ARCH)-cxx-opt
+PETSC_DEBUG_BUILD_DIR=$(PETSC_ARCH)-cxx-debug
# PETSC_VERSION is used for the package names, library sonames, and
# /usr/lib/petscdir subdirectory names.
@@ -51,48 +48,14 @@ PETSC_VERSION=3.6.1$(PETSC_EXT)
# PETSC_NAME is the install dir under /usr/lib and the base for package names
PETSC_NAME=petsc$(PETSC_VERSION)
-# These files need to be customized based on architecture and/or version.
-# See the binary arch target for how they are generated.
-ARCH_GENERATED_FILES=debian/lib$(PETSC_NAME)-dev.docs \
- debian/lib$(PETSC_NAME)-dev.postinst debian/lib$(PETSC_NAME)-dev.prerm
+PACKAGE_INSTALL_DIR=debian/tmp/$(PETSC_NAME)
+PACKAGE_DEBUG_INSTALL_DIR=debian/tmp/$(PETSC_NAME)-dbg
-clean:
- dh_testdir
- if [ -f TAGS.backup ]; then mv -f TAGS.backup TAGS; fi
- dh_quilt_unpatch
- dh_clean -XTAGS
-# These are needed for -lam, -dec and -contrib builds
- -rm -rf debian/lib$(PETSC_NAME) debian/lib$(PETSC_NAME)-dev \
- debian/lib$(PETSC_NAME)-dbg
- -rm -f build* install* debian/*.substvars debian/extemp $(ARCH_GENERATED_FILES)
-# This is commented because it really doesn't do anything useful for us
-# (removes example executables, so what?)
-# make PETSC_ARCH=$(PETSC_ARCH) PETSC_DIR=$(CURDIR) clean
-# These probably should be removed by `make clean' but aren't
- -rm -f RDict.log RDict.db configure.log.bkp debian/control.in make.log \
- confdefs.h conffix.h conftest.c lib1.so lib2.so CMakeLists.txt
- -rm -f config/BuildSystem/config/packages/config.* conf/petscvariables
- -rm -f `find . -name \*.o -print` `find . -name \*.pyc -print`
- -rm -rf $(PETSC_ARCH)-c-debug $(PETSC_ARCH)-c-opt configure.log
-# PETSc uses the "doctext" program to convert html docs to man pages, which
-# apparently is open-source and available from
-# http://www.mcs.anl.gov/~gropp/sowing . When it is Debianized, I'll use it.
-build-indep:
- dh_quilt_patch
-# $(MAKE) -C docs PETSC_ARCH=$(PETSC_ARCH) \
-# PETSC_DIR=$(CURDIR)/lib$(PETSC_NAME) manualpages
- touch $@
+PETSC_DIR_PREFIX=/usr/lib/petscdir/$(PETSC_VERSION)/$(PETSC_ARCH)-cxx-opt
+PETSC_DIR_DEBUG_PREFIX=/usr/lib/petscdir/$(PETSC_VERSION)/$(PETSC_ARCH)-cxx-debug
-# With debugging=1, only static libraries are generated.
-# Build optimized libs second so files are consistent with optimized.
-build-arch:
- dh_quilt_patch
- echo Using MPI implementation $(PETSC_MPI) in directory $(PETSC_MPI_DIR)
- cp -fp /usr/share/misc/config.* config/BuildSystem/config/packages/
- if [ ! -f TAGS.backup ]; then cp -a TAGS TAGS.backup; fi
- PETSC_DIR=$(CURDIR) PETSC_ARCH=$(PETSC_ARCH)-c-debug \
- ./config/configure.py --with-shared-libraries --with-debugging=1 \
+CONFIGURATION_OPTIONS=--with-shared-libraries \
--useThreads 0 --with-clanguage=C++ --with-c-support \
--with-fortran-interfaces=1 \
--with-mpi-dir=$(PETSC_MPI_DIR) \
@@ -113,351 +76,63 @@ build-arch:
--with-fftw=1 --with-fftw-include=/usr/include \
--with-fftw-lib=[/usr/lib/$(DEB_HOST_GNU_TYPE)/libfftw3.so,/usr/lib/$(DEB_HOST_GNU_TYPE)/libfftw3_mpi.so] \
$(PETSC_HDF5_FLAGS) --CXX_LINKER_FLAGS="-Wl,--no-as-needed"
-# --with-pastix=1 --with-pastix-include=/usr/include/pastix \
-# --with-pastix-lib=[/usr/lib/libpastix.so] \
-# --with-superlu=1 --with-superlu-include=/usr/include/superlu \
-# --with-superlu-lib=/usr/lib/libsuperlu.so \
-# --with-sprng=1 --with-sprng-include=/usr/include/sprng \
-# --with-sprng-lib=/usr/lib/libsprng.so
-# $(PETSC_BABEL_FLAGS)
- $(MAKE) PETSC_ARCH=$(PETSC_ARCH)-c-debug PETSC_DIR=$(CURDIR) \
- PETSC_INSTALL_DIR=/usr/lib/petscdir/$(PETSC_VERSION) \
- SL_LINKER_SUFFIX_VERSIONED="so.$(PETSC_VERSION)" all-legacy
- PETSC_DIR=$(CURDIR) PETSC_ARCH=$(PETSC_ARCH)-c-opt \
- ./config/configure.py --with-shared-libraries --with-debugging=0 \
- --useThreads 0 --with-clanguage=C++ --with-c-support \
- --with-fortran-interfaces=1 \
- --with-mpi-dir=$(PETSC_MPI_DIR) --with-mpi-shared=1 \
- --with-blas-lib=-lblas --with-lapack-lib=-llapack \
- --with-blacs=1 --with-blacs-include=/usr/include \
- --with-blacs-lib=[/usr/lib/libblacsCinit-$(PETSC_MPI).so,/usr/lib/libblacs-$(PETSC_MPI).so] \
- --with-scalapack=1 --with-scalapack-include=/usr/include \
- --with-scalapack-lib=/usr/lib/libscalapack-$(PETSC_MPI).so \
- --with-mumps=1 --with-mumps-include=/usr/include \
- --with-mumps-lib=[/usr/lib/libdmumps.so,/usr/lib/libzmumps.so,/usr/lib/libsmumps.so,/usr/lib/libcmumps.so,/usr/lib/libmumps_common.so,/usr/lib/libpord.so] \
- --with-suitesparse=1 --with-suitesparse-include=/usr/include/suitesparse \
- --with-suitesparse-lib="-lumfpack -lamd -lcholmod -lklu" \
- --with-spooles=1 --with-spooles-include=/usr/include/spooles \
- --with-spooles-lib=/usr/lib/libspooles.so \
- --with-hypre=1 --with-hypre-dir=/usr \
- --with-ptscotch=1 --with-ptscotch-include=/usr/include/scotch \
- --with-ptscotch-lib=[/usr/lib/libptesmumps.so,/usr/lib/libptscotch.so,/usr/lib/libptscotcherr.so] \
- --with-fftw=1 --with-fftw-include=/usr/include \
- --with-fftw-lib=[/usr/lib/$(DEB_HOST_GNU_TYPE)/libfftw3.so,/usr/lib/$(DEB_HOST_GNU_TYPE)/libfftw3_mpi.so] \
- $(PETSC_HDF5_FLAGS) --CXX_LINKER_FLAGS="-Wl,--no-as-needed"
-# --with-pastix=1 --with-pastix-include=/usr/include/pastix \
-# --with-pastix-lib=[/usr/lib/libpastix.so] \
-# --with-superlu=1 --with-superlu-include=/usr/include/superlu \
-# --with-superlu-lib=/usr/lib/libsuperlu.so \
-# --with-sprng=1 --with-sprng-include=/usr/include/sprng \
-# --with-sprng-lib=/usr/lib/libsprng.so
-# $(PETSC_BABEL_FLAGS)
- $(MAKE) PETSC_ARCH=$(PETSC_ARCH)-c-opt PETSC_DIR=$(CURDIR) \
- PETSC_INSTALL_DIR=/usr/lib/petscdir/$(PETSC_VERSION) \
- SL_LINKER_SUFFIX_VERSIONED="so.$(PETSC_VERSION)" all-legacy
- touch $@
-
-build: build-arch build-indep
- touch $@
-
-install-arch: build-arch
-# Install mpirun.lam and fake petscarch in PETSC_DIR/bin and manpages.
-# If someone builds with non-standard PETSC_ARCH we want that to be
-# reflected in the installed script (also removes c-shell dependence).
- install -d debian/lib$(PETSC_NAME)-dev/usr/lib/petscdir/$(PETSC_VERSION)/bin
- cp -p debian/mpirun_lam \
- debian/lib$(PETSC_NAME)-dev/usr/lib/petscdir/$(PETSC_VERSION)/bin/mpirun_lam
- chmod +x debian/lib$(PETSC_NAME)-dev/usr/lib/petscdir/$(PETSC_VERSION)/bin/mpirun_lam
- echo "#!/bin/sh -e" > \
- debian/lib$(PETSC_NAME)-dev/usr/lib/petscdir/$(PETSC_VERSION)/bin/petscarch
- echo "echo $(PETSC_ARCH)-c-opt" >> \
- debian/lib$(PETSC_NAME)-dev/usr/lib/petscdir/$(PETSC_VERSION)/bin/petscarch
- chmod +x debian/lib$(PETSC_NAME)-dev/usr/lib/petscdir/$(PETSC_VERSION)/bin/petscarch
-# I know bin is an awkward place to put these, but can't think of a
-# better one... (doc is a symlink in the -doc package)
- cp -p debian/petscarch.1 debian/mpirun_lam.1 \
- debian/lib$(PETSC_NAME)-dev/usr/lib/petscdir/$(PETSC_VERSION)/bin
- gzip --best debian/lib$(PETSC_NAME)-dev/usr/lib/petscdir/$(PETSC_VERSION)/bin/*.1
-# Install conf in PETSC_DIR
- install -d debian/lib$(PETSC_NAME)-dev/usr/lib/petscdir/$(PETSC_VERSION)/conf
- for cfile in `ls conf`; do \
- grep -v top_builddir conf/$$cfile | \
- sed "s/`echo $(CURDIR) | sed s/\\\\//\\\\\\\\\\\\//g`/\/usr\/lib\/petscdir\/$(PETSC_VERSION)/g" > \
- debian/lib$(PETSC_NAME)-dev/usr/lib/petscdir/$(PETSC_VERSION)/conf/$$cfile ; \
- done
-# Install PETSC_ARCH/conf and PETSC_ARCH/include files in PETSC_DIR/PETSC_ARCH/;
-# replace this dir with install dir, and remove top_builddir
- install -d debian/lib$(PETSC_NAME)-dev/usr/lib/petscdir/$(PETSC_VERSION)/$(PETSC_ARCH)-c-opt/conf
- ln -s $(PETSC_ARCH)-c-opt debian/lib$(PETSC_NAME)-dev/usr/lib/petscdir/$(PETSC_VERSION)/$(PETSC_ARCH)-cxx-opt
- for cfile in `ls $(PETSC_ARCH)-c-opt/conf`; do \
- grep -v top_builddir $(PETSC_ARCH)-c-opt/conf/$$cfile | \
- sed "s/`echo $(CURDIR) | sed s/\\\\//\\\\\\\\\\\\//g`/\/usr\/lib\/petscdir\/$(PETSC_VERSION)/g" > \
- debian/lib$(PETSC_NAME)-dev/usr/lib/petscdir/$(PETSC_VERSION)/$(PETSC_ARCH)-c-opt/conf/$$cfile ; \
- done
- rm -f debian/lib$(PETSC_NAME)-dev/usr/lib/petscdir/$(PETSC_VERSION)/$(PETSC_ARCH)-c-opt/conf/*.py
- cp -a $(PETSC_ARCH)-c-opt/include debian/lib$(PETSC_NAME)-dev/usr/lib/petscdir/$(PETSC_VERSION)/$(PETSC_ARCH)-c-opt/
-# Now conf and include for the -dbg package
- install -d debian/lib$(PETSC_NAME)-dbg/usr/lib/petscdir/$(PETSC_VERSION)/$(PETSC_ARCH)-c-debug/conf
- ln -s $(PETSC_ARCH)-c-debug debian/lib$(PETSC_NAME)-dbg/usr/lib/petscdir/$(PETSC_VERSION)/$(PETSC_ARCH)-cxx-debug
- for cfile in `ls $(PETSC_ARCH)-c-debug/conf`; do \
- grep -v top_builddir $(PETSC_ARCH)-c-debug/conf/$$cfile | \
- sed "s/`echo $(CURDIR) | sed s/\\\\//\\\\\\\\\\\\//g`/\/usr\/lib\/petscdir\/$(PETSC_VERSION)/g" > \
- debian/lib$(PETSC_NAME)-dbg/usr/lib/petscdir/$(PETSC_VERSION)/$(PETSC_ARCH)-c-debug/conf/$$cfile ; \
- done
- rm -f debian/lib$(PETSC_NAME)-dbg/usr/lib/petscdir/$(PETSC_VERSION)/$(PETSC_ARCH)-c-debug/conf/*.py
- cp -a $(PETSC_ARCH)-c-debug/include debian/lib$(PETSC_NAME)-dbg/usr/lib/petscdir/$(PETSC_VERSION)/$(PETSC_ARCH)-c-debug/
-# Install headers in PETSC_DIR/include
- install -d debian/lib$(PETSC_NAME)-dev/usr/lib/petscdir/$(PETSC_VERSION)/include/petsc/finclude
- cp -p include/*.h \
- debian/lib$(PETSC_NAME)-dev/usr/lib/petscdir/$(PETSC_VERSION)/include
- cp -p include/petsc/finclude/*.h include/petsc/finclude/*.h90 \
- debian/lib$(PETSC_NAME)-dev/usr/lib/petscdir/$(PETSC_VERSION)/include/petsc/finclude
- cp -a include/petsc/finclude/ftn-auto include/petsc/finclude/ftn-custom \
- debian/lib$(PETSC_NAME)-dev/usr/lib/petscdir/$(PETSC_VERSION)/include/petsc/finclude
- install -d debian/lib$(PETSC_NAME)-dev/usr/lib/petscdir/$(PETSC_VERSION)/include/petsc/private
- cp -p include/petsc/private/*.h \
- debian/lib$(PETSC_NAME)-dev/usr/lib/petscdir/$(PETSC_VERSION)/include/petsc/private
- cd debian/lib$(PETSC_NAME)-dev/usr/lib/petscdir/$(PETSC_VERSION)/include && \
- ln -s ../$(PETSC_ARCH)-c-opt/include/*.h .
- install -d debian/lib$(PETSC_NAME)-dev/usr/lib/petscdir/$(PETSC_VERSION)/include/src/mat/impls/aij/mpi
- sed "s/..\/src/src/" < src/mat/impls/aij/mpi/mpiaij.h > \
- debian/lib$(PETSC_NAME)-dev/usr/lib/petscdir/$(PETSC_VERSION)/include/src/mat/impls/aij/mpi/mpiaij.h
- install -d debian/lib$(PETSC_NAME)-dev/usr/lib/petscdir/$(PETSC_VERSION)/include/src/mat/impls/aij/seq
- cp -p src/mat/impls/aij/seq/aij.h \
- debian/lib$(PETSC_NAME)-dev/usr/lib/petscdir/$(PETSC_VERSION)/include/src/mat/impls/aij/seq/aij.h
- install -d debian/lib$(PETSC_NAME)-dev/usr/lib/petscdir/$(PETSC_VERSION)/include/src/mat/impls/dense/mpi
- sed "s/..\/src/src/" < src/mat/impls/dense/mpi/mpidense.h > \
- debian/lib$(PETSC_NAME)-dev/usr/lib/petscdir/$(PETSC_VERSION)/include/src/mat/impls/dense/mpi/mpidense.h
- install -d debian/lib$(PETSC_NAME)-dev/usr/lib/petscdir/$(PETSC_VERSION)/include/src/mat/impls/dense/seq
- cp -p src/mat/impls/dense/seq/dense.h \
- debian/lib$(PETSC_NAME)-dev/usr/lib/petscdir/$(PETSC_VERSION)/include/src/mat/impls/dense/seq/dense.h
- install -d debian/lib$(PETSC_NAME)-dev/usr/lib/petscdir/$(PETSC_VERSION)/include/src/sys
-# Add m4 files, /usr/share/aclocal symlinks will be made by postinst
- install -d debian/lib$(PETSC_NAME)-dev/usr/lib/petscdir/$(PETSC_VERSION)/aclocal
- cp -p debian/petsc.m4 debian/lib$(PETSC_NAME)-dev/usr/lib/petscdir/$(PETSC_VERSION)/aclocal
- cp -p debian/math-blaslapack.m4 debian/lib$(PETSC_NAME)-dev/usr/lib/petscdir/$(PETSC_VERSION)/aclocal
-# Install libs in PETSC_DIR, move shared libs to /usr/lib and symlink
- install -d debian/lib$(PETSC_NAME)/usr/lib
- cp -a $(PETSC_ARCH)-c-opt/lib debian/lib$(PETSC_NAME)-dev/usr/lib/petscdir/$(PETSC_VERSION)/$(PETSC_ARCH)-c-opt/
- cp -a $(PETSC_ARCH)-c-debug/lib debian/lib$(PETSC_NAME)-dbg/usr/lib/petscdir/$(PETSC_VERSION)/$(PETSC_ARCH)-c-debug/
- for LIB in `cd $(PETSC_ARCH)-c-opt/lib && ls *.so.*` ; \
- do \
- mv debian/lib$(PETSC_NAME)-dev/usr/lib/petscdir/$(PETSC_VERSION)/$(PETSC_ARCH)-c-opt/lib/$$LIB \
- debian/lib$(PETSC_NAME)/usr/lib/$$LIB ; \
- ln -s ../../../../$$LIB \
- debian/lib$(PETSC_NAME)-dev/usr/lib/petscdir/$(PETSC_VERSION)/$(PETSC_ARCH)-c-opt/lib/$$LIB ; \
- done
-# Make legacy symlinks including C++
- install -d debian/lib$(PETSC_NAME)-dev/usr/lib/petscdir/$(PETSC_VERSION)/lib
- ln -s ../$(PETSC_ARCH)-c-opt/lib debian/lib$(PETSC_NAME)-dev/usr/lib/petscdir/$(PETSC_VERSION)/lib/libO
- ln -s ../$(PETSC_ARCH)-c-opt/lib debian/lib$(PETSC_NAME)-dev/usr/lib/petscdir/$(PETSC_VERSION)/lib/libO_c++
- install -d debian/lib$(PETSC_NAME)-dbg/usr/lib/petscdir/$(PETSC_VERSION)/lib
- ln -s ../$(PETSC_ARCH)-c-debug/lib debian/lib$(PETSC_NAME)-dbg/usr/lib/petscdir/$(PETSC_VERSION)/lib/libg
- ln -s ../$(PETSC_ARCH)-c-debug/lib debian/lib$(PETSC_NAME)-dbg/usr/lib/petscdir/$(PETSC_VERSION)/lib/libg_c++
-# Legacy symlink so packages for 3.0 can build against 3.6.1
- ln -s variables debian/lib$(PETSC_NAME)-dev/usr/lib/petscdir/$(PETSC_VERSION)/conf/base
-# Lintian overrides
- install -d debian/lib$(PETSC_NAME)/usr/share/lintian/overrides
- install -d debian/lib$(PETSC_NAME)-dev/usr/share/lintian/overrides
- install -d debian/lib$(PETSC_NAME)-dbg/usr/share/lintian/overrides
- sed "s/petsc3.6.1/$(PETSC_NAME)/" < debian/lib$(PETSC_NAME).overrides > \
- debian/lib$(PETSC_NAME)/usr/share/lintian/overrides/lib$(PETSC_NAME)
- sed "s/petsc3.6.1/$(PETSC_NAME)/" < debian/lib$(PETSC_NAME)-dev.overrides > \
- debian/lib$(PETSC_NAME)-dev/usr/share/lintian/overrides/lib$(PETSC_NAME)-dev
- sed "s/petsc3.6.1/$(PETSC_NAME)/" < debian/lib$(PETSC_NAME)-dbg.overrides > \
- debian/lib$(PETSC_NAME)-dbg/usr/share/lintian/overrides/lib$(PETSC_NAME)-dbg
- touch install-arch
-
-# Depends on install-arch because it creates PETSC_DIR
-install-indep: build-indep install-arch
-ifeq ($(PETSC_VERSION),3.6.1)
-# Install header documentation in -doc/include
- install -d debian/$(PETSC_NAME)-doc/usr/share/doc/$(PETSC_NAME)-doc/include/petsc/finclude
- cp -p include/*.html \
- debian/$(PETSC_NAME)-doc/usr/share/doc/$(PETSC_NAME)-doc/include
- cp -p include/petsc/finclude/*.html \
- debian/$(PETSC_NAME)-doc/usr/share/doc/$(PETSC_NAME)-doc/include/petsc/finclude
- install -d debian/$(PETSC_NAME)-doc/usr/share/doc/$(PETSC_NAME)-doc/include/petsc/private
- cp -p include/petsc/private/*.html \
- debian/$(PETSC_NAME)-doc/usr/share/doc/$(PETSC_NAME)-doc/include/petsc/private
- for HEADERDOC in `cd debian/$(PETSC_NAME)-doc/usr/share/doc/$(PETSC_NAME)-doc/ && find include -name \*.h.html -print | sed s/.h.html/.h/`; \
- do \
- dh_link -p$(PETSC_NAME)-doc \
- usr/lib/petscdir/$(PETSC_VERSION)/$$HEADERDOC \
- usr/share/doc/$(PETSC_NAME)-doc/$$HEADERDOC; \
- done
-# Install examples documentation in -doc/src directory
- for TESTDIR in `find src -name tests -print | sed "s/src\///"` \
- `find src -name tutorials -print | sed "s/src\///"` benchmarks \
- snes/examples/tutorials/ex10d; \
- do \
- install -d debian/$(PETSC_NAME)-doc/usr/share/doc/$(PETSC_NAME)-doc/src/$$TESTDIR; \
- for TESTDOC in `find src/$$TESTDIR -name \*.html -print`; do \
- cp -a $$TESTDOC \
- debian/$(PETSC_NAME)-doc/usr/share/doc/$(PETSC_NAME)-doc/src/$$TESTDIR; \
- done ; \
- done
-# I don't know of a way to do this "recursively"
- rmdir `find debian/petsc3.6.1-doc -empty -type d -print`
- rmdir `find debian/petsc3.6.1-doc -empty -type d -print`
- rmdir `find debian/petsc3.6.1-doc -empty -type d -print`
-# Install examples & makefiles into temporary directory debian/extemp
- for TESTDIR in `find src -name tests -print | sed "s/src\///"` \
- `find src -name tutorials -print | sed "s/src\///"` benchmarks; \
- do \
- install -d debian/extemp/src/$$TESTDIR; \
- cp -a src/$$TESTDIR/* debian/extemp/src/$$TESTDIR; \
- done
- for MAKEFILE in `find src -name makefile -print | sed "s/src\///"`; \
- do \
- if [ -d debian/extemp/src/`echo $$MAKEFILE | sed "s/makefile//"` ] ;\
- then \
- cp -p src/$$MAKEFILE debian/extemp/src/$$MAKEFILE; \
- fi; \
- done
-# Clean up documentation from debian/extemp
- rm -f `find debian/extemp -name \*.html -print`
-# HACK ALERT! This is a very inelegant way to assemble this makefile!
- rm -f debian/extemp/src/makefile
- sed "s/inline//" < src/makefile | grep -v include \
- > debian/extemp/src/makefile
- grep -v \$$Id makefile | grep -v DIRS >> debian/extemp/src/makefile
- install -d debian/extemp/src/$(PETSC_ARCH)-c-opt/conf
- cp -p debian/lib$(PETSC_NAME)-dev/usr/lib/petscdir/$(PETSC_VERSION)/conf/petscvariables \
- debian/extemp/src/$(PETSC_ARCH)-c-opt/conf/petscvariables
-# Pack debian/extemp/src into src.tar.gz and install
- cd debian/extemp && tar czf src.tar.gz src
- mv debian/extemp/src.tar.gz \
- debian/$(PETSC_NAME)-doc/usr/share/doc/$(PETSC_NAME)-doc/src.tar.gz
- rm -rf debian/extemp
-# Make links to documentation and examples from PETSC_DIR and docs
- dh_link -p$(PETSC_NAME)-doc \
- usr/share/doc/$(PETSC_NAME)-doc/docs \
- usr/lib/petscdir/$(PETSC_VERSION)/docs \
- usr/share/doc/$(PETSC_NAME)-doc/docs/index.html \
- usr/lib/petscdir/$(PETSC_VERSION)/index.html \
- usr/share/doc/$(PETSC_NAME)-doc/makefile.html \
- usr/lib/petscdir/$(PETSC_VERSION)/makefile.html \
- usr/share/doc/$(PETSC_NAME)-doc/src \
- usr/lib/petscdir/$(PETSC_VERSION)/src
-# Lintian overrides
- install -d debian/$(PETSC_NAME)-doc/usr/share/lintian/overrides
- sed "s/petsc3.6.1/$(PETSC_NAME)/" < debian/petsc3.6.1-doc.overrides > \
- debian/$(PETSC_NAME)-doc/usr/share/lintian/overrides/$(PETSC_NAME)-doc
- install -d debian/petsc-dev/usr/share/lintian/overrides
- install -m 644 debian/petsc-dev.overrides \
- debian/petsc-dev/usr/share/lintian/overrides/petsc-dev
- touch install-indep
-endif
-install: install-arch install-indep
- touch install
-binary-indep: install-indep
-ifeq ($(PETSC_VERSION),3.6.1)
- dh_testdir -i
- dh_testroot -i
- dh_installdirs -i
- dh_installdocs -i
-# Clean up and finish
- rm -f `find debian/$(PETSC_NAME)-doc -name ?akefile -print`
- rm -f `find debian/$(PETSC_NAME)-doc -name *.cit* -print`
- rm -f `find debian/$(PETSC_NAME)-doc -empty -type f -print`
- dh_installchangelogs -i docs/changes/34.html
- dh_compress -i -X.xbm -X.pdf
- dh_fixperms -i
- dh_installdeb -i
- dh_gencontrol -i
- dh_md5sums -i
- dh_builddeb -i
-endif
+# main packaging script based on dh7 syntax
+%:
+ dh $@
+
+# dh_make generated override targets
+# This is example for Cmake (See https://bugs.debian.org/641051 )
+override_dh_auto_configure:
+ dh_auto_configure -plibpetsc3.6.1-dbg -- \
+ --with-debugging=1 \
+ $(CONFIGURATION_OPTIONS) \
+ --prefix=$(PETSC_DIR_DEBUG_PREFIX) \
+ PETSC_DIR=$(CURDIR) --PETSC_ARCH=$(PETSC_DEBUG_BUILD_DIR) \
+ CFLAGS=$(CFLAGS) CXXFLAGS=$(CXXFLAGS) \
+ FCFLAGS=$(FCFLAGS) FFLAGS=$(FFLAGS) \
+ CPPFLAGS=$(CPPFLAGS) LDFLAGS=$(LDFLAGS) MAKEFLAGS=$(MAKEFLAGS)
+ dh_auto_configure -plibpetsc3.6.1 -- \
+ --with-debugging=0 \
+ $(CONFIGURATION_OPTIONS) \
+ --prefix=$(PETSC_DIR_PREFIX) \
+ PETSC_DIR=$(CURDIR) --PETSC_ARCH=$(PETSC_BUILD_DIR) \
+ CFLAGS=$(CFLAGS) CXXFLAGS=$(CXXFLAGS) \
+ FCFLAGS=$(FCFLAGS) FFLAGS=$(FFLAGS) \
+ CPPFLAGS=$(CPPFLAGS) LDFLAGS=$(LDFLAGS) MAKEFLAGS=$(MAKEFLAGS)
+
+
+override_dh_auto_build:
+ dh_auto_build -plibpetsc3.6.1-dbg -- \
+ PETSC_DIR=$(CURDIR) PETSC_ARCH=$(PETSC_DEBUG_BUILD_DIR)
+ dh_auto_build -plibpetsc3.6.1 -- \
+ PETSC_DIR=$(CURDIR) PETSC_ARCH=$(PETSC_BUILD_DIR)
+
+
+override_dh_auto_test:
+ ls -l /usr/lib/x86_64-linux-gnu/libfakeroot/
+ dh_auto_test -plibpetsc3.6.1-dbg -- \
+ PETSC_DIR=$(CURDIR) PETSC_ARCH=$(PETSC_DEBUG_BUILD_DIR) \
+ LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):$(CURDIR)/$(PETSC_DEBUG_BUILD_DIR)/lib
+ dh_auto_test -plibpetsc3.6.1 -- \
+ PETSC_DIR=$(CURDIR) PETSC_ARCH=$(PETSC_BUILD_DIR) \
+ LD_LIBRARY_PATH=$(LD_LIBRARY_PATH):$(CURDIR)/$(PETSC_BUILD_DIR)/lib
+
+
+override_dh_auto_install:
+ dh_auto_install -plibpetsc3.6.1-dbg --destdir=$(PACKAGE_DEBUG_INSTALL_DIR) -- \
+ DESTDIR=$(PACKAGE_DEBUG_INSTALL_DIR) \
+ PETSC_DIR=$(CURDIR) PETSC_ARCH=$(PETSC_DEBUG_BUILD_DIR)
+ dh_auto_install -plibpetsc3.6.1 --destdir=$(PACKAGE_INSTALL_DIR) -- \
+ DESTDIR=$(PACKAGE_INSTALL_DIR) \
+ PETSC_DIR=$(CURDIR) PETSC_ARCH=$(PETSC_BUILD_DIR)
-binary-arch: install-arch
- dh_testdir -a
- dh_testroot -a
-# Customize control etc. using package names (maybe with -lam or -dec)
- mv -f debian/control debian/control.in
- sed "s/3.6.1/$(PETSC_VERSION)/" < debian/control.in | \
- sed "s/$(PETSC_VERSION)-doc/3.6.1-doc/" | \
- sed "s/Provides: $(PETSC_NAME)-dev/Provides: petsc3.6.1-dev/" | \
- sed "s/Provides: $(PETSC_NAME)-dbg/Provides: petsc3.6.1-dbg/" \
- > debian/control
- if [ "$(DEBIAN_DIST)" = "contrib" ]; then \
- sed "s/Section: lib/Section: contrib\/lib/" < debian/control > \
- debian/control.contrib ; \
- mv -f debian/control.contrib debian/control ; \
- fi
- for ARCHGEN in $(ARCH_GENERATED_FILES); do \
- rm -f $$ARCHGEN ; \
- sed "s/petsc_arch/$(PETSC_ARCH)-c-opt/" < \
- `echo "$$ARCHGEN.in" | sed "s/$(PETSC_NAME)/petsc3.6.1/"` | \
- sed "s/petsc_ver/$(PETSC_VERSION)/" > $$ARCHGEN; \
- done
-# Generate substvars for MPI, linear algebra implementations and dist
- rm -f debian/*.substvars
- if [ "$(PETSC_MPI)" = "openmpi" ]; then \
- echo "mpi=openmpi-bin" > debian/lib$(PETSC_NAME).substvars; \
- echo "mpi-dev=libopenmpi-dev" > debian/lib$(PETSC_NAME)-dev.substvars; \
- elif [ "$(PETSC_MPI)" = "mpich" ]; then \
- echo "mpi=mpich" > debian/lib$(PETSC_NAME).substvars; \
- echo "mpi-dev=libmpich-dev" > debian/lib$(PETSC_NAME)-dev.substvars; \
- else \
- echo "Unknown MPI implementation, stopping"; \
- exit 1; \
- fi
- if [ -e /usr/lib/libhdf5.so ]; then \
- echo "hdf5-dev=libhdf5-mpi-dev" >> debian/lib$(PETSC_NAME)-dev.substvars; \
- else \
- echo "hdf5-dev=" >> debian/lib$(PETSC_NAME)-dev.substvars; \
- fi
- if [ -e /usr/lib/libsidl.so ]; then \
- echo "babel-dev=libsidl-dev" >> debian/lib$(PETSC_NAME)-dev.substvars; \
- else \
- echo "babel-dev=" >> debian/lib$(PETSC_NAME)-dev.substvars; \
- fi
- if [ "$(PETSC_ARCH)" = "linux_alpha_dec" ]; then \
- echo "linear-algebra-dev=cxml" >> debian/lib$(PETSC_NAME)-dev.substvars; \
- echo "petsc-compilers=ccc, cfal" >> debian/lib$(PETSC_NAME)-dev.substvars; \
- else \
- echo "linear-algebra-dev=libblas-dev, liblapack-dev" >> debian/lib$(PETSC_NAME)-dev.substvars; \
- echo "petsc-compilers=gfortran, g++" >> debian/lib$(PETSC_NAME)-dev.substvars; \
- fi
- if [ "$(DEBIAN_DIST)" = "main" ]; then \
- echo "petsc-extra-dev=" >> debian/lib$(PETSC_NAME)-dev.substvars; \
- elif [ "$(DEBIAN_DIST)" = "contrib" ]; then \
- echo "petsc-extra-dev=libparmetis-dev" >> debian/lib$(PETSC_NAME)-dev.substvars; \
- else \
- echo "Unknown Debian distribution, stopping"; \
- exit 1; \
- fi
-# The rest is pretty much debhelper boilerplate
- dh_installdirs -a
- dh_installdocs -a
- dh_installchangelogs -a docs/changes/34.html
- dh_strip -a -Xlibg$(PETSC_BOPT_EXTRA) --dbg-package=libpetsc$(PETSC_VERSION)-dbg
-#
-# To avoid slepc complaining about shared libs being out of date
- touch debian/lib$(PETSC_NAME)-dbg/usr/lib/petscdir/$(PETSC_VERSION)/$(PETSC_ARCH)-c-debug/lib/*.so*
- dh_makeshlibs -a -m$(PETSC_VERSION)
- dh_compress -a
- dh_fixperms -a
- dh_installdeb -a
- dh_shlibdeps -a
- dh_gencontrol -a
- dh_md5sums -a
- dh_builddeb -a
-
-# Below here is fairly generic really
-
-binary: binary-indep binary-arch
DEB_SOURCE_PACKAGE = petsc
DEB_UPSTREAM_VERSION = $(shell dpkg-parsechangelog | sed -ne 's/^Version: \(.*\)-.*/\1/p')
DEB_STRIPPED_UPSTREAM_VERSION = $(shell echo $(DEB_UPSTREAM_VERSION) | sed -n -e 's/\.dfsg.*$$//p')
USCAN_DESTDIR := $(CURDIR)
-.PHONY: binary binary-arch binary-indep clean checkroot
-
-
get-orig-source:
uscan --no-conf --download-current-version --repack --compression xz
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/petsc.git
More information about the debian-science-commits
mailing list