File: rules

package info (click to toggle)
4store 1.1.6+20151109-2
  • links: PTS, VCS
  • area: main
  • in suites: buster, sid
  • size: 82,388 kB
  • sloc: ansic: 65,689; sh: 2,916; perl: 2,245; makefile: 281; python: 213
file content (149 lines) | stat: -rwxr-xr-x 5,994 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
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
#!/usr/bin/make -f
# -*- mode: makefile; coding: utf-8 -*-
# Copyright © 2010 Dave Beckett <dajobe@debian.org>
# Copyright © 2011-2013, 2015-2016 Jonas Smedegaard <dr@jones.dk>
# Description: Main Debian packaging script for 4store
#
# 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, see <http://www.gnu.org/licenses/>.

# This needs to run before inclusion of CDBS snippets
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_ACLOCAL = ,
DEB_AUTO_UPDATE_AUTOCONF = ,
DEB_AUTO_UPDATE_AUTOMAKE = ,
DEB_AUTO_UPDATE_AUTOHEADER = ,
include /usr/share/cdbs/1/rules/upstream-tarball.mk
include /usr/share/cdbs/1/class/autotools.mk
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/rules/utils.mk

stem = 4store
abi = 0
pkg = $(stem)
libpkgname = lib$(stem)$(abi)
libname = lib$(stem)
pkgconfigfile = $(stem)-$(abi).pc

DEB_UPSTREAM_URL = https://github.com/garlik/4store/archive
DEB_UPSTREAM_TARBALL_BASENAME = v$(DEB_UPSTREAM_TARBALL_VERSION)

# Build-depend unversioned on debhelper
#  TODO: Drop when adopted in cdbs
CDBS_BUILD_DEPENDS_rules_debhelper_v9 = debhelper

# Needed by upstream build
bdeps = libpcre3-dev, libglib2.0-dev, ncurses-dev, libreadline-dev
bdeps +=, libavahi-client-dev, libavahi-glib-dev, libstemmer-dev
bdeps +=, uuid-dev, librasqal3-dev, libraptor2-dev

CDBS_BUILD_DEPENDS +=, $(bdeps)
CDBS_DEPENDS_$(pkg) = adduser, netbase
CDBS_RECOMMENDS_$(pkg) = avahi-daemon, perl, libnet-http-perl, liburi-perl

LDFLAGS += -Wl,-z,defs

# skip copyright-check icon file
DEB_COPYRIGHT_CHECK_IGNORE_REGEX = ^(app-aux/Resources/4store.icns|debian/(changelog|copyright(|_hints|_newhints)))$

# Work around upstream code assuming build directly from git
pre-build::
	echo "$(DEB_UPSTREAM_TARBALL_BASENAME)" > .version
clean::
	rm -f .version

# detect when when targeted experimental suite
exp-relax-check := $(if $(shell dpkg-parsechangelog \
	| grep -x 'Distribution: \(experimental\|UNRELEASED\)'),yes)

# TODO: Fix failing tests - for now enable only relaxed for experimental
DEB_MAKE_CHECK_TARGET = $(if $(exp-relax-check),$(strip\
	test FS_STORE_ROOT="$(cdbs_curdestdir)/var/lib/4store" || true))

DEB_INSTALL_DOCS_ALL = docs/*
DEB_INSTALL_CHANGELOGS_ALL = NEWS
DEB_DH_INSTALL_ARGS_$(pkg) = src/admin/README.md /usr/share/doc/$(pkg)/README.admin

DEB_DH_INSTALLINIT_ARGS = --no-start --update-rcd-params="defaults" --error-handler=installinit_error

# put aside upstream-shipped temp files during build, and cleanup afterwards
DEB_UPSTREAM_CRUFT_COPY = version.sh
DEB_UPSTREAM_CRUFT_MOVE += tests/httpd-extras/results
clean::
	rm -rf tests/httpd/results tests/query/results

# create autotools file files during build and cleanup afterwards
makefilesrcdirs = admin backend common frontend http libs utilities
makefilesrcdirs += libs/double-metaphone libs/mt19937-64 libs/stemmer
makefiledirs = . man src $(makefilesrcdirs:%=src/%) tests
files_autotools_notshipped = $(macrodir) $(auxdir)/compile $(auxdir)/ar-lib
files_autotools_notshipped += 4store-config.h.in
# TODO: move below to CDBS autotools-files.mk snippet (if indeed generic)
basedir = $(DEB_SRCDIR)
auxdir = $(basedir)
macrodir = $(basedir)/m4
autom4tedir = $(basedir)/autom4te.cache
files_autotools_core = $(auxdir)/config.guess $(auxdir)/config.sub
stems_m4_libtool = libtool ltoptions ltsugar ltversion lt~obsolete
files_libtool = $(auxdir)/ltmain.sh $(stems_m4_libtool:%=$(macrodir)/%.m4)
files_aclocal = $(basedir)/aclocal.m4
stems_aux_autoconf = ar-lib compile install-sh missing
files_autoconf = $(basedir)/configure $(stems_aux_autoconf:%=$(auxdir)/%)
files_automake = $(auxdir)/depcomp $(makefiledirs:%=$(basedir)/%/Makefile.in)
files_autotools = $(files_autotools_core) $(files_libtool) $(files_aclocal)
files_autotools += $(files_autoconf) $(files_automake)
files_configure = $(DEB_BUILDDIR)/config.log
files_make = $(makefiledirs:%=$(DEB_BUILDDIR)/%/Makefile)
DEB_ACLOCAL_ARGS = -Im4 --install --force
DEB_AUTOMAKE_ARGS = --add-missing --copy --foreign --force
DEB_MAKE_CLEAN_TARGET = distclean
makefile-clean::
	rm -rf $(dirs_autotools)
	rm -f $(filter-out $(DEB_UPSTREAM_CRUFT_MOVE),\
		$(files_autotools) $(files_configure) $(files_make))
clean::
	rm -f $(filter-out $(DEB_UPSTREAM_CRUFT_MOVE),\
		$(files_autotools_core))
	$(if $(call cdbs_streq,$(basedir),$(auxdir)),\
		,\
		test ! -d $(auxdir) \
		|| rmdir --ignore-fail-on-non-empty $(auxdir))
	$(if $(files_autotools_notshipped),\
		rm -rf $(files_autotools_notshipped))

# 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 \
		--override s/libavahi-client.-dev/libavahi-client-dev/ \
		--override s/libavahi-common.-dev/libavahi-common-dev/ \
		--override s/libavahi-glib.-dev/libavahi-glib-dev/ \
		--movedev "debian/tmp/usr/include/*" usr/include/ \
		--movedev "debian/tmp/usr/lib/pkgconfig/$(pkgconfigfile)" usr/lib/pkgconfig/ \
		--devunversioned \
		--exclude-la \
		debian/tmp/usr/lib/$(libname).so
	touch $@
clean::
	rm -f debian/stamp-local-shlibs-$(libname)

# cleanup makefile skipped due to entanglement in patch 2002
clean::
	rm -f src/libs/stemmer/Makefile