All pastes #595396 Raw Edit

Stuff

public text v1 · immutable
#595396 ·published 2007-06-29 14:34 UTC
rendered paste body
#!/usr/bin/make -f
#
# debian/rules by Alexander Sack <asac@debian.org>
#
# $Id: rules,v 1.20.2.1 2004/06/08 17:56:16 alex Exp $

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

include /usr/share/dpatch/dpatch.make

export BUILD_OFFICIAL=1
export MOZILLA_OFFICIAL=1
export MOZ_SUNBIRD=1
export MOZ_CALENDAR=1
export PACKAGE=sunbird

MAKE_OPTS=-C build-dir/mozilla


UPSTREAM_TBZBALL=sunbird-0.3a1-source.tar.bz2
DFSG_TBZBALL=sunbird-0.3a1-dfsg-source.tar.bz2

# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
DEB_BUILD_ARCH      ?= $(shell dpkg-architecture -qDEB_BUILD_ARCH)

CFLAGS = -Wall -g

OPTFLAGS = -O2
                                                                                
#ifeq ($(DEB_BUILD_ARCH),hppa)
#export CC=gcc-3.2
#export CXX=g++-3.2
#endif

ifeq ($(DEB_BUILD_ARCH),amd64)
OPTFLAGS=-O
endif

CONFIGURE_OPTIONS = \
	--enable-application=calendar \
	--enable-plaintext-editor-only \
	--enable-necko-protocols=about,http,ftp,file,jar,res \
	--enable-storage \
	--disable-accessibility \
	--disable-activex \
	--disable-activex-scripting \
	--disable-installer \
	--disable-jsd \
	--disable-mathml \
	--disable-necko-disk-cache \
	--disable-oji \
	--disable-view-source \
	--disable-logging \
	--disable-plugins \
	--disable-cookies \
        --enable-default-toolkit=gtk2 \
	--disable-freetype2 \
        --with-default-mozilla-five-home=/usr/lib/sunbird \
        --with-system-mng=/usr \
        --with-system-png=/usr \
        --with-system-jpeg=/usr \
        --with-system-zlib=/usr \
	--enable-extensions=default \
        --without-system-nspr \
        --disable-debug \
	--enable-optimize=\"$(OPTFLAGS)\" \
	--disable-tests \
       $(NULL)

build-dir/mozilla/config.status: build-dir/mozilla/configure
	dh_testdir
	rm -f build-dir/mozilla/.mozconfig
	# Add here commands to configure the package.
	sh -c "cd build-dir/mozilla; ./configure --host=$(DEB_HOST_GNU_TYPE) \
		--build=$(DEB_BUILD_GNU_TYPE) \
		--prefix=/usr \
		--mandir=\$${prefix}/share/man \
		--infodir=\$${prefix}/share/info \
		--srcdir=. \
		$(CONFIGURE_OPTIONS)"

build-dir:
	mkdir $(CURDIR)/build-dir

extract: extract-stamp

extract-stamp: build-dir
	tar xjf $(CURDIR)/archives/$(DFSG_TBZBALL) -C $(CURDIR)/build-dir/
	cp build-dir/mozilla/nsprpub/config/nspr.m4 build-dir/mozilla/nsprpub/config/sunbird-nspr.m4
	cp debian/sunbird_default.xpm build-dir/mozilla/calendar/sunbird/app/default.xpm
	rm -f build-dir/mozilla/.mozconfig
	touch extract-stamp

dopatch: extract patch-stamp

dounpatch: unpatch

build: extract dopatch build-dir/mozilla/config.status build-stamp

build-stamp: 
	dh_testdir

	# Add here commands to compile the package.
	$(MAKE) -C build-dir/mozilla

	# bug in 0.2 -> remove later
	$(MAKE) -C build-dir/mozilla/xpfe/communicator

	/usr/bin/docbook-to-man debian/sunbird.sgml > debian/sunbird.1
	/usr/bin/docbook-to-man debian/update-sunbird-chrome.sgml > debian/update-sunbird-chrome.8

	touch build-stamp

