File: rules

package info (click to toggle)
swish-e 2.4.7-6
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 7,268 kB
  • sloc: ansic: 51,637; sh: 8,889; perl: 3,019; makefile: 587; xml: 9
file content (92 lines) | stat: -rwxr-xr-x 2,747 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
#!/usr/bin/make -f
#
# Debian build makefile
#


DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk

ifndef PERL
    PERL = /usr/bin/perl
endif

DEST=$(CURDIR)/debian/swish-e
DOCDIR=$(DEST)/usr/share/doc/swish-e

clean:
	dh_testdir
	dh_testroot
	dh_clean build.stamp
	-( cd perl; $(MAKE) realclean)
	-[ ! -f Makefile ] || $(MAKE) distclean
	rm -f perl/t/index.swish-e* perl/Makefile.old
	rm -f doc/swish-e.1 doc/swish-search.1 *.cgi.7
	rm -f src/acconfig.h doc/bin/toc_file config.log
	rm -f html/search.cgi debian/files
	rm -f SWISH-Stemmer-0.05.tar.gz

build: build.stamp
build.stamp:
	dh_testdir
	dh_update_autotools_config
	env CC=gcc CFLAGS="$(CFLAGS)" LDFLAGS="$(LDFLAGS)" ./configure --mandir=\$${prefix}/share/man --with-libxml2 --with-pcre --prefix=/usr
	$(MAKE)
	#$(MAKE) docs
	#(cd doc;$(MAKE) man)
	(chmod 755 swish-config;cd perl; env PATH=..:$$PATH SWISHSKIPTEST=1 SWISHIGNOREVER=1 $(PERL) Makefile.PL INSTALLDIRS=vendor LDDLFLAGS="$(LDFLAGS) -shared" < /dev/null \
		&& $(MAKE) OPTIMIZE="$(CFLAGS) -I../src/" CC=gcc LD=gcc LD_RUN_PATH=)
	> $@

binary: binary-arch binary-indep

binary-arch: build
	dh_testdir
	dh_testroot
	dh_clean
	dh_installdirs 
	uudecode debian/SWISH-Stemmer-0.05.tar.gz.uu
	# bin
	make install DESTDIR=$(DEST)
	sed -i "/dependency_libs/ s/'.*'/''/" `find . -name '*.la'`
	# perl
	(cd perl;$(MAKE) install DESTDIR=$(DEST))
	# docs
	(cd example;pod2man -s 7 swish.cgi >../swish.cgi.7 ;pod2man -s 7 search.cgi >../search.cgi.7)
	dh_installman
	dh_installdocs README* 
	dh_installexamples example/* conf filter-bin prog-bin SWISH-Stemmer-0.05.tar.gz
	# swish-search symlinks
	(cd $(DEST)/usr/bin; ln -s swish-e swish-search)
	(cd $(DEST)/usr/share/man/man1; ln -s swish-e.1 swish-search.1)	
	# let's make lintian happy
	mv $(DEST)/usr/bin/swish-filter-test $(DOCDIR)/examples/
	find $(DOCDIR)/examples -name '*' -exec chmod 644 {} \;
	find $(DOCDIR)/examples -name '*.in' -exec rm {} \;
	find $(DEST)/usr/lib/swish-e/perl -name '*.pm' -exec chmod 644 {} \;
	cp -f debian/swish_filter.pl $(DOCDIR)/examples/filter-bin/
	chmod 755 $(DOCDIR)/examples/filter-bin/*.pl
	chmod 755 $(DOCDIR)/examples/filter-bin/*.sh
	rm -f $(DOCDIR)/README.cvs $(DOCDIR)/INSTALL
	rm -f $(DOCDIR)/examples/prog-bin/*.in $(DOCDIR)/examples/prog-bin/Make*
	rm -f $(DOCDIR)/examples/*.in $(DOCDIR)/examples/Make*
	rm -f $(DOCDIR)/filter-bin/Make* $(DOCDIR)/conf/Make*
	#rm -rf $(DESTDIR)/usr/share/swish-e
	#
	dh_movefiles --sourcedir=debian/swish-e
	dh_installchangelogs
	dh_strip
	dh_compress -Xexamples
	dh_installdebconf
	dh_fixperms
	dh_makeshlibs
	dh_installdeb
	dh_perl
	dh_shlibdeps -l$(DEST)/usr/lib/
	dh_gencontrol -a
	dh_md5sums
	dh_builddeb

binary-indep: build

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