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
|
#!/usr/bin/make -f
# -*- makefile -*-
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
PACKAGE := portabase
VER := $(shell dpkg-parsechangelog | perl -ne 'print $$1 if m/Version:\s*([\d\.+git]+)/')
UVER := $(shell echo $(VER) | perl -ne 'print $$1 if m/\+git(\d+)/')
UVER_DATE := $(shell echo '$(UVER)' | perl -ne 'print $$1 if m/^(\d{8})/')
UVER_TIME := $(shell echo '$(UVER)' | perl -ne 'print $$1 if m/^\d{8}(\d+)/')
UVER_UDATE := $(shell date -u -d "$(UVER_DATE) $(UVER_TIME)" +%s)
export DEB_BUILD_MAINT_OPTIONS=hardening=+all
%:
dh $@ --with autotools-dev
override_dh_auto_clean:
$(MAKE) -C metakit/builds distclean || $(RM) metakit/builds/*
$(RM) build/mk4* resources/translations/*.qm
dh_auto_clean
override_dh_auto_configure:
chmod -R a-x+X metakit/ qqutil/ resources/ \
&& chmod +x metakit/unix/configure
cd metakit/builds && ../unix/configure --enable-threads --disable-shared
lrelease portabase.pro
lrelease resources/translations/qt*.ts
dh_auto_configure
# patch generated Makefiles to respect dpkg-provided build flags
perl -0pi -e 's{(CX?X?FLAGS\s*)=}{$$1+=}g;' Makefile metakit/builds/Makefile
override_dh_auto_build:
cd metakit/builds && $(MAKE)
mkdir -p build \
&& cp metakit/include/mk4.h metakit/include/mk4.inl \
metakit/include/mk4str.h metakit/include/mk4str.inl \
build/
dh_auto_build
override_dh_installchangelogs:
dh_installchangelogs CHANGES
get-orig-source:
@echo " Upstream version: $(UVER)\n Version: $(VER)\n UDATE: $(UVER_UDATE)"
git clone git://portabase.git.sourceforge.net/gitroot/portabase/portabase $(PACKAGE)-$(UVER)
cd $(PACKAGE)-$(UVER) \
&& git reset --hard $$(git rev-list --all -n 1 --before=$(UVER_UDATE)) \
&& git checkout master \
&& $(RM) -r .git .git* && cd .. && echo "Packing..." \
&& tar cJf $(PACKAGE)_$(VER).orig.tar.xz $(PACKAGE)-$(UVER)
$(RM) -r $(PACKAGE)-$(UVER)
|