~ubuntu-branches/ubuntu/vivid/regina-normal/vivid-proposed

« back to all changes in this revision

Viewing changes to debian/rules

  • Committer: Package Import Robot
  • Author(s): Ben Burton
  • Date: 2011-09-10 07:17:25 UTC
  • mfrom: (1.2.4 upstream)
  • Revision ID: package-import@ubuntu.com-20110910071725-97n90tywdq60w2cr
Tags: 4.90-1
* New upstream release!
* The user interface has been ported from KDE3 to KDE4 (closes: #556318).
  Re-enabled the GUI as a result.
* The build system has been ported from autotools to cmake.
* The new upstream release builds fine on amd64 (closes: #624882).
* Moved the users' handbook into regina-normal-doc.
* Upgraded several suggests/recommends.  Upgraded regina-normal-mpi to
  depend on mpi-default-bin, and regina-normal to depend on both graphviz
  and regina-normal-doc (which the GUI expends to be present).  Upgraded
  regina-normal to recommend gap.
* Bumped standards-version to 3.9.2.0 (no changes required).

Show diffs side-by-side

added added

removed removed

Lines of Context:
5
5
 
6
6
tmp = debian/tmp
7
7
 
 
8
DEB_KDE_LINK_WITH_AS_NEEDED = yes
 
9
 
 
10
include /usr/share/pkg-kde-tools/makefiles/1/variables.mk
 
11
 
8
12
INSTALL_DIR = install -p -d -o root -g root -m 755
9
13
INSTALL_FILE = install -p -o root -g root -m 644
10
14
 
11
15
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
12
16
        INSTALL_PROGRAM += -s
13
17
endif
14
 
ifeq ($(shell dpkg-architecture -qDEB_BUILD_ARCH),arm)
15
 
        CFLAGS += -O0
16
 
        CXXFLAGS += -O0
17
 
endif
18
 
 
19
 
# The MPI code currently builds on all architectures.  If it should fail
20
 
# on some architecture, that architecture should set NO_MPI = 1 and
21
 
# configmpi = --disable-mpi .
22
 
#
23
 
NO_MPI = 0
24
 
configmpi =
25
18
 
26
19
# Find the default python version so we can pass it to ./configure.  This 
27
20
# keeps things sane when multiple python*-dev packages are installed.
28
21
pyver = $(subst python,,$(shell /usr/bin/pyversions --default))
29
22
 
30
 
-include debian/debiandirs
31
 
 
32
 
debian/debiandirs: admin/debianrules
33
 
        perl -w admin/debianrules echodirs > debian/debiandirs
34
 
 
35
 
configure: configure-stamp
36
 
configure-stamp:
37
 
        dh_testdir
38
 
 
39
 
        # Update to debian's patched scripts.
40
 
        # admin/ac_gen
41
 
        # aclocal
42
 
        # autoheader
43
 
        # autoconf
44
 
        # automake
45
 
        # perl -w admin/am_edit
46
 
 
47
 
        # Patch regina-python to explicitly use the same python version that
48
 
        # we are building against.
49
 
        sed 's|`which python`|"/usr/bin/python$(pyver)"|' \
50
 
                < python/regina-python.in > python/regina-python.in.new
51
 
        mv -f python/regina-python.in.new python/regina-python.in
52
 
 
53
 
        # Back to the standard configure.
54
 
        chmod a+x configure
55
 
        CFLAGS="$(CFLAGS)" CXXFLAGS="$(CXXFLAGS)" \
56
 
          ./configure --disable-maintainer-mode PKGNAME=regina-normal \
57
 
          --disable-kdeui --with-python-version=$(pyver) \
58
 
          --includedir=/usr/include $(configkde) $(configmpi) \
59
 
          --includedir=/usr/include
60
 
 
61
 
        # Stop for a sanity check to see if the right bits and pieces are
62
 
        # going to be built (i.e., if all the required dependencies were
63
 
        # found).  It's a long build, and we'd rather know now than later.
64
 
        #
65
 
        # If any of these grep tests fails, it means that either something is
66
 
        # missing from the build-depends, or else one of the build dependencies
67
 
        # has recently changed in a way that makes it incompatible with the
68
 
        # current packaging.
69
 
        grep '^REGINA_BUILD_DOCSENGINE=.engine.$$' config.log > /dev/null
70
 
        grep '^REGINA_BUILD_ENGINE=.engine.$$' config.log > /dev/null
71
 
        # grep '^REGINA_BUILD_KDEUI=.kdeui.$$' config.log > /dev/null
72
 
        grep '^REGINA_BUILD_MPI=.mpi.$$' config.log > /dev/null
73
 
        grep '^REGINA_BUILD_PYTHON=.python.$$' config.log > /dev/null
74
 
        grep '^REGINA_BUILD_TESTSUITE=.testsuite.$$' config.log > /dev/null
75
 
        grep '^REGINA_BUILD_UTILS=.utils.$$' config.log > /dev/null
76
 
 
77
 
        # All good!
78
 
        touch configure-stamp
79
 
 
80
 
build: configure-stamp build-stamp
81
 
build-stamp:
82
 
        dh_testdir
83
 
        $(MAKE)
 
23
build_dir = builds/debbuild
 
24
 
 
25
${build_dir}:
 
26
        dh_testdir
 
27
 
 
28
        mkdir -p ${build_dir}
 
29
        cd ${build_dir} && \
 
30
                cmake $(CURDIR) \
 
31
                -DPACKAGE_NAME=regina-normal -DPACKAGING_MODE=1 \
 
32
                $(DEB_CMAKE_KDE4_FLAGS) \
 
33
                $(DEB_CMAKE_CUSTOM_FLAGS) \
 
34
                -DPYTHON_EXECUTABLE=/usr/bin/python${pyver} \
 
35
                -DCMAKE_INSTALL_PREFIX=/usr \
 
36
                -DCMAKE_MODULE_PATH="/usr/share/apps/cmake/modules"
 
37
 
 
38
configure: ${build_dir}
 
39
 
 
40
build: build-arch build-indep
 
41
build-arch: build-stamp
 
42
build-indep: build-stamp
 
43
 
 
44
build-stamp: ${build_dir}
 
45
        dh_testdir
 
46
 
 
47
        $(MAKE) -C ${build_dir} VERBOSE=1
84
48
ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS)))
85
 
        $(MAKE) check
 
