File: rules

package info (click to toggle)
sword 1.6.1%2Bdfsg-2
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 11,176 kB
  • ctags: 4,460
  • sloc: cpp: 38,894; sh: 9,435; ansic: 4,727; makefile: 1,230; java: 929; perl: 782; pascal: 681; tcl: 350
file content (74 lines) | stat: -rwxr-xr-x 2,895 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
#!/usr/bin/make -f
include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/autotools.mk
include /usr/share/cdbs/1/rules/utils.mk 
include /usr/share/cdbs/1/rules/patchsys-quilt.mk

DEB_DH_INSTALL_SOURCEDIR := debian/tmp
DEB_CONFIGURE_EXTRA_FLAGS := --with-zlib --with-clucene=/usr --with-icu --enable-tests --enable-debug --without-internalregex
DEB_DH_MAKESHLIBS_ARGS_libsword8 := -V"libsword8 (>= 1.6)"
DEB_SHLIBDEPS_INCLUDE_libsword8 := debian/tmp/usr/lib
DEB_SHLIBDEPS_INCLUDE_diatheke := debian/libsword8/usr/lib
DEB_DBG_PACKAGE_libsword8 := libsword-dbg
#CppUnitTestSuite - currently broken
#DEB_MAKE_CHECK_TARGET := check
DEB_OPT_FLAG := -g -O3 -Wall -Werror
DEB_INSTALL_CHANGELOGS_ALL = ChangeLog

build/libsword8::
	#Running Shell based Testsuite
	$(shell cd tests/testsuite && ./runall.sh 1>&2)
	# The next three rules use chrpath to remove unwanted rpath info 
	# from the compiled binaries when they are built on amd64.
	chrpath -d $(CURDIR)/lib/.libs/libsword.so*
	chrpath -d $(CURDIR)/utilities/.libs/*
	chrpath -d $(CURDIR)/utilities/diatheke/.libs/diatheke

	for file in `ls debian/*.pod`;\
	do\
		base=`basename $$file .pod`;\
		name=`basename $$base .1 | tr '[a-z]' '[A-Z]'`;\
		pod2man --release=$$VERSION --center "" -n $$name $$file > $$base;\
	done

binary: list-missing
	#checking for missing files
clean/::
	rm -f *.1

# Makefile arcanery warning:
# $(dir $(_)) gives us the path containing this rules file.
# This magic care of Emmet Hickory:
# (http://lists.debian.org/debian-devel-games/2008/02/msg00135.html)

TEMP_DIR := $(shell mktemp -d)
SOURCE_DIR = $(shell ls $(TEMP_DIR) | grep sword- | grep .tar.gz | sed s/.tar.gz//)
SOURCE_VER = $(shell echo $(notdir $(SOURCE_DIR)) | sed s/sword-//)

download-tarball:
	uscan --download --package sword --destdir=$(TEMP_DIR) \
	      --no-symlink --upstream-version 0 --watchfile=$(dir $(_))/watch
	cd $(TEMP_DIR) && tar zxf sword-*.tar.gz

remove-unwanted-files: download-tarball
	# zlib is (mostly) an old copy of the zlib library
	# Leave only untgz.c which is needed and not part of zlib
	rm $(TEMP_DIR)/$(SOURCE_DIR)/src/utilfuns/zlib/[a-tv-z]*
	rm $(TEMP_DIR)/$(SOURCE_DIR)/src/utilfuns/zlib/uncompr.c
	rm $(TEMP_DIR)/$(SOURCE_DIR)/include/zlib.h
	# regex.c and regex.h are GNU C library files
	rm $(TEMP_DIR)/$(SOURCE_DIR)/src/utilfuns/regex.c
	rm $(TEMP_DIR)/$(SOURCE_DIR)/include/internal/regex/regex.h
	# src/utilfuns/win32/* are a non-free dirent for Windows 
	rm -r $(TEMP_DIR)/$(SOURCE_DIR)/src/utilfuns/win32
	# stdsoap.h is non-free
	rm $(TEMP_DIR)/$(SOURCE_DIR)/bindings/gsoap/include/stdsoap.h

repack-source: remove-unwanted-files
	cd $(TEMP_DIR) && mv $(SOURCE_DIR) $(SOURCE_DIR)+dfsg && \
		tar zcf sword_$(SOURCE_VER)+dfsg.orig.tar.gz \
		$(notdir $(SOURCE_DIR)+dfsg)

get-orig-source: repack-source
	mv $(TEMP_DIR)/sword_$(SOURCE_VER)+dfsg.orig.tar.gz $(CURDIR)
	rm -r $(TEMP_DIR)