build/package/debian/rules
author nrthomas@gmail.com
Wed, 07 Nov 2007 10:28:11 -0800
changeset 7665 eaa2b0789a8e20736a73fd10df2cc38ce61cce36
parent 1 9b2a99adc05e53cd4010de512f50118594756650
permissions -rwxr-xr-x
Bug 401741, bump nightly version to 3.0b2pre, r=ccooper, a=beltzner

#!/usr/bin/make -f
# Derived from debhelper/dh_make example.

#export DH_VERBOSE=1

# Set by configure (plus USE_AUTOCONF=1), but useful for NSPR
export MOZILLA_CLIENT=1
export BUILD_OPT=1
export NO_STATIC_LIB=1
# untested upstream - export USE_IPV6=$(shell cpp debian/testipv6 | sh -)
export USE_PTHREADS=1

nspr = libnspr3
nsprdev = libnspr3-dev
mailnews = mozilla-mailnews
editor = mozilla-editor
TOP=..

build: build-stamp
build-stamp:
	dh_testdir

	test -d build-nspr || mkdir build-nspr
	test -s build-nspr/lib/$(nspr).so || $(MAKE) -C nsprpub DIST=`pwd`/build-nspr 

	test -d obj-`./build/autoconf/config.guess` || mkdir obj-`./build/autoconf/config.guess`
	cd obj-`./build/autoconf/config.guess` && \
	LD_LIBRARY_PATH=`cd ..;pwd`/build-nspr/lib \
        $(TOP)/configure --verbose --prefix=/usr \
	   --disable-debug --disable-profile --disable-crypto \
	   --disable-netcast --disable-java --disable-oji --disable-static \
	   --disable-tests --disable-smart-mail --enable-mailnews \
	   --enable-editor --enable-ldap --enable-optimize --with-pthreads \
	   --with-jpeg=/usr/include --with-png=/usr/include \
	   --with-zlib=/usr/include --with-nspr=`cd $(TOP);pwd`/build-nspr
	cd obj-`./build/autoconf/config.guess` && LD_LIBRARY_PATH=`cd $(TOP);pwd`/build-nspr/lib $(MAKE)

	touch build-stamp

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp install-stamp

	-cd nsprpub ; $(MAKE) realclean
	rm -rf build-nspr obj-`./build/autoconf/config.guess`
#	find . -type f -name Makefile ! -path '*nsprpub*' | xargs -r rm

	dh_clean

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

	cp -pR build-nspr/lib/*.so* `pwd`/debian/$(nspr)/usr/lib
	cd `pwd`/debian/$(nspr)/usr/lib ; /sbin/ldconfig -n .
#	cd `pwd`/debian/$(nspr)/usr/lib ; for i in * ; do ln -s $$i $$i.0 ; done

	cp -pR build-nspr/include/* `pwd`/debian/$(nsprdev)/usr/include/nspr
	cp -pR build-nspr/lib/*.a `pwd`/debian/$(nsprdev)/usr/lib

	# this may fail, but who cares
	-cp -pR obj-`./build/autoconf/config.guess`/dist/bin/* `pwd`/debian/tmp/usr/lib/mozilla
	install -m 755 `pwd`/debian/runner `pwd`/debian/tmp/usr/bin/mozilla

#	# Okay, lets move a bunch of mail-news stuff to its own place
	# Note:  We have to cd and set sourcedir because the debian directory
	# now lives in mozilla/build/package and dh_movefiles won't work
	# across the symlink.
	cd `pwd`/build/package; \
 	    dh_movefiles --sourcedir=debian/tmp -a

	touch install-stamp

binary-indep: build
# We have nothing to do by default, no architecture-independent files here.

binary-arch: build install
	dh_testdir -a
	dh_testroot -a
	cd debian/ ; cat copyright.short > copyright
	cat LICENSE >> debian/copyright
	dh_installdocs -pmozilla LEGAL
	dh_installdocs -p$(nspr)
	dh_installmime -pmozilla
	rm debian/copyright
#	dh_installexamples `find -name '*.ad'`
	dh_installmenu -pmozilla
# Running this is a baaad idea.
#	dh_installmanpages
	dh_undocumented -pmozilla mozilla.1
	dh_installchangelogs -pmozilla
	dh_installchangelogs -p$(nspr)
	cd `pwd`/debian/$(nsprdev)/usr/doc ; ln -s /usr/doc/$(nspr) ./$(nsprdev)
	cd `pwd`/debian/$(mailnews)/usr/doc ; ln -s /usr/doc/mozilla ./$(mailnews)
	cd `pwd`/debian/$(editor)/usr/doc ; ln -s /usr/doc/mozilla ./$(editor)
	dh_strip -a
	dh_compress -a
	dh_fixperms -a
	dh_installdeb -a
	cd debian ; cat $(nspr).shlibs > shlibs.local
	env LD_LIBRARY_PATH=`pwd`/debian/$(nspr)/usr/lib:`pwd`/debian/tmp/usr/lib/mozilla \
	  dh_shlibdeps -pmozilla -plibnspr3 -p$(mailnews) -p$(editor)
	rm -f debian/shlibs.local
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

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 # quicktest make