File: rules

package info (click to toggle)
xapian-omega 1.4.18-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 3,964 kB
  • sloc: cpp: 15,016; sh: 5,447; perl: 891; makefile: 280
file content (96 lines) | stat: -rwxr-xr-x 4,103 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
#!/usr/bin/make -f
#
# Copyright (C) 2004,2005,2006 Lemur Consulting Ltd
# Copyright (C) 2006-2021 Olly Betts
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to
# deal in the Software without restriction, including without limitation the
# rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
# sell copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
# IN THE SOFTWARE.

# Codename we're building packages for.  For backported packages, put the
# codename (e.g. jessie or trusty) in debian/codename.  If that file doesn't
# exist, the default is sid.
#
# (Currently nothing in this file varies depending on the codename).
# CODENAME := $(shell cat debian/codename 2>/dev/null||echo sid)

# Version without the "-N" suffix.
XAPIAN_VERSION := $(shell sed 's/.*(\([^-]*\)\(-.*\)*).*/\1/;q' debian/changelog)

# The next incompatible version - i.e. the first release of the next release
# branch.  So for XAPIAN_VERSION "1.0.<n>", this should be "1.1.0".
XAPIAN_VERSION_CEILING := $(shell echo '$(XAPIAN_VERSION)'|awk -F. '{print $$1"."$$2+1".0"}')

# We need a versioned build dependency on libxapian-dev.
# NB Trailing ',' required here!
BUILD_DEPS := \
	libxapian-dev (>= $(XAPIAN_VERSION)), \
	libxapian-dev (<< $(XAPIAN_VERSION_CEILING)),

export DEB_BUILD_MAINT_OPTIONS:=hardening=+all

maint: debian/control
	: # Dummy action so the "%" target isn't used.

maintclean: clean
	rm -f debian/control

debian/control: debian/rules debian/control.in
	rm -f debian/control.tmp
	sed -e "s/@BUILD_DEPS@/$(BUILD_DEPS)/g" \
	    < debian/control.in > debian/control.tmp
	mv debian/control.tmp debian/control

%:
	dh $@

override_dh_auto_configure: debian/control
	dh_auto_configure --builddir=debian/build -- --libdir=/usr/lib

override_dh_auto_install:
	# Install the files into debian/tmp.
	dh_auto_install --builddir=debian/build --destdir=debian/tmp

	# Replace omega.conf with one with paths suitable for debian.
	rm -f debian/tmp/etc/omega.conf
	install -m 644 debian/omega.conf.debian debian/tmp/etc/omega.conf

	# Install the icons.
	install -d -m 755 debian/tmp/usr/share/images/xapian-omega
	install -m 644 images/*.png debian/tmp/usr/share/images/xapian-omega

	# Install the omegascript templates.
	install -d -m 755 debian/tmp/usr/share/xapian-omega/templates
	install -d -m 755 debian/tmp/usr/share/xapian-omega/templates/inc
	install -m 644 templates/inc/[a-z]* debian/tmp/usr/share/xapian-omega/templates/inc
	install -m 644 templates/[a-hj-z]* debian/tmp/usr/share/xapian-omega/templates

	# Fix paths in query template, and install that instead.
	sed 's!/icons/omega/!/images/xapian-omega/!g' templates/query > debian/query.tmp
	install -m 644 debian/query.tmp debian/tmp/usr/share/xapian-omega/templates/query
	rm -f debian/query.tmp

	# Symlink them in as examples (they can't just go under /usr/share/doc
	# because policy 12.3 says "Packages must not require the existence of
	# any files in `/usr/share/doc/' in order to function").
	install -d -m 755 debian/tmp/usr/share/doc/xapian-omega/examples
	ln -s ../../../xapian-omega/templates debian/tmp/usr/share/doc/xapian-omega/examples/templates

	# Create the /var directories.
	install -d -m 755 debian/tmp/var/lib/xapian-omega/data
	install -d -m 755 debian/tmp/var/lib/xapian-omega/cdb
	install -d -m 755 debian/tmp/var/log/xapian-omega