aboutsummaryrefslogtreecommitdiffstats
path: root/debian/rules
blob: d5a05df83c91b2882ef06ce3df178a13ed3a5ee0 (plain) (blame)
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
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
#!/usr/bin/make -f
#-*- makefile -*-
# Made with the aid of dh_make, by Craig Small
# Sample debian/rules that uses debhelper. GNU copyright 1997 by Joey Hess.
# This version is for a hypothetical package that builds an
# architecture-dependant package, as well as an architecture-independant
# package.

package=sword

version=$(shell expr `pwd` : '.*-\([0-9.]*\)')
version_major=$(shell expr `pwd` : '.*-\([0-9]*\).[0-9.]*')

# Uncomment this to turn on verbose mode. 
#export DH_VERBOSE=1

# This is the debhelper compatability version to use.
#export DH_COMPAT=2

ARCH = $(shell dpkg-architecture -qDEB_BUILD_ARCH)
ifeq ($(ARCH),alpha)
        COMPILER_FLAGS=CFLAGS="-O0 -mieee" CXXFLAGS="-O0 -mieee"
endif
PHPENV=EXTRA_INCLUDES="-I../../../include -DSWIG"
PHPEXTDIR=`php-config --extension-dir`

configure: configure-stamp
configure-stamp:
	dh_testdir
	#autoheader
	#autoconf
	chmod 755 configure
	#chmod 755 apps/console/diatheke/configure
	chmod 755 bindings/swig/configure
	$(COMPILER_FLAGS) ./configure --prefix=/usr --mandir=\$${prefix}/share/man \
		--infodir=\$${prefix}/share/info --with-zlib \
		--sysconfdir=/etc --enable-shared --with-icu
	#cd apps/console/diatheke && ./configure --prefix=/usr
	cd bindings/swig && $(COMPILER_FLAGS) ./configure --prefix=/usr \
		--with-sword-dir=`pwd`/../.. --without-swigbin
	cd bindings/swig && $(MAKE) perl_makebuild \
		&& $(MAKE) php_makebuild
	cd bindings/swig/php && phpize && \
		$(COMPILER_FLAGS) ./configure --prefix=/usr --enable-Sword
	touch configure.stamp

build: configure-stamp build-stamp
build-stamp:
	dh_testdir

	$(MAKE)
	cd bindings/swig && $(MAKE) perl_makebuild
	cd bindings/swig/perl && perl Makefile.PL INSTALLDIRS=vendor && \
		$(MAKE) OPTIMIZE="-O2 -g -Wall"
	cd bindings/swig/php && $(PHPENV) $(MAKE)
	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	-$(MAKE) distclean
	-cd bindings/swig/perl && $(MAKE) clean
	-cd bindings/swig/php && $(MAKE) distclean && rm -rf modules
	-cd bindings/swig && $(MAKE) distclean
	rm -f build-stamp configure-stamp install-stamp lib/lib* \
		config.h config.status config.log config.cache
	dh_clean

install: install-stamp
install-stamp: build-stamp
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	# Add here commands to install the package into debian/tmp.
	\$(MAKE) install DESTDIR=`pwd`/debian/tmp
	cd bindings/swig/perl && \
		$(MAKE) install PREFIX=`pwd`/../../../debian/libsword-perl/usr
	#cd bindings/swig/php && \
		$(MAKE) install DESTDIR=`pwd`/../../../debian/php-sword
	dh_install bindings/swig/php/modules/*.so $(PHPEXTDIR) 

	dh_movefiles -pphp4-sword usr/lib/php4/*
	dh_movefiles -plibsword-dev usr/lib/lib*so usr/lib/lib*.a \
		usr/include/*
	dh_movefiles -pdiatheke usr/bin/diatheke
	dh_movefiles -plibsword-runtime usr/bin/*
	mkdir -p debian/libsword-dev/usr/share/doc/libsword-dev/html
	cp -R doc/api-documentation/html debian/libsword-dev/usr/share/doc/libsword-dev
	mkdir -p debian/diatheke/usr/share/doc/diatheke/examples
	cp -a apps/console/diatheke/cgi/index-public.html debian/diatheke/usr/share/doc/diatheke/examples
	cp -a apps/console/diatheke/cgi/*.pl debian/diatheke/usr/lib/cgi-bin
	cp -a apps/console/diatheke/README debian/diatheke/usr/share/doc/diatheke
	touch install-stamp

# Build architecture-independent files here.
binary-indep: build install
	dh_testdir

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir 
	dh_testroot 
	dh_installdocs 
	dh_installexamples 
	dh_installinfo
	dh_installmenu 
	#dh_installmanpages
	dh_installman
	dh_undocumented
	dh_installchangelogs ChangeLog
	dh_strip 
	dh_link 
	dh_compress 
	dh_fixperms 
	dh_installdeb
	dh_makeshlibs -V 'libsword1 (>=1.5.3-1)'
	dh_perl 
	dh_shlibdeps -ldebian/tmp/usr/lib
	dh_gencontrol 
	dh_md5sums 
	dh_builddeb 

#source diff:                                                                  
#	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false

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