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 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237
|
#!/usr/bin/make -f
# Sample debian/rules that uses debhelper.
# GNU copyright 1997 to 1999 by Joey Hess.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
SHELL=/bin/bash # I use bashisms
# build phoenix
export MOZ_PHOENIX=1
export MOZ_FIREBIRD=1
export MOZ_FIREFOX=1
export BUILD_OFFICIAL=1
export MOZILLA_OFFICIAL=1
#export MOZ_INTERNAL_LIBART_LGPL=1
PHOENIX := mozilla-firefox
PHOENIX_CVS := mozilla
# things to remove from upstream tarball cause we don't need them
UPSTREAM_REMOVE := debian mailnews themes/modern editor/ui \
editor/composer/src lib/mac
DEBIAN_VERSION := $(shell dpkg-parsechangelog | sed -n 's/Version: *\(.*\)/\1/ p')
UPSTREAM_VERSION := $(shell echo $(DEBIAN_VERSION) | sed 's/-.*$$//')
LIB_DIR := /usr/lib/mozilla-firefox
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
OPTFLAGS = -O0
else
OPTFLAGS = -O2
ifeq ($(DEB_BUILD_ARCH),ia64)
OPTFLAGS=-O
endif
ifeq ($(DEB_BUILD_ARCH),powerpc)
OPTFLAGS=-O
endif
ifeq ($(DEB_BUILD_ARCH),arm)
OPTFLAGS=-O
endif
endif
OPTFLAGS += -DDEBIAN
DEBUG_FLAG=
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
DEBUG_FLAG = --enable-debug
endif
ifeq ($(DEB_BUILD_ARCH),amd64)
CC=gcc-3.4
CXX=g++-3.4
export CC CXX
endif
CONFIGURE_OPTIONS = \
--enable-default-toolkit=gtk2 \
--with-default-mozilla-five-home=$(LIB_DIR) \
--with-user-appdir=.mozilla \
--with-system-mng=/usr \
--with-system-png=/usr \
--with-system-jpeg=/usr \
--disable-mailnews \
--disable-composer \
--disable-ldap \
--enable-postscript \
--disable-installer \
--enable-xprint \
--enable-crypto \
--enable-strip-libs \
--disable-svg \
--enable-mathml \
--disable-tests \
--disable-gtktest \
--disable-debug \
--enable-xft \
--enable-optimize="-pipe -w $(OPTFLAGS)" \
--with-system-zlib=/usr \
--with-gssapi=/usr \
--without-system-nspr \
--enable-xinerama \
--enable-extensions=cookie,xml-rpc,xmlextras,pref,transformiix,universalchardet,webservices,inspector,gnomevfs,negotiateauth \
--disable-pedantic \
--disable-long-long-warning \
--enable-single-profile \
--disable-profilesharing \
--enable-gnomevfs \
$(DEBUG_FLAG)
ifneq ($(DEB_BUILD_ARCH),mips)
ifneq ($(DEB_BUILD_ARCH),mipsel)
CONFIGURE_OPTIONS += --enable-static --disable-shared
endif
endif
configure: configure-stamp
configure-stamp:
dh_testdir
./configure --prefix=/usr --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info $(CONFIGURE_OPTIONS)
touch configure-stamp
build: configure-stamp build-stamp
build-stamp:
dh_testdir
$(MAKE)
(cd debian && uudecode mozilla-firefox.png.uu \
&& uudecode debsearch.gif.uu)
touch build-stamp
clean:
dh_testdir
dh_testroot
rm -f build-stamp configure-stamp debian/stamp-* \
debian/mozilla-firefox.png debian/debsearch.gif
-$(MAKE) distclean
dh_clean
install: build
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
chmod 755 debian/mozilla-firefox-xremote-client
# Remove execute on javascript files
find debian/tmp -name '*.so' | xargs chmod -x
chmod -x debian/tmp/$(LIB_DIR)/components/*.js
# Exclude inspector for mozilla-firefox
dh_install -pmozilla-firefox '-X*inspector*' '-X*gnome*'
dh_install -pmozilla-firefox-dom-inspector
dh_install -pmozilla-firefox-gnome-support
#Install helpers
install -m 755 debian/mozilla-firefox-runner \
debian/mozilla-firefox/usr/lib/mozilla-firefox/firefox
install -m 755 debian/update-mozilla-firefox-chrome \
debian/mozilla-firefox/usr/sbin/update-mozilla-firefox-chrome
# Filter installed chrome
egrep -v 'inspector\.jar|embed-sample\.jar|classic\.jar' \
debian/tmp/$(LIB_DIR)/chrome/installed-chrome.txt \
> debian/mozilla-firefox/$(LIB_DIR)/chrome/installed-chrome.txt
# Remove installed-extensions.txt
rm -rf 'debian/mozilla-firefox/$(LIB_DIR)/defaults/profile/extensions/installed-extensions.txt'
# Move classic theme's install.rdf to final destination
mv debian/mozilla-firefox/$(LIB_DIR)/defaults/profile/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/install.rdf debian/mozilla-firefox/$(LIB_DIR)/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}/
# Remove unneeded extensions directory
rm -rf debian/mozilla-firefox/$(LIB_DIR)/defaults/profile/extensions/{972ce4c6-7e08-4474-a285-3208198ce6fd}
# Remove unneeded configs
rm -f debian/mozilla-firefox/$(LIB_DIR)/defaults/pref/editor.js \
debian/mozilla-firefox/$(LIB_DIR)/defaults/pref/mailnews.js \
debian/mozilla-firefox/$(LIB_DIR)/defaults/pref/inspector.js \
debian/mozilla-firefox/$(LIB_DIR)/defaults/pref/firefox-l10n.js
# Add Debian package version to preferences
echo // Debian package version \
> debian/mozilla-firefox/$(LIB_DIR)/defaults/pref/vendor.js
echo "pref(\"general.useragent.vendorComment\",\"Debian package $(DEBIAN_VERSION)\");" \
>> debian/mozilla-firefox/$(LIB_DIR)/defaults/pref/vendor.js
# Move profiles into /etc
mv \
debian/mozilla-firefox/$(LIB_DIR)/defaults/profile \
debian/mozilla-firefox/etc/mozilla-firefox/
#Move pretty icons into place
cp -f debian/mozilla-firefox.xpm \
debian/mozilla-firefox/$(LIB_DIR)/icons/default.xpm
cp -f debian/mozilla-firefox.xpm \
debian/mozilla-firefox/$(LIB_DIR)/icons/mozicon50.xpm
cp -f debian/mozilla-firefox-small.xpm \
debian/mozilla-firefox/$(LIB_DIR)/icons/mozicon16.xpm
cp -f debian/mozilla-firefox.xpm \
debian/mozilla-firefox/$(LIB_DIR)/chrome/icons/default/default.xpm
# Build architecture-independent files here.
binary-indep: build install
# Build architecture-dependent files here.
binary-arch: build install
# dh_testversion
dh_testdir
dh_testroot
dh_installdebconf
dh_installdocs
dh_installexamples
dh_installmenu
# dh_installemacsen
# dh_installpam
# dh_installinit
# dh_installcron
dh_installman
dh_installinfo
dh_installmime
# dh_undocumented
dh_installchangelogs
dh_link
dh_strip
dh_compress
dh_fixperms
# dh_makeshlibs
dh_installdeb
# dh_perl
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
source-tarball-from-cvs: clean
cp -af ../$(PHOENIX_CVS) ../$(PHOENIX)-$(UPSTREAM_VERSION).orig
cd ../$(PHOENIX)-$(UPSTREAM_VERSION).orig ; rm -rf mailnews debian
cd ../$(PHOENIX)-$(UPSTREAM_VERSION).orig ; find . -depth \( -name CVS \
-or -name .cvsignore \) -exec rm -rf '{}' \;
cd .. ; tar --remove-files -cf $(PHOENIX)_$(UPSTREAM_VERSION).orig.tar \
$(PHOENIX)-$(UPSTREAM_VERSION).orig
rm -rf ../$(PHOENIX)-$(UPSTREAM_VERSION).orig
gzip -9 ../$(PHOENIX)_$(UPSTREAM_VERSION).orig.tar
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure source-tarball-from-cvs
|