49
        $(MAKE) -C ${build_dir} test ARGS=-V
86
50
endif
 
51
 
87
52
        touch build-stamp
88
53
 
89
54
clean:
90
55
        dh_testdir
91
56
        dh_testroot
92
 
        [ ! -f Makefile ] || $(MAKE) distclean
93
57
        rm -f build-stamp configure-stamp
94
 
        rm -f debian/debiandirs
 
58
 
 
59
        [ ! -d ${build_dir} ] || rm -rf ${build_dir}
 
60
 
95
61
        dh_clean
96
62
 
97
63
install: build
98
64
        dh_testdir
99
65
        dh_testroot
100
 
        dh_clean -k
 
66
        dh_prep
101
67
        dh_installdirs
102
68
 
103
69
        # Main install.
104
 
        $(MAKE) install DESTDIR=`pwd`/$(tmp)
105
 
 
106
 
ifneq ($(NO_MPI),1)
107
 
        # Make sure MPI support was enabled.
108
 
        if ! test -e $(tmp)/usr/bin/tricensus-mpi; then \
109
 
          echo "ERROR: MPI utilities were not built and installed."; \
110
 
          echo "       Check your configure options."; \
111
 
          /bin/false; \
112
 
        fi
113
 
endif
 
70
        $(MAKE) -C ${build_dir} install DESTDIR=$(CURDIR)/$(tmp)
114
71
 
115
72
        # Split into separate binary packages.
116
 
        dh_install --sourcedir=debian/tmp --list-missing
117
 
 
118
 
        # Ensure sample data files are stored as compressed XML.
119
 
        for i in debian/regina-normal/usr/share/doc/regina-normal/examples/*.rga; do \
120
 
          utils/regconvert -x $$i $$i; \
121
 
        done
122
 
 
123
 
        # Install linda and lintian overrides.
 
73
        dh_install --sourcedir=$(tmp) --list-missing
 
74
 
 
75
        # Install lintian overrides.
124
76
        for pkg in `dh_listpackages`; do \
125
77
          if test -e debian/$$pkg.override; then \
126
78
            $(INSTALL_DIR) debian/$$pkg/usr/share/lintian/overrides; \
127
79
            $(INSTALL_FILE) debian/$$pkg.override \
128
80
              debian/$$pkg/usr/share/lintian/overrides/$$pkg; \
129
81
          fi; \
130
 
          if test -e debian/$$pkg.linda; then \
131
 
            $(INSTALL_DIR) debian/$$pkg/usr/share/linda/overrides; \
132
 
            $(INSTALL_FILE) debian/$$pkg.linda \
133
 
              debian/$$pkg/usr/share/linda/overrides/$$pkg; \
134
 
          fi; \
135
82
        done
136
83
 
137
84
# Build architecture-independent files here.
169
116
        dh_link -a
170
117
        dh_strip -a
171
118
        dh_compress -a -X.bz2 -X.css -X.docbook -X.rga
172
 
        #for i in `find debian/regina-normal/usr/share/doc/kde -name "*.gz"`; do \
173
 
        #  gunzip $$i; done
174
119
        dh_fixperms -a
175
120
        dh_makeshlibs -a
176
121
        # Only run the python scripts on regina-normal.