clean: dounpatch clean-real

clean-real:
	dh_testdir
	dh_testroot
	rm -rf build-dir extract-stamp build-stamp
	dh_clean
	rm -rf debian/tmp-calendar
	rm -rf debian/tmp-offline
	rm -rf debian/tmp-inspector
	rm -rf debian/tmpbuild
	rm -f debian/sunbird.1
	rm -f debian/update-sunbird-chrome.8
	rm -f a.out config.* # configure sometimes leaves files

install:
	dh_testdir
	dh_testroot
	dh_clean -k
	dh_installdirs

	# Add here commands to install the package into debian/sunbird.
	$(MAKE) -C build-dir/mozilla install DESTDIR=$(CURDIR)/debian/tmpbuild

	# bug in 0.2 -> remove later
	$(MAKE) -C build-dir/mozilla/xpfe/communicator install DESTDIR=$(CURDIR)/debian/tmpbuild

freebird:
	tar xjf archives/$(UPSTREAM_TBZBALL) -C archives/ 
	cp debian/sunbird-default.xpm archives/mozilla/calendar/sunbird/app/default.xpm
	cat debian/about-sunbird.png.uu | uudecode -o about-sunbird.png
	cp about-sunbird.png archives/mozilla/calendar/sunbird/base/content/about-sunbird.png
	cat debian/aboutCredits.png.uu | uudecode -o aboutCredits.png
	cp aboutCredits.png about-sunbird.png archives/mozilla/calendar/sunbird/base/content/
	@echo tarring up dfsg tbzball ...
	tar cjf archives/$(DFSG_TBZBALL) -C archives/ mozilla/
	@echo tarred.
	rm about-sunbird.png aboutCredits.png

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

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs 
	dh_installdocs
	dh_installexamples
	dh_install

	rm -rf $(CURDIR)/debian/tmp/usr/lib/sunbird/components/myspell
	# dirty move to var folder for chromes: do it in .install file

#	cp -f $(CURDIR)/debian/tmpbuild/usr/lib/sunbird/chrome/installed-chrome.txt $(CURDIR)/debian/tmp/var/lib/sunbird/chrome.d/base-chrome.txt
	cp -f $(CURDIR)/debian/00_locale-en-US $(CURDIR)/debian/tmp/var/lib/sunbird/locales.d/
#	rm -f $(CURDIR)/debian/tmp/usr/share/sunbird/chrome/installed-chrome.txt
	
	install -m 755 debian/update-sunbird-chrome \
	                debian/tmp/usr/sbin/update-sunbird-chrome

#	install -m 644 debian/dummy-empty-file \
#			debian/tmp/var/lib/sunbird/chrome/chrome.rdf
#	install -m 644 debian/dummy-empty-file \
#			debian/tmp/var/lib/sunbird/chrome/overlayinfo
#	install -m 644 debian/dummy-empty-file \
#			debian/tmp/var/lib/sunbird/chrome/app-chrome.manifest
#	install -m 644 debian/dummy-empty-file \
#			debian/tmp/var/lib/sunbird/defaults.ini
#	install -m 644 debian/dummy-empty-file \
#			debian/tmp/var/lib/sunbird/components.ini
#	install -m 644 debian/dummy-empty-file \
#			debian/tmp/var/lib/sunbird/extensions/Extensions.rdf
#	install -m 644 debian/dummy-empty-file \
#			debian/tmp/var/lib/sunbird/extensions/installed-extensions.txt
#	install -m 644 debian/dummy-empty-file \
#			debian/tmp/var/lib/sunbird/components/xpti.dat
#	install -m 644 debian/dummy-empty-file \
#			debian/tmp/var/lib/sunbird/components/compreg.dat

	dh_installmenu
	dh_installdebconf	
	dh_installman