Menu

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

Download this file

248 lines (220 with data), 6.8 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

# Read http://wiki.debian.org/PkgSplit "How to split a package into several 
# smaller packages" for details of this file.
# 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
# builddir for using dh_install for .war files.

# Copyright (C) 2007  Andre Felipe Machado <andremachado@techforce.com.br>
# et al from Debian Project http://www.debian.org , Joey Hess, Craig Small.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

	BUILDDIR := debian/build
	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

# using dpatch for flexibility
configure: patchsource configure-stamp

configure-stamp:
	dh_testdir
	# Add here commands to configure the package.
#	phpize --clean
	phpize
	./configure --with-java=/usr/lib/jvm/java-6-sun --prefix=${DESTDIR}
	touch configure-stamp

build: build-stamp

# 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 $@

# 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.

# specifiy destdir debian way
	$(MAKE) install DESTDIR=${DESTDIR}

# avoid multiple binary packages conflicts
installbasic: build
	dh_testdir
	dh_testroot
	dh_clean -k 
	dh_installdirs 

# Build architecture-independent files here.
# 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

# 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 -i -p$@
	dh_installchangelogs -i -p$@ ChangeLog
	dh_installdocs -i -p$@
#	dh_installexamples -p$@
# using dh_installdirs and dh_install for this task
# note the absence of leading "/"
	dh_install -i --list-missing --package=$@ ${BUILDDIR}$(PHP_EXT_DIR)/JavaBridge.war var/lib/tomcat5/webapps
#	dh_install -i -p$@
#	dh_installmenu -i -p$@
#	dh_installdebconf -i -p$@
#	dh_installlogrotate -i -p$@
#	dh_installemacsen -i -p$@
#	dh_installpam -i -p$@
#	dh_installmime -i -p$@
#	dh_python -i -p$@
#	dh_installinit -i -p$@
#	dh_installcron -i -p$@
#	dh_installinfo -i -p$@
	dh_installman -i -p$@
	dh_link -i -p$@
	dh_strip -i
	dh_compress -i -p$@
	dh_fixperms -i -p$@
#	dh_perl -i -p$@
#	dh_makeshlibs -i -p$@
	dh_installdeb -i -p$@
	dh_shlibdeps -i -p$@
	dh_gencontrol -i -p$@
	dh_md5sums -i -p$@
	dh_builddeb -i -p$@

# 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 -i -p$@
	dh_installchangelogs -i -p$@ ChangeLog
	dh_installdocs -i -p$@
	dh_installexamples -i -p$@
	dh_install -i --list-missing -p$@ ${BUILDDIR}$(PHP_EXT_DIR)/*.jar $(PHP_INCLUDE_DIR)/ext/php-java-bridge
#	dh_install -i -p$@
#	dh_installmenu -i -p$@
#	dh_installdebconf -i -p$@
#	dh_installlogrotate -i -p$@
#	dh_installemacsen -i -p$@
#	dh_installpam -i -p$@
#	dh_installmime -i -p$@
#	dh_python -i -p$@
#	dh_installinit -i -p$@
#	dh_installcron -i -p$@
#	dh_installinfo -i -p$@
	dh_installman -i -p$@
	dh_link -i -p$@
	dh_strip -i
	dh_compress -i -p$@
	dh_fixperms -i -p$@
#	dh_perl -i -p$@
#	dh_makeshlibs -i -p$@
	dh_installdeb -i -p$@
	dh_shlibdeps -i -p$@
	dh_gencontrol -i -p$@
	dh_md5sums -i -p$@
	dh_builddeb -i -p$@

# 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 -i ChangeLog
	dh_installdocs -i
#	dh_installexamples -i
#	dh_install -i
#	dh_installmenu -i
#	dh_installdebconf -i	
#	dh_installlogrotate -i
#	dh_installemacsen -i
#	dh_installpam -i
#	dh_installmime -i
#	dh_python -i
#	dh_installinit -i
#	dh_installcron -i
#	dh_installinfo -i
	dh_installman -i
	dh_link -i
	dh_strip -i
	dh_compress -i
	dh_fixperms -i
#	dh_perl -i
#	dh_makeshlibs -i
	dh_installdeb -i
	dh_shlibdeps -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs -a ChangeLog
	dh_installdocs -a
#	dh_installexamples -a
	dh_install --exclude=JavaBridge.war -a --list-missing ${BUILDDIR}$(PHP_EXT_DIR)/* $(PHP_EXT_DIR)
#	dh_installmenu -a
#	dh_installdebconf -a	
#	dh_installlogrotate -a
#	dh_installemacsen -a
#	dh_installpam -a
#	dh_installmime -a
#	dh_python -a
#	dh_installinit -a
#	dh_installcron -a
#	dh_installinfo -a
	dh_installman -a
	dh_link -a
	dh_strip -a
	dh_compress -a
	dh_fixperms -a
#	dh_perl -a
#	dh_makeshlibs -a
	dh_installdeb -a
	dh_shlibdeps -a
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

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

# 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
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.