#!/usr/bin/make -f # -*- makefile -*- # debian/rules for icewm ICEWM_COMMON=$(CURDIR)/debian/icewm-common ICEWM=$(CURDIR)/debian/icewm ICEWM_LITE=$(CURDIR)/debian/icewm-lite ICEWM_EXP=$(CURDIR)/debian/icewm-experimental DOCDIR=/usr/share/doc/icewm-common BDIR=builddir ICONS=$(CURDIR)/debian/icons FDO=$(CURDIR)/debian/fdo CUSTOM=$(CURDIR)/debian/custom cmakeargs = -DDOCDIR=$(DOCDIR) -DHTMLDIR=$(DOCDIR)/html -DICEHELPIDX=/usr/share/doc/icewm-common/html/icewm.html -DCFGDIR=/etc/X11/icewm -DCMAKE_INSTALL_PREFIX=/usr -DVERSION=$(ORIGVERSION) -DCMAKE_VERBOSE_MAKEFILE=ON -DICESOUND=AO -DCONFIG_GDK_PIXBUF_XLIB=on -DCONFIG_XPM=off -DCONFIG_LIBPNG=off -DCONFIG_LIBRSVG=on #-DEXTRA_LIBS="-lsupc++" export DEB_BUILD_MAINT_OPTIONS = hardening=+all DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/buildflags.mk include /usr/share/dpkg/architecture.mk -include /usr/share/quilt/quilt.make CXXFLAGS += $(CPPFLAGS) -DXTERMCMD=x-terminal-emulator -Wall -Wextra ifeq (linux,$(DEB_TARGET_ARCH_OS)) CXXFLAGS += -DUSE_SIGNALFD endif %: dh $@ --parallel -Scmake # DEBVERSION=$(shell dpkg-parsechangelog -SVersion) # that one also works with wheezy DEBVERSION := $(shell dpkg-parsechangelog |grep ^Version | sed -e s,Version:.,,) ORIGVERSION := $(shell echo $(DEBVERSION) | sed -e 's,-[^-]*$$,,' ) ORIGTAG := upstream/$(shell echo $(ORIGVERSION) | sed -e 's,~,,g' ) # dh_auto_build is no help here... PAROPT=$(shell echo $$DEB_BUILD_OPTIONS | sed -e 's,.*parallel=\([0-9]\).*,-j\1,') #build_lite: # $(MAKE) $(PAROPT) -C $(BDIR)-lite # #build_normal: # $(MAKE) $(PAROPT) -C $(BDIR)-normal #config_lite: # mkdir -p $(BDIR)-lite # # this fails on prefering cmake :-( dh_auto_configure --builddirectory=$(BDIR)-lite -- # cd $(BDIR)-lite && cmake .. -DCMAKE_BUILD_TYPE=None $(cmakeargs) -DLITE=on -DEXEEXT=-lite -DCONFIG_XFREETYPE=off -DCONFIG_COREFONTS=on -DXINERAMA=on -DCONFIG_XRANDR=off -DCONFIG_TASKBAR=off -DCONFIG_FDO_MENUS=off -DSKIP_TRANSLATIONS=on -DICESOUND=off # #config_normal: # mkdir -p $(BDIR)-normal # cd $(BDIR)-normal && cmake .. -DCMAKE_BUILD_TYPE=None $(cmakeargs) -DCONFIG_XRANDR=on -DCONFIG_GUIEVENTS=on override_dh_auto_configure: dh_auto_configure -- $(cmakeargs) #override_dh_auto_configure: # $(MAKE) -f debian/rules -j2 config_normal config_lite #override_dh_auto_build: # dh_auto_build # cd debian && for x in -lite -experimental ; do cp -lf icewm.postinst icewm$$x.postinst ; cp -lf icewm.prerm icewm$$x.prerm ; done #override_dh_auto_install: # $(MAKE) -C $(BDIR)-lite install DESTDIR=$(CURDIR)/debian/tmp # $(MAKE) -C $(BDIR)-normal install DESTDIR=$(CURDIR)/debian/tmp override_dh_install: dh_install cd debian && for x in -lite -experimental ; do cp -lf icewm.postinst icewm$$x.postinst ; cp -lf icewm.prerm icewm$$x.prerm ; done # XXX: find out why some settings are not gettint defaults if the file is not present, like WorkspaceNames #cp $(ICEWM_COMMON)/usr/share/doc/icewm-common/preferences $(ICEWM_COMMON)/usr/share/icewm/ # Install Debian custom files install -m 644 $(ICONS)/mutt*.xpm $(ICEWM_COMMON)/usr/share/icewm/icons install -m 644 $(ICONS)/mozilla*.xpm $(ICEWM_COMMON)/usr/share/icewm/icons install -m 644 $(ICONS)/icewm*.xpm $(ICEWM_COMMON)/usr/share/icewm/icons -mv $(ICEWM_COMMON)/usr/share/icewm/taskbar/icewm.xpm $(ICEWM_COMMON)/usr/share/icewm/taskbar/icewm.orig.xpm install -m 644 $(ICONS)/debian.xpm $(ICEWM_COMMON)/usr/share/icewm/taskbar/icewm.xpm mkdir -p $(ICEWM_COMMON)/usr/bin $(ICEWM_COMMON)/etc/X11/icewm install -m 644 $(CUSTOM)/toolbar $(CUSTOM)/menu $(ICEWM_COMMON)/usr/share/icewm install -m 644 debian/README.cfg $(ICEWM_COMMON)/usr/share/icewm/README install -m 755 debian/netstat.sh $(ICEWM_COMMON)/usr/share/icewm # Extra docs #mkdir -p "$(ICEWM_COMMON)/usr/share/doc/icewm-common/FAQ" #cd $(ICEWM_COMMON)/usr/share/doc/icewm-common/FAQ && sgml2html $(CURDIR)/debian/FAQ/source/*.sgml #sgml2txt $(CURDIR)/debian/FAQ/source/*.sgml && col -bx < IceWM-FAQ.txt > $(ICEWM_COMMON)/usr/share/doc/icewm-common/FAQ/IceWM-FAQ.txt cd debian ; for x in icewm icewm-lite icewm-experimental ; do mkdir -p $$x/usr/share/lintian/overrides ; cp $$x.lintian $$x/usr/share/lintian/overrides/$$x ; done sed -e 's,^.link.*fonts.googleapis.*,,' -i "$(ICEWM_COMMON)/usr/share/doc/icewm-common/html/"*.html dh_link -A override_dh_auto_clean: rm -rf $(BDIR)-lite $(BDIR)-normal IceWM-FAQ.txt configure.in # the variants are just symlinks rm -f debian/icewm-*.postinst debian/icewm-*.prerm override_dh_installchangelogs: dh_installchangelogs -picewm-common CHANGES override_dh_fixperms: dh_fixperms chmod a+rx,u+w "$(ICEWM_COMMON)/usr/share/doc/icewm-common/examples/startup" override_dh_compress: dh_compress cleancruft: git clean -fdx -e .cproject -e .project -e .settings git checkout HEAD -- README.md configure.ac configure.in ChangeLog set-orig-snapshot: lc=$$(git reflog icewm-1-4-BRANCH | head -n1 | cut -f1 -d" ") && dd=$$(date +\%Y\%m\%d) && ov=$$(dpkg-parsechangelog -S Version) && pfx=$$(echo $$ov | sed -e 's,mod.*,mod,') && echo $$lc $$dd $$ov $$pfx && dch --newversion $$pfx+$$dd+$$lc-1 # builds a snapshot of the upstream branch after some plausibility checks get-orig-source: ! test -e ../icewm_$(ORIGVERSION).orig.tar.xz || (echo Target already exists ; exit 1) lc=`git reflog icewm-1-4-BRANCH | head -n1 | cut -f1 -d" "` && echo "Expected upstream ref: $$lc (on failure run update-debian-mod target)" && grep -m1 ^commit ChangeLog | grep $$lc git tag $(ORIGTAG) icewm-1-4-BRANCH git archive $(ORIGTAG) --prefix icewm-$(ORIGVERSION)/ | xz -9 > ../icewm_$(ORIGVERSION).orig.tar.xz test -d ../tarballs && ln ../icewm_$(ORIGVERSION).orig.tar.xz ../tarballs || true pristine-tar commit ../icewm_$(ORIGVERSION).orig.tar.xz icewm-1-4-BRANCH update-debian-mod: grep debian .git/HEAD oldstate=$$(head ChangeLog | grep ^commit | head -1 | cut -f2 -d ' ') && git log $$oldstate..icewm-1-4-BRANCH --stat=76 -M -C |fmt -sct -w80 > ChangeLog.debian mv ChangeLog ChangeLog.upstream cat ChangeLog.debian ChangeLog.upstream > ChangeLog rm ChangeLog.debian ChangeLog.upstream git commit ChangeLog -m "Updating ChangeLog for a new Debian snapshot"