File: rules

package info (click to toggle)
profanity 0.13.1-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 6,064 kB
  • sloc: ansic: 73,259; sh: 4,456; makefile: 516; python: 212
file content (71 lines) | stat: -rwxr-xr-x 2,117 bytes parent folder | download | duplicates (2)
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
#!/usr/bin/make -f

# Export all hardening flags
export DEB_BUILD_MAINT_OPTIONS = hardening=+all

FLAGS_profanity_base = \
	--enable-dependency-tracking \
	--enable-c-plugins \
	--enable-plugins \
	--enable-omemo \
	--enable-otr \
	--enable-pgp \
	--libdir=/usr/lib/profanity
FLAGS_profanity_full = $(FLAGS_profanity_base) \
	--enable-python-plugins \
	--enable-notifications \
	--enable-icons-and-clipboard \
	--enable-icons \
	--with-xscreensaver
FLAGS_profanity_light = $(FLAGS_profanity_base) \
	--with-xscreensaver=no \
	--disable-icons-and-clipboard \
	--disable-icons \
	--disable-notifications \
	--disable-python-plugins

BUILDDIR_LIGHT := $(CURDIR)/debian/build-light
BUILDDIR_FULL := $(CURDIR)/debian/build-full

%:
	dh $@ --with autoreconf

override_dh_autoreconf:
# "aclocal" fails without "m4" directory
	[ -d 'm4' ] || mkdir 'm4'
	dh_autoreconf
	rmdir --ignore-fail-on-non-empty 'm4'

override_dh_auto_configure: src/gitversion.h.in
	dh_auto_configure --builddirectory=$(BUILDDIR_LIGHT) -- $(FLAGS_profanity_light)
	PYTHON_VERSION=3; export PYTHON_VERSION; \
	dh_auto_configure --builddirectory=$(BUILDDIR_FULL) -- $(FLAGS_profanity_full)

override_dh_auto_build:
	dh_auto_build -a -- -C $(BUILDDIR_LIGHT)/src
	dh_auto_build -a -- -C $(BUILDDIR_FULL)/src

fix_whatis:
	-mkdir man
	for manpage in docs/*.1; do \
	    sed '0,/^\/.*/s|^\(/.*\)|\1 \\- the Profanity \1 command.|' < $$manpage > man/$$(basename $$manpage); \
	done

override_dh_auto_install: fix_whatis
	$(MAKE) -C $(BUILDDIR_LIGHT) install DESTDIR=$(BUILDDIR_LIGHT).inst
	$(MAKE) -C $(BUILDDIR_FULL) install DESTDIR=$(BUILDDIR_FULL).inst
	sed -i "/dependency_libs/ s/'.*'/''/" $$(find . -name '*.la')

override_dh_auto_clean:
	dh_auto_clean
	rm -fr $(BUILDDIR_FULL) $(BUILDDIR_LIGHT) $(BUILDDIR_FULL).inst $(BUILDDIR_LIGHT).inst

src/gitversion.h.in:
	echo "#ifndef PROF_GIT_BRANCH" > $@
	echo "#define PROF_GIT_BRANCH \"debian/experimental\"" >> $@
	echo "#endif" >> $@
	echo "#ifndef PROF_GIT_REVISION" >> $@
	echo "#define PROF_GIT_REVISION \"$(dpkg-parsechangelog --show-field Version)\"" >> $@
	echo "#endif" >> $@

.PHONY: fix_whatis