3
#DEB_AUTO_UPDATE_DEBIAN_CONTROL:=yes
5
DEB_TAR_SRCDIR := sword-1.5.9
6
# cdbs is currently broken and can't handle this
7
#DEB_TARBALL := upstream/sword-1.5.8.tar.gz
9
include /usr/share/cdbs/1/rules/tarball.mk
2
include /usr/share/cdbs/1/rules/debhelper.mk
3
include /usr/share/cdbs/1/class/autotools.mk
4
include /usr/share/cdbs/1/rules/utils.mk
11
5
include /usr/share/cdbs/1/rules/patchsys-quilt.mk
13
7
DEB_DH_INSTALL_SOURCEDIR := debian/tmp
14
include /usr/share/cdbs/1/rules/debhelper.mk
15
include /usr/share/cdbs/1/class/autotools.mk
16
DEB_CONFIGURE_EXTRA_FLAGS := --with-zlib --without-icu --with-clucene=/usr
17
DEB_DH_MAKESHLIBS_ARGS_libsword6 := -V"libsword6 (>= 1.5.9-3)"
18
DEB_SHLIBDEPS_INCLUDE_libsword6 := debian/tmp/usr/lib
19
DEB_SHLIBDEPS_INCLUDE_diatheke := debian/libsword6/usr/lib
8
DEB_CONFIGURE_EXTRA_FLAGS := --with-zlib --with-clucene=/usr --with-icu --enable-tests --enable-debug
9
DEB_DH_MAKESHLIBS_ARGS_libsword8 := -V"libsword8 (>= 1.6)"
10
DEB_SHLIBDEPS_INCLUDE_libsword8 := debian/tmp/usr/lib
11
DEB_SHLIBDEPS_INCLUDE_diatheke := debian/libsword8/usr/lib
12
DEB_DBG_PACKAGE_libsword8 := libsword-dbg
13
#CppUnitTestSuite - currently broken
14
#DEB_MAKE_CHECK_TARGET := check
20
15
#DEB_OPT_FLAG=-g -O0 -Werror
18
#Running Shell based Testsuite
19
$(shell cd tests/testsuite && ./runall.sh 1>&2)
20
# The next three rules use chrpath to remove unwanted rpath info
21
# from the compiled binaries when they are built on amd64.
22
chrpath -d $(CURDIR)/lib/.libs/libsword.so*
23
chrpath -d $(CURDIR)/utilities/.libs/*
24
chrpath -d $(CURDIR)/utilities/diatheke/.libs/diatheke
26
for file in `ls debian/*.pod`;\
28
base=`basename $$file .pod`;\
29
name=`basename $$base .1 | tr '[a-z]' '[A-Z]'`;\
30
pod2man --release=$$VERSION --center "" -n $$name $$file > $$base;\
34
#checking for missing files
38
# Makefile arcanery warning:
39
# $(dir $(_)) gives us the path containing this rules file.
40
# This magic care of Emmet Hickory:
41
# (http://lists.debian.org/debian-devel-games/2008/02/msg00135.html)
43
TEMP_DIR := $(shell mktemp -d)
44
SOURCE_DIR = $(shell ls $(TEMP_DIR) | grep sword- | grep .tar.gz | sed s/.tar.gz//)
45
SOURCE_VER = $(shell echo $(notdir $(SOURCE_DIR)) | sed s/sword-//)
48
uscan --download --package sword --destdir=$(TEMP_DIR) \
49
--no-symlink --upstream-version 0 --watchfile=$(dir $(_))/watch
50
cd $(TEMP_DIR) && tar zxf sword-*.tar.gz
52
remove-unwanted-files: download-tarball
53
# zlib is (mostly) an old copy of the zlib library
54
# Leave only untgz.c which is needed and not part of zlib
55
rm $(TEMP_DIR)/$(SOURCE_DIR)/src/utilfuns/zlib/[a-tv-z]*
56
rm $(TEMP_DIR)/$(SOURCE_DIR)/src/utilfuns/zlib/uncompr.c
57
rm $(TEMP_DIR)/$(SOURCE_DIR)/include/zlib.h
58
# regex.c and regex.h are GNU C library files
59
rm $(TEMP_DIR)/$(SOURCE_DIR)/src/utilfuns/regex.c
60
rm $(TEMP_DIR)/$(SOURCE_DIR)/include/regex.h
61
# src/utilfuns/win32/* are a non-free dirent for Windows
62
rm -r $(TEMP_DIR)/$(SOURCE_DIR)/src/utilfuns/win32
63
# stdsoap.h is non-free
64
rm $(TEMP_DIR)/$(SOURCE_DIR)/bindings/gsoap/include/stdsoap.h
66
repack-source: remove-unwanted-files
67
cd $(TEMP_DIR) && mv $(SOURCE_DIR) $(SOURCE_DIR)+dfsg && \
68
tar zcf sword_$(SOURCE_VER)+dfsg.orig.tar.gz \
69
$(notdir $(SOURCE_DIR)+dfsg)
71
get-orig-source: repack-source
72
mv $(TEMP_DIR)/sword_$(SOURCE_VER)+dfsg.orig.tar.gz $(CURDIR)