File: rules

package info (click to toggle)
sipwitch 1.2.4-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 2,768 kB
  • sloc: cpp: 16,534; sh: 11,336; makefile: 206; xml: 24; ansic: 20
file content (112 lines) | stat: -rwxr-xr-x 4,511 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
#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-
# Copyright © 2011, 2012 Jonas Smedegaard <dr@jones.dk>
# Description: Main Debian packaging script for GNU SIP Witch
#
# 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 2, 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, see <http://www.gnu.org/licenses/>.

# This needs to run (and thus be declared) before CDBS includes
debian/control:: debian/control.in
DEB_PHONY_RULES += debian/control.in
debian/control.in::
	sed -e 's/__LIBPKGNAME__/$(libpkgname)/g' <debian/control.in.in >debian/control.in

DEB_AUTO_UPDATE_LIBTOOL = pre
DEB_AUTO_UPDATE_AUTOCONF = 2.68
DEB_AUTO_UPDATE_AUTOHEADER = 2.68
DEB_AUTO_UPDATE_ACLOCAL = 1.11
DEB_AUTO_UPDATE_AUTOMAKE = 1.11
include /usr/share/cdbs/1/rules/upstream-tarball.mk
include /usr/share/cdbs/1/rules/utils.mk
include /usr/share/cdbs/1/class/autotools.mk
#include /usr/share/cdbs/1/class/cmake.mk
include /usr/share/cdbs/1/rules/debhelper.mk

stem = sipwitch
major = $(firstword $(subst .,$(space),$(DEB_UPSTREAM_VERSION)))
libname = lib$(stem)
libpkgname = lib$(stem)$(major)
pkgconfigname = $(libname)

DEB_UPSTREAM_URL = http://ftp.gnu.org/gnu/sipwitch
DEB_UPSTREAM_TARBALL_MD5 = 6119cecb062ba4d0af18b427b01c41e2

CDBS_BUILD_DEPENDS += , libucommon-dev, libexosip2-dev, pkg-config, libavahi-client-dev

DEB_MAKE_CHECK_TARGET = check

devbinfiles = sipwitch-config
binfiles = sippasswd sipquery sipwitch
sbinfiles = sipw
cgifiles = sipwitch-cgi
DEB_INSTALL_MANPAGES_$(libname)-dev = $(patsubst %,debian/tmp/usr/share/man/man1/%.1,$(devbinfiles))
DEB_INSTALL_MANPAGES_$(stem) = $(patsubst %,debian/tmp/usr/share/man/man1/%.1,$(binfiles)) $(patsubst %,debian/tmp/usr/share/man/man8/%.8,$(sbinfiles))
DEB_INSTALL_MANPAGES_$(stem)-cgi = $(patsubst %,debian/tmp/usr/share/man/man8/%.8,$(cgifiles))
DEB_DH_INSTALL_ARGS_$(libname)-dev = --autodest $(patsubst %,usr/bin/%,$(devbinfiles))
DEB_DH_INSTALL_ARGS_$(stem) = --autodest $(patsubst %,usr/bin/%,$(binfiles)) $(patsubst %,usr/sbin/%,$(sbinfiles))
DEB_DH_INSTALL_ARGS_$(stem) += usr/lib/sipwitch/*.so etc
DEB_DH_INSTALL_ARGS_$(stem)-cgi = --autodest usr/lib/cgi-bin/ $(patsubst %,usr/bin/%,$(cgifiles))

# put aside upstream-shipped temp files during build but after copyright-check
upstreamtmpfiles = Makefile.in $(patsubst %,%/Makefile.in,common inc inc/sipwitch server test utils)
upstreamtmpfiles += aclocal.m4 autoconf/ltmain.sh configure sipwitch.spec
pre-build:: debian/stamp-upstreamtmpstuff
debian/stamp-upstreamtmpstuff: debian/stamp-copyright-check
	for file in $(upstreamtmpfiles); do \
		[ ! -e $$file ] || [ -e $$file.upstream ] || cp -a $$file $$file.upstream; \
	done
	touch $@
clean::
	for file in $(upstreamtmpfiles); do \
		[ ! -e $$file.upstream ] || mv -f $$file.upstream $$file; \
	done
	rm -f debian/stamp-upstreamtmpstuff

# Clean autogenerated files not also shipped upstream
clean::
	rm -rf m4

# TODO: Enable docs when sensible (i.e. not mainly doing illegal ../ucommon)
#DEB_INSTALL_DOCS_$(stem)-doc += doc/html
#common-build-indep:: debian/stamp-docs
#debian/stamp-docs:
#	rm -rf doc
#	doxygen Doxyfile
#	touch $@
#clean::
#	rm -rf doc
#	rm -f debian/stamp-docs

# Re-install initscript with debhelper to add pre- and postinst routines
install/$(stem)::
	mv debian/tmp/etc/init.d/$(stem) debian/$(stem).init
clean::
	rm -f debian/$(stem).init

# Let d-shlibs calculate development package dependencies
#  and handle shared library install
CDBS_BUILD_DEPENDS += , d-shlibs
binary-post-install/$(libpkgname):: debian/stamp-local-shlibs-$(libname)
debian/stamp-local-shlibs-$(libname): binary-install/$(libpkgname)
	d-shlibmove --commit \
		--devunversioned \
		--exclude-la \
		--override  s/$(libname)$(major)-dev/$(libname)-dev/ \
		--movedev "debian/tmp/usr/include/*" usr/include/ \
		$(patsubst %,--movedev debian/tmp/usr/lib/pkgconfig/%.pc usr/lib/pkgconfig,$(pkgconfigstems)) \
		$(patsubst %,--extralib debian/tmp/usr/lib/%.so,$(extralibnames)) \
		debian/tmp/usr/lib/$(libname).so
	touch $@
clean::
	rm -f debian/stamp-local-shlibs-$(libname)