File: rules

package info (click to toggle)
libpreludedb 1.0.0-2.4
  • links: PTS
  • area: main
  • in suites: stretch
  • size: 6,100 kB
  • ctags: 4,399
  • sloc: ansic: 33,060; sh: 10,861; xml: 4,102; sql: 1,421; makefile: 330; python: 7; perl: 2
file content (100 lines) | stat: -rwxr-xr-x 2,769 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
#!/usr/bin/make -f
#export DH_VERBOSE=1

INSTALLD=install -m755 -o0 -g0 -d
INSTALLF=install -m644 -o0 -g0
INSTALLE=install -m755 -o0 -g0

PYVERS=$(shell pyversions -vr)

ARCHLIB := $(shell perl -MConfig -e 'print $$Config{vendorarch}')

TMPDIR=debian/tmp

prefix=$(CURDIR)/debian/tmp/usr

configure: configure-stamp
configure-stamp:
	dh_testdir
	dh_autoreconf
	./configure --prefix=/usr --mandir=\$${prefix}/share/man --enable-gtk-doc=no --localstatedir=/var --sysconfdir=/etc --with-perl-installdirs=vendor
	touch configure-stamp

build-arch: build
build-indep:
build: configure-stamp build-stamp $(PYVERS:%=build-python%)
build-stamp:
	dh_testdir
	# Force swig to regenerate PreludeDB.c, cf. https://bugs.debian.org/752335
	rm -f bindings/perl/PreludeDB.c
	$(MAKE)
	
	touch build-stamp

build-python%:
	cd bindings/python && python$* setup.py build
	touch $@

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp configure-stamp build-python2.*
	[ ! -f bindings/perl/Makefile ] || $(MAKE) -C bindings/perl realclean
	[ ! -f Makefile ] || $(MAKE) distclean
	rm -rf bindings/python/build
	rm -f bindings/perl/PreludeDB.c
	rm -f debian/libpreludedb-perl.install
	dh_autoreconf_clean
	dh_clean

install: install-core $(PYVERS:%=install-python%)

install-core: build
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs

	$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
	find $(CURDIR)/debian/tmp -name \*.pyc -exec rm -f {} \;
	find $(CURDIR)/debian/tmp -name \*.la -delete
	sed -e 's,$${archlib},$(ARCHLIB),g' debian/libpreludedb-perl.install.in > debian/libpreludedb-perl.install
#	$(INSTALLD) $(TMPDIR)/etc/prelude/	\
#		$(TMPDIR)/etc/prelude/default/	\
#		$(TMPDIR)/etc/prelude/profile/	\
#		$(TMPDIR)/var/spool/prelude-sensors

#	$(INSTALLF) sensors-default.conf $(TMPDIR)/etc/prelude-sensors/

install-python%:
	cd bindings/python && python$* setup.py install --root $(CURDIR)/debian/python-preludedb

binary-indep: build install

binary-arch: build install
	dh_testdir
	dh_testroot
	dh_install
	dh_installdocs README
	dh_installchangelogs ChangeLog
	dh_perl
	dh_python2 -ppython-preludedb
	dh_link
	dh_strip
	dh_compress -X.py
	dh_fixperms
	sed -i -e 's/TYPE=/ENGINE=/g' debian/libpreludedb0/usr/share/libpreludedb/classic/mysql.sql
	sed -i -e 's/TYPE=/ENGINE=/g' debian/libpreludedb0/usr/share/libpreludedb/classic/mysql2*.sh
	chmod +x debian/libpreludedb0/usr/share/libpreludedb/classic/mysql2sqlite.sh
	chmod +x debian/libpreludedb0/usr/share/libpreludedb/classic/mysql2pgsql.sh
	dh_makeshlibs
	dh_installdeb
	dh_shlibdeps debian/libpreludedb0/usr/bin/preludedb-admin \
		debian/libpreludedb-dev/usr/bin/libpreludedb-config
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-indep binary-arch

.PHONY: build clean binary-indep binary-arch binary install configure