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
|
#!/usr/bin/make -f
#
# Debian build makefile
#
export CFLAGS := -Wall -g -fPIC
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
DH_STRIP=dh_strip
ifneq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
DH_STRIP=true
endif
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
build: build.stamp
build.stamp:
dh_testdir
env CC=gcc CFLAGS="$(CFLAGS)" ./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 < /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
# bin
make install DESTDIR=$(DEST)
# perl
(cd perl;$(MAKE) install PREFIX=$(DEST)/usr)
# 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-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
|