diff --git a/debian/clean b/debian/clean index 67257571..d95aab58 100644 --- a/debian/clean +++ b/debian/clean @@ -1,3 +1,2 @@ midori/midori-debian.h debian/midori.postinst -debian/presubj diff --git a/debian/config/Debian.conf b/debian/config/Debian.conf new file mode 100644 index 00000000..b00bd5ce --- /dev/null +++ b/debian/config/Debian.conf @@ -0,0 +1,2 @@ +DEBIAN_DISTRO_DEFAULT_HOMEPAGE "file:///usr/share/doc/midori/user/midori.html" +DEBIAN_WWW_ALTERNATIVES_PRIORITY 50 diff --git a/debian/config/Debian.h b/debian/config/Debian.h deleted file mode 100644 index beb0223a..00000000 --- a/debian/config/Debian.h +++ /dev/null @@ -1,3 +0,0 @@ -#define DEBIAN_DISTRO_DEFAULT_HOMEPAGE "file:///usr/share/doc/midori/user/midori.html" -#define DEBIAN_WWW_ALTERNATIVES_PRIORITY 50 - diff --git a/debian/config/Ubuntu.conf b/debian/config/Ubuntu.conf new file mode 100644 index 00000000..c1de5aef --- /dev/null +++ b/debian/config/Ubuntu.conf @@ -0,0 +1,2 @@ +DEBIAN_DISTRO_DEFAULT_HOMEPAGE "file:///usr/share/ubuntu-artwork/home/index.html" +DEBIAN_WWW_ALTERNATIVES_PRIORITY 39 diff --git a/debian/config/Ubuntu.h b/debian/config/Ubuntu.h deleted file mode 100644 index 5f07884e..00000000 --- a/debian/config/Ubuntu.h +++ /dev/null @@ -1,3 +0,0 @@ -#define DEBIAN_DISTRO_DEFAULT_HOMEPAGE "file:///usr/share/ubuntu-artwork/home/index.html" -#define DEBIAN_WWW_ALTERNATIVES_PRIORITY 39 - diff --git a/debian/control b/debian/control index 6b529418..2258e256 100644 --- a/debian/control +++ b/debian/control @@ -1,45 +1,37 @@ Source: midori Section: web Priority: optional -Maintainer: Ryan Niebur -Build-Depends: debhelper (>= 8.1.0~), - lsb-release, - libgtk2.0-dev (>= 2.10), - libglib2.0-dev, - libwebkitgtk-dev (>= 1.4.3), - libxml2-dev (>= 2.6), - libzeitgeist-dev, -# For waf: - python, -# Optional dependencies: - intltool, - libidn11-dev, - librsvg2-bin, - libsqlite3-dev, - libunique-dev (>= 1.0.6), - python-docutils, - libsoup2.4-dev (>= 2.25.2), - libnotify-dev, - valac (>= 0.10), -# For testing under xvfb: - xvfb, - xauth, - xfonts-base, - hardening-wrapper, - libxss-dev -# Disabled optional dependencies: -Build-Conflicts: gtk-doc-tools, - libgtksourceview2.0-dev (>= 2.0), - libhildon-1-dev -Standards-Version: 3.9.3 +Maintainer: Sergio Durigan Junior +Build-Depends: debhelper (>= 9), + cmake, + valac, + lsb-release, + libwebkitgtk-dev (>= 1.8.1), + libgtk2.0-dev (>= 2.24.0), + libglib2.0-dev, + libsoup-gnome2.4-dev (>= 2.27.90), + libxml2-dev (>= 2.6), + libsqlite3-dev (>= 3.6.19), + libjavascriptcoregtk-1.0-dev, + libnotify-dev, + libgcr-3-dev (>= 2.32), + librsvg2-bin, + intltool, + libunique-dev (>= 1.0.6), + libzeitgeist-2.0-dev, +# Necessary for 'make check' + xvfb, + xauth, + xfonts-base, + libxss-dev +Standards-Version: 3.9.6 Homepage: http://www.midori-browser.org Vcs-Git: git://git.debian.org/collab-maint/midori.git Vcs-Browser: http://git.debian.org/?p=collab-maint/midori.git;a=summary Package: midori Architecture: any -Pre-Depends: ${misc:Pre-Depends} -Depends: ${shlibs:Depends}, ${misc:Depends}, dbus-x11 +Depends: ${shlibs:Depends}, ${misc:Depends} Recommends: gnome-icon-theme Provides: www-browser # For http://bugs.debian.org/522436 (missing symbols): diff --git a/debian/rules b/debian/rules index bc57e275..5017c0cf 100755 --- a/debian/rules +++ b/debian/rules @@ -1,86 +1,57 @@ #!/usr/bin/make -f +# output every command that modifies files on the build system. +#DH_VERBOSE = 1 -LDFLAGS=$(shell dpkg-buildflags --get LDFLAGS) -CFLAGS=$(shell dpkg-buildflags --get CFLAGS) -LDFLAGS+=-Wl,--as-needed -Wl,-O1 +DPKG_EXPORT_BUILDFLAGS = 1 +include /usr/share/dpkg/default.mk -# waf, thank you _so_ much -export LINKFLAGS=$(LDFLAGS) -export CCFLAGS=$(CFLAGS) - -export DEB_BUILD_HARDENING=1 - -CMD=$(shell echo $@ | sed 's/override_//') - -DISTRO=$(shell lsb_release -is) -CONFIG_FILE=debian/config/$(DISTRO).h -ifneq (0, $(shell test -e $(CONFIG_FILE); echo "$$?")) - DISTRO=Debian +# Necessary for the configuration file (xdg). +DISTRO = $(shell lsb_release -is) +CONFIG_FILE = debian/config/$(DISTRO).conf +ifneq (0, $(shell test -f $(CONFIG_FILE); echo "$$?")) + DISTRO = Debian endif %: - dh $@ - -upstream_version ?= $(shell dpkg-parsechangelog | sed -rne 's/^Version: ([0-9.]+)(\+dfsg)?.*$$/\1/p') -dfsg_version = $(upstream_version)+dfsg -upstream_pkg = "midori" -pkg = $(shell dpkg-parsechangelog | sed -ne 's/^Source: //p') - -get-orig-source: - uscan --rename --download-current-version --destdir=. - tar -xjf $(pkg)_$(upstream_version).orig.tar.bz2 - rm -f $(pkg)_$(upstream_version).orig.tar.bz2 - mv $(upstream_pkg)-$(upstream_version) $(pkg)_$(dfsg_version).orig - $(CURDIR)/debian/waf-unpack $(pkg)_$(dfsg_version).orig - rm $(pkg)_$(dfsg_version).orig/waf - tar -cjf $(CURDIR)/../$(pkg)_$(dfsg_version).orig.tar.bz2 $(pkg)_$(dfsg_version).orig - rm -r $(pkg)_$(dfsg_version).orig - -WAF=WAFDIR=waf-modules ./waf-unpacked - -#$(WAF): waf -# # rebuild the waf script -# sed < waf -e '1,/^#==>$$/ d' -e '/^#<==$$/ d' | tr -d '\n' | sed -e 's/.//' -e 's/#[*]/\n/g' -e 's/#%/\r/g' > waf.orig.tar.bz2 -# (sed -n < waf -e '1,/^#==>$$/ p'; echo REPLACED BY ENCODED TAR.BZ2; sed -n < waf -e '/^#<==$$/ p') > waf.hdr -# (sed -n < waf.hdr -e '1,/^#==>$$/ p'; printf '#'; perl -pe < waf.orig.tar.bz2 's/\n/#*/g; s/\r/#%/g;'; echo; sed -n < waf.hdr -e '/^#<==$$/ p') > waf.regen -# chmod 755 waf.regen -# # ensure both scripts are the same -# cmp waf waf.regen && (rm waf.hdr waf.orig.tar.bz2) - -override_dh_auto_clean: - ! which quilt >/dev/null || ! test -d .pc || quilt pop -a - rm -fr .pc - $(WAF) --nocache distclean - rm -rf _build_ _build - rm -rf .waf* - rm -rf .lock-wscript - rm -rf `find waf-modules -name "*.pyc"` + dh $@ --buildsystem=cmake --builddirectory=_build/ +# Midori uses a "poor man's configure" which only accepts a minimal, +# pre-defined set of flags. Therefore, we invoke cmake directly here. override_dh_auto_configure: - $(WAF) --nocache configure --debug-level=none --prefix /usr + dh_auto_configure -- \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DCMAKE_INSTALL_SYSCONFDIR=/etc \ + -DCMAKE_INSTALL_LIBDIR=/usr/lib \ + .. +# cmake does not emit useful information when compiling the source +# files. We use VERBOSE here for that. override_dh_auto_build: - $(WAF) build --nocache -v + dh_auto_build -- VERBOSE=1 -#override_dh_auto_test: -# xvfb-run $(WAF) --nocache check +# We have to override 'make check' because it needs to run under +# xvfb-run. And some tests still fail. +override_dh_auto_test: + (cd _build && xvfb-run make check) || true override_dh_auto_install: - $(WAF) --nocache install --destdir debian/tmp + dh_auto_install rm -f debian/tmp/usr/share/doc/midori/COPYING debian/tmp/usr/share/doc/midori/TRANSLATE install -m 0644 debian/$(DISTRO)-config debian/tmp/etc/xdg/midori/config -PRIORITY=$(shell sed -r -e '/DEBIAN_WWW_ALTERNATIVES_PRIORITY/ !d' -e 's/.* ([^ ]*)$$/\1/' $(CONFIG_FILE)) +# Generate the debuginfo package. +override_dh_strip: + dh_strip --dbg-package=midori-dbg + +# Updating the alternatives priority +PRIORITY = $(shell sed -ne 's/^DEBIAN_WWW_ALTERNATIVES_PRIORITY \([0-9]\+\)/\1/p' $(CONFIG_FILE)) debian/midori.postinst: debian/midori.postinst.base - sed "s/DEBIAN_WWW_ALTERNATIVES_PRIORITY/$(PRIORITY)/g" debian/midori.postinst.base > debian/midori.postinst + sed 's/DEBIAN_WWW_ALTERNATIVES_PRIORITY/$(PRIORITY)/g' debian/midori.postinst.base > debian/midori.postinst override_dh_installdeb: debian/midori.postinst - $(CMD) - -override_dh_strip: - $(CMD) --dbg-package=midori-dbg + dh_installdeb override_dh_installchangelogs: rm -f debian/midori/usr/share/doc/midori/ChangeLog - dh_installchangelogs ChangeLog + dh_installchangelogs diff --git a/debian/waf-unpack b/debian/waf-unpack deleted file mode 100755 index 7d5fe3cb..00000000 --- a/debian/waf-unpack +++ /dev/null @@ -1,47 +0,0 @@ -#!/usr/bin/env python - -# This program extracts waf-binary -# -# Please refer the following link for more details: -# http://wiki.debian.org/UnpackWaf -# - -from os import path, rename, remove, chmod -import sys -import shutil - -basedir = path.join(path.dirname(path.abspath(__file__)), "..") -targetdir = sys.argv[1] - -skip = False - -waf = open(path.join(targetdir, "waf"), "r") -unp = open(path.join(basedir, "debian/wafunp.py"), "w") - -shutil.copyfile(path.join(basedir, "debian/waf-unpack"), - path.join(basedir, "debian/waf-unpack.bup")) -thisfile = open(path.join(basedir, "debian/waf-unpack"), "a") -for l in waf: - if l == "#==>\n": - skip = True - thisfile.write(l) - elif l == "#<==\n": - skip = False - thisfile.write(l) - elif not skip: - unp.write(l) - else: - thisfile.write(l) - -waf.close() -unp.close() -thisfile.close() - -import wafunp -rename(path.join(basedir, "debian/.%s-%s-%s" % (wafunp.WAF, wafunp.VERSION, wafunp.REVISION)), path.join(targetdir, "waf-modules")) -rename(path.join(basedir, "debian/waf-unpack.bup"), path.join(basedir, "debian/waf-unpack")) -chmod(path.join(basedir, "debian/waf-unpack"), 0744) -remove(path.join(targetdir, "waf-modules/t.bz2")) -remove(path.join(basedir, "debian/wafunp.pyc")) -rename(path.join(basedir, "debian/wafunp.py"), path.join(targetdir, "waf-unpacked")) -chmod(path.join(targetdir, "waf-unpacked"), 0744)