#!/usr/bin/make -f include /usr/share/cdbs/1/rules/debhelper.mk # # srcdir contains the unpacked qt sources, which are configured by # # the configure.sh script in the toplevel directory. # srcdir=qt package = mingw-w64-qt4 mkspecname = mingw-w64-cross target=x86_64-pc-mingw32 docdir = debian/$(package)/usr/share/doc/$(package) qmkspecdir=/usr/$(target)/share/qt4/mkspecs BASEDIR = $(shell /bin/pwd) DESTDIR = $(BASEDIR)/debian/$(package) QMAKE=$(target)-qmake-qt4 docpackage = mingw-w64-qt4-doc examplespackage = mingw-w64-qt4-examples demospackage = mingw-w64-qt4-demos DEB_INSTALL_DOCS_ALL := $(srcdir)/LICENSE.LGPL $(srcdir)/LGPL_EXCEPTION.txt DEB_SHLIBDEPS_INCLUDE := DEB_DH_ALWAYS_EXCLUDE := .svn # do not strip anything. # call 'strip' on a mingw lib*.a file causes the ranlib information to # be discarded rendering the libraries useless. DEB_DH_STRIP_ARGS := -Xlib INSTALL_PROGRAM = install QTCONFIG=$(shell sed 's/^CONFIG *+= *//p;d' < $(srcdir)/qmake.cache.in) common-build-arch:: rm -f $(srcdir)/mkspecs/$(mkspecname) cd $(srcdir)/mkspecs && ln -s $(qmkspecdir)/$(mkspecname) . rm -f $(srcdir)/bin/lrelease cd $(srcdir)/bin && ln -s /usr/bin/lrelease-qt4 lrelease sed -e s,@builddir@,$(BASEDIR)/$(srcdir),g -e s,@sourcedir@,$(BASEDIR)/$(srcdir),g < $(srcdir)/qmake.cache.in > $(srcdir)/.qmake.cache cd $(srcdir) && $(QMAKE) -recursive QT_CFLAGS_MYSQL=-I/usr/$(target)/include/mysql QT_LFLAGS_MYSQL=-lmysql *.pro cd $(srcdir) && make INSTALL_ROOT=$(DESTDIR) rm -f $(srcdir)/mkspecs/$(mkspecname) touch common-build-arch clean:: rm -f compile common-build-arch common-install-arch rm -rf *~ debian/$(package) debian/*~ debian/files* debian/substvars debian/compat rm -rf debian/$(docpackage) debian/$(examplespackage) debian/$(demospackage) cd $(srcdir) && make distclean || /bin/true rm -f $(srcdir)/.qmake.cache rm -f $(srcdir)/mkspecs/$(mkspecname) rm -f $(srcdir)/bin/lrelease common-install-arch:: rm -rf debian/$(package) debian/$(docpackage) debian/$(examplespackage) debian/$(demospackage) rm -f $(srcdir)/mkspecs/$(mkspecname) cd $(srcdir)/mkspecs && ln -s $(qmkspecdir)/$(mkspecname) . cd $(srcdir) && make INSTALL_ROOT=$(DESTDIR) install rm -f $(srcdir)/mkspecs/$(mkspecname) rm -rf debian/$(package)$(qmkspecdir)/$(mkspecname) rm -rf debian/$(package)$(qmkspecdir)/default mkdir -p debian/$(package)/usr/$(target) cd debian/$(package)/usr/$(target)/lib && for file in *.dll; do cmp -s $$file ../bin/$$file && rm $$file && ln -s ../bin/$$file $$file; done mkdir -p debian/$(docpackage)/usr/$(target)/share/qt4 mv debian/$(package)/usr/$(target)/share/qt4/doc debian/$(docpackage)/usr/$(target)/share/qt4 mkdir -p debian/$(examplespackage)/usr/$(target)/lib/qt4 mv debian/$(package)/usr/$(target)/lib/qt4/examples debian/$(examplespackage)/usr/$(target)/lib/qt4 mkdir -p debian/$(demospackage)/usr/$(target)/lib/qt4 mv debian/$(package)/usr/$(target)/lib/qt4/demos debian/$(demospackage)/usr/$(target)/lib/qt4 mkdir -p debian/$(package)/usr/$(target)/lib/pkgconfig cd pc; for file in *.pc; do sed -e's/__qtconfig__/$(QTCONFIG)/' -e 's/__VERSION__/$(DEB_UPSTREAM_VERSION)/' -e 's/__arch__/$(target)/' < $$file > ../debian/$(package)/usr/$(target)/lib/pkgconfig/$$file; done chmod 0755 debian/$(package)/usr/$(target)/bin/*.exe touch common-install-arch