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
|
#!/usr/bin/make -f
# Various variables used later on:
NOT_NEEDED = AUTHORS LICENSE README.md Changelog
DEB_DESTDIR = $(CURDIR)/debian/luminance-hdr
MANPAGE = debian/luminance-hdr.1
export DEB_BUILD_MAINT_OPTIONS=hardening=+all
export DEB_LDFLAGS_MAINT_APPEND=-Wl,--as-needed
export QT_SELECT := qt5
include /usr/share/dpkg/pkg-info.mk
# To enable test-suite build-depend on libgtest-dev and uncomment these lines
###override_dh_auto_configure:
### cp -a /usr/src/gtest local-gtest && \
### mkdir local-gtest/debian local-gtest/include && \
### cp -a debian/compat debian/control local-gtest/debian && \
### cd local-gtest && \
### dh_auto_configure --verbose && \
### dh_auto_build --verbose && \
### ln -s /usr/include/gtest include/ && \
### ln -s obj-* lib
###
### dh_auto_configure --verbose -- -DGTEST_ROOT=$(CURDIR)/local-gtest
PKD = $(abspath $(dir $(MAKEFILE_LIST)))
PKG = $(shell dpkg-parsechangelog -S source --file $(PKD)/changelog)
VER ?= $(shell dpkg-parsechangelog -l$(PKD)/changelog | perl -ne 'print $$1 if m{^Version:\s+(?:\d+:)?(\d.*)(?:\-\d+.*)};')
UVER = $(subst +dfsg,,$(VER))
.PHONY: get-orig-source
## http://wiki.debian.org/onlyjob/get-orig-source
get-orig-source:
$(info I: $(PKG)_$(VER))
@echo "# Downloading..."
uscan --noconf --verbose --rename --destdir=$(CURDIR) --check-dirname-level=0 --force-download --download-version $(UVER) $(PKD)
$(if $(wildcard $(PKG)-$(VER)),$(error $(PKG)-$(VER) exist, aborting..))
@echo "# Extracting..."
mkdir $(PKG)-$(VER)
tar -xf $(PKG)_$(UVER).orig.tar.* --directory $(PKG)-$(VER)
@echo "# Cleaning-up..."
cd $(PKG)-$(VER) && \
$(RM) -r -v LuminanceHDR-v.$(UVER)/hdrhtml/hdrhtml_hdrlabs_templ/
@echo "# Repacking..."
tar -caf "$(PKG)_$(VER)$(DTYPE).orig.tar.xz" --directory $(PKG)-$(VER) LuminanceHDR-v.$(UVER)
rm -r -v $(PKG)-$(VER)
override_dh_auto_build:
# Normal auto_build:
dh_auto_build --verbose --parallel
# Build the minimal manpage:
pod2man --center='Minimal luminance-hdr manpage' \
--release=$(shell dpkg-parsechangelog -S Version | sed -e 's/.*://' -e 's/-[^-][^-]*//') \
debian/luminance-hdr.pod > $(MANPAGE)
override_dh_auto_install:
dh_auto_install --verbose --destdir=$(DEB_DESTDIR)
# Remove unneeded files
for i in $(NOT_NEEDED); do \
rm -v $(DEB_DESTDIR)/usr/share/doc/luminance-hdr/$$i ; \
done
%:
dh $@ --parallel
|