Menu

[r521]: / trunk / php-java-bridge / debian / rules  Maximize  Restore  History

Download this file

256 lines (210 with data), 6.0 kB

#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.

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

# AFM  27nov2006 variables MUST be set outside target rules
# target rules MUST start at column 1, then followed by ":"
# actions MUST start after a TAB, not blank spaces
# AFM 11dec2006 builddir for using dh_install for .war files.
	BUILDDIR := debian/php-java-bridge
	DESTDIR := ${CURDIR}/${BUILDDIR}
	PHP_EXT_DIR := $(shell /usr/bin/php-config --extension-dir)
	PHP_INCLUDE_DIR := $(shell /usr/bin/php-config --include-dir)


CFLAGS = -Wall -g

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O0
else
	CFLAGS += -O2
endif

# AFM 07dec2006 using dpatch for flexibility
configure: patchsource configure-stamp

configure-stamp:
	dh_testdir
	# Add here commands to configure the package.
#	phpize --clean
	phpize

# AFM 27nov2006
	./configure --with-java=/usr/lib/jvm/java-1.5.0-sun --prefix=${DESTDIR}

	touch configure-stamp




build: build-stamp

# AFM 07dec2006 using dpatch for flexibility, no mv anymore
build-stamp: configure 
	dh_testdir

	# Add here commands to compile the package.
	$(MAKE)
	#docbook-to-man debian/php-java-bridge.sgml > php-java-bridge.1

	touch $@

# AFM 07dec2006 using dpatch for flexibility
clean-patched:
	dh_testdir
	dh_testroot
	rm -f build-stamp configure-stamp

	# Add here commands to clean up after the build process.
	-$(MAKE) clean

	dh_clean 


install: installbasic

	# Add here commands to install the package into debian/php-java-bridge.

# AFM 27nov2006 to specifiy destdir debian way
#	$(MAKE) install-modules DESTDIR=${DESTDIR}
	$(MAKE) install DESTDIR=${DESTDIR}

# AFM 11dec2006 using dh_installdirs and dh_install for this task
# note the absence of leading "/" and one per line to avoid jumping to next rule
installini:
	dh_install java.ini etc/php5/conf.d
	dh_install mono.ini etc/php5/conf.d


# AFM 03apr2007 to avoid multiple binary packages conflicts
installbasic: build
	dh_testdir
	dh_testroot
	dh_clean -k 
	dh_installdirs 

# Build architecture-independent files here.
# AFM 03apr2007 creating also docs package without examples files. See /debian/*.docs file
binary-indep: build install php-java-bridge-j2ee php-java-bridge-docs php-java-bridge-j2ee-docs php-java-bridge-devel

# AFM 03apr2007 creating j2ee package . See /debian/*j2ee.* files
# note the -p$@ to use target name package files in /debian as parameters
php-java-bridge-j2ee: build install

	dh_testdir
	dh_testroot
	dh_installdirs -p$@
	dh_installchangelogs -p$@ ChangeLog
	dh_installdocs -p$@
#	dh_installexamples -p$@
# AFM 11dec2006 using dh_installdirs and dh_install for this task
# note the absence of leading "/"
	dh_install -p$@ ${BUILDDIR}$(PHP_EXT_DIR)/JavaBridge.war var/lib/tomcat5/webapps
	dh_install -p$@
#	dh_installmenu -p$@
#	dh_installdebconf -p$@
#	dh_installlogrotate -p$@
#	dh_installemacsen -p$@
#	dh_installpam -p$@
#	dh_installmime -p$@
#	dh_python -p$@
#	dh_installinit -p$@
#	dh_installcron -p$@
#	dh_installinfo -p$@
	dh_installman -p$@
	dh_link -p$@
	dh_strip
	dh_compress -p$@
	dh_fixperms -p$@
#	dh_perl -p$@
#	dh_makeshlibs -p$@
	dh_installdeb -p$@
	dh_shlibdeps -p$@
	dh_gencontrol -p$@
	dh_md5sums -p$@
	dh_builddeb -p$@


# AFM 03apr2007 creating devel package . See /debian/*devel.* files
# note the -p$@ to use target name package files in /debian as parameters
php-java-bridge-devel: build install
	dh_testdir
	dh_testroot
	dh_installdirs -p$@
	dh_installchangelogs -p$@ ChangeLog
	dh_installdocs -p$@
	dh_installexamples -p$@
	dh_install -p$@ ${BUILDDIR}$(PHP_EXT_DIR)/*.jar $(PHP_INCLUDE_DIR)/ext/php-java-bridge
#	dh_install -p$@
#	dh_installmenu -p$@
#	dh_installdebconf -p$@
#	dh_installlogrotate -p$@
#	dh_installemacsen -p$@
#	dh_installpam -p$@
#	dh_installmime -p$@
#	dh_python -p$@
#	dh_installinit -p$@
#	dh_installcron -p$@
#	dh_installinfo -p$@
	dh_installman -p$@
	dh_link -p$@
	dh_strip
	dh_compress -p$@
	dh_fixperms -p$@
#	dh_perl -p$@
#	dh_makeshlibs -p$@
	dh_installdeb -p$@
	dh_shlibdeps -p$@
	dh_gencontrol -p$@
	dh_md5sums -p$@
	dh_builddeb -p$@





# AFM 03apr2007 creating docs package without examples files. See /debian/*.docs file
# pitfall: packages have "-" in their name. Do not create intermediate rules with this character
php-java-bridge-docs: installdocs

php-java-bridge-j2ee-docs: installdocs

installdocs: build installbasic
	dh_testdir
	dh_testroot
	dh_installchangelogs ChangeLog
	dh_installdocs
#	dh_installexamples
#	dh_install
#	dh_installmenu
#	dh_installdebconf	
#	dh_installlogrotate
#	dh_installemacsen
#	dh_installpam
#	dh_installmime
#	dh_python
#	dh_installinit
#	dh_installcron
#	dh_installinfo
	dh_installman
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
#	dh_perl
#	dh_makeshlibs
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb


# Build architecture-dependent files here.
binary-arch: build install installini
	dh_testdir
	dh_testroot
	dh_installchangelogs ChangeLog
	dh_installdocs
#	dh_installexamples
#	dh_install
#	dh_installmenu
#	dh_installdebconf	
#	dh_installlogrotate
#	dh_installemacsen
#	dh_installpam
#	dh_installmime
#	dh_python
#	dh_installinit
#	dh_installcron
#	dh_installinfo
	dh_installman
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
#	dh_perl
#	dh_makeshlibs
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure installdocs installbasic installini

# AFM 07dec2006 using dpatch for flexibility
unpatch:
	dpatch deapply-all
	rm -rf patch-stamp debian/patched

patchsource: patch-stamp

patch-stamp:
	dpatch apply-all
	dpatch cat-all >patch-stamp

clean: clean-patched unpatch