File: rules

package info (click to toggle)
libaunit 1.03-7
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 364 kB
  • sloc: ada: 1,552; makefile: 61; sh: 6
file content (127 lines) | stat: -rwxr-xr-x 4,465 bytes parent folder | download
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
#!/usr/bin/make -f
#
# Debian Makefile for AUnit
# Copyright (c) 2009 Stephen Leake <stephen_leake@stephe-leake.org>
# Copyright (c) 2004, 2006 Ludovic Brenta <ludovic@ludovic-brenta.org>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
# 02110-1301 USA
#
# To setup for building this package from a new upstream release:
# cd /home/Projects/aunit
# mkdir libaunit-<upstream_version>-current
# cd aunit-<upstream_version>-current
# # get aunit-<upstream_version>-src.zip from upstream (see copyright)
# unzip aunit-<upstream_version>-src.zip -d .
# mv aunit-<upstream_version>-src libaunit-<upstream_version>
# tar zcf libaunit_<upstream_version>.orig.tar.gz libaunit-<upstream_version>
# mtn -d ~/monotone-dbs/ada-france.db checkout --branch org.debian.libaunit aunit-<upstream_version>/debian
#
# To build this package in a chroot:
# schroot -d `cd ..; pwd` --chroot=unstable -- dpkg-buildpackage -uc -us
#
# To run lintian:
# schroot -d `cd ..; pwd` --chroot=unstable -- make -f debian/rules lint
#
# To install the packages and run the tests:
# schroot -d `cd ..; pwd` --chroot=unstable -- make -f debian/rules run_test
#
# To review changes from previous version:
# schroot -d `cd ..; pwd` --chroot=unstable -- debdiff

.SUFFIXES=

# We use gnatmake, not make, for parallel builds.
.NOTPARALLEL:
CPUS := $(shell getconf _NPROCESSORS_ONLN)

# get soversion, aliversion from debian/control
soversion  := $(shell sed -n -e "s/^Package: libaunit\([0123456789]\+\)$$/\1/p" debian/control)
aliversion := $(shell sed -n -e "s/^Package: libaunit\(.\+\)-dev$$/\1/p" debian/control)

# Targets mandated by the Debian Policy

.PHONY: build build-arch build-indep binary binary-arch binary-indep clean

build: build-arch build-indep
build-arch: build-stamp
build-indep:

build-stamp:
	dh_testdir
	gnatmake -p -j$(CPUS) -Pdebian/aunit_build -XLIBTYPE=static -Xsoversion=$(soversion)
	gnatmake -p -j$(CPUS) -Pdebian/aunit_build -XLIBTYPE=dynamic -Xsoversion=$(soversion)
	touch $@

clean:
	dh_testdir
	dh_testroot
	dh_clean -a
	rm -f *-stamp
	rm -f debian/*.substvars

binary: binary-indep binary-arch

binary-indep:

# we don't use <package>.[dirs | docs | examples | ...], because they
# would all have to be renamed and edited when the soversion or
# aliversion change.
binary-arch: build libaunit-so libaunit-dev
	dh_shlibdeps -a
	dh_installdeb -a
	dh_installdocs -a
	dh_installchangelogs -a
	dh_compress -a
	dh_fixperms -a
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

libaunit-so: package := libaunit$(soversion)
libaunit-so:
	dh_testdir
	dh_testroot
	dh_installdirs -p$(package) usr/lib
	dh_install -p$(package) debian/tmp/libaunit.so.$(soversion) usr/lib
	dh_strip -p$(package) --dbg-package=libaunit-dbg
	dh_makeshlibs -p$(package)

libaunit-dev: specs   := $(shell find aunit -name \*.ads)
libaunit-dev: bodies  := $(shell find aunit -name \*.adb)
libaunit-dev: package := libaunit$(aliversion)-dev
libaunit-dev:
	dh_testdir
	dh_testroot
	dh_installdirs -p$(package) usr/share/ada/adainclude/aunit usr/lib/ada/adalib/aunit usr/share/doc/$(package) /usr/lib
	dh_install -p$(package) debian/tmp/libaunit-dynamic/*.ali usr/lib/ada/adalib/aunit
	dh_install -p$(package) $(specs) $(bodies) usr/share/ada/adainclude/aunit
	dh_install -p$(package) debian/aunit.gpr usr/share/ada/adainclude
	dh_install -p$(package) debian/tmp/libaunit.a usr/lib
	dh_link -p$(package) usr/lib/libaunit.so.$(soversion) usr/lib/libaunit.so
	dh_installdocs -p$(package) AUnit.html
	dh_installexamples -p$(package) template/*

lint:
	cd ..; lintian -i libaunit*.changes

# get debian version (used by test_installed) from debian/changelog
export debversion := $(shell dpkg-parsechangelog | sed -r -n -e "s/^Version: [0123456789.]+-([0123456789]+)$$/\1/p")
export aliversion
export soversion
run_test:
	cd debian; ./test_installed.sh

# end of file