4 # Integration between git and Debian-style archives
6 # Copyright (C)2013-2016 Ian Jackson
8 # This program is free software: you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation, either version 3 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program. If not, see <http://www.gnu.org/licenses/>.
26 override_dh_gencontrol:
30 v=$$(perl -ne 'print if s/^version:\s+//i' DEBIAN/control); \
31 perl -i -pe "s/UNRELEASED/$$v/g if m/###substituted###/" usr/bin/dgit
33 override_dh_auto_clean:
37 globalperl=/usr/share/perl5
39 override_dh_auto_install: specpkg_install_gdr specpkg_install_infra
40 make install prefix=/usr DESTDIR=debian/dgit
41 make -C po install prefix=/usr DESTDIR=../debian/tmp \
42 SUPPRESS_PO_UPDATE=1 S=''
44 specpkg_install_gdr: p=git-debrebase
45 specpkg_install_gdr: pm=GDR
47 specpkg_install_infra: p=dgit-infrastructure
48 specpkg_install_infra: pm=Infra
50 specpkg_install_%: tok=$*
51 specpkg_install_%: specperl=/usr/share/dgit/$(tok)/perl5
53 make install-$(tok) prefix=/usr DESTDIR=debian/$(p) perldir=$(specperl)
54 # # Most of the Perl modules in this package live in
55 # # $(specperl). The exception is Debian::Dgit::Infra, which
56 # # lives in $(globalperl) and adds $(specperl) to @INC.
59 mod=Debian/Dgit/$(pm).pm; \
60 src=$${base}$(specperl)/$${mod}; \
61 dst=$${base}$(globalperl)/$${mod}; \
62 mkdir -p $${dst%/*}; \
64 perl -i -p -e 'next unless m/###substituted###/;' \
65 -e 'next unless s/^# (?=unshift \@INC,)//;' \
66 -e 'die unless s{q\{\S+\}}{q{$(specperl)}};' \
69 debian/tests/control: tests/enumerate-tests debian/tests/control.in
70 $< gencontrol >$@.new && mv -f $@.new $@
72 debian/tests/control: tests/lib-core tests/lib-restricts
73 debian/tests/control: tests/tests $(wildcard tests/tests/*[^~#])