Codebase list splix / debian/2.0.0+svn315-7 debian / rules
debian/2.0.0+svn315-7

Tree @debian/2.0.0+svn315-7 (Download .tar.gz)

rules @debian/2.0.0+svn315-7raw · history · blame

#!/usr/bin/make -f

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

# Harden
export DEB_BUILD_MAINT_OPTIONS = hardening=+all
include /usr/share/dpkg/architecture.mk
ifeq ($(origin CC),default)
CC = $(DEB_HOST_GNU_TYPE)-gcc
endif
ifeq ($(origin CXX),default)
CXX = $(DEB_HOST_GNU_TYPE)-g++
endif

derives_from_ubuntu := $(shell (dpkg-vendor --derives-from Ubuntu && echo "yes") || echo "no")

configure: configure-stamp
configure-stamp:
	dh_testdir
	touch configure-stamp

build: build-arch build-indep
build-arch: build-stamp
build-indep: build-stamp
build-stamp: configure-stamp
	dh_testdir
	$(MAKE) V=1 drv CC=$(CC) CXX=$(CXX)
	$(MAKE) V=1 DRV_ONLY=1 rastertoqpdl_LIBS="-lcupsimage -lcups -lpthread -ljbig" pstoqpdl_LIBS="-lcupsimage -lcups -ljbig" CC=$(CC) CXX=$(CXX)
	touch $@

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp configure-stamp
	$(MAKE) V=1 cleanppd
	$(MAKE) V=1 clean DRV_ONLY=1 
	dh_clean optimized/pstoqpdl optimized/rastertoqpdl optimized/src/* debug/src/* .defs.mk

install: build
	dh_testdir
	dh_testroot
	dh_prep
	dh_installdirs
	$(MAKE) V=1 DESTDIR=$(CURDIR)/debian/printer-driver-splix CUPSPPD=/usr/share/ppd/splix DRV_ONLY=1 install
	install -D --mode=644 debian/splix.ppd-updater $(CURDIR)/debian/printer-driver-splix/usr/share/cups/ppd-updaters/splix.ppd-updater
ifeq ($(derives_from_ubuntu),yes)
	# Install Apport hook on Ubuntu and derivatives
	install -D -m 644 debian/local/apport-hook.py $(CURDIR)/debian/printer-driver-splix/usr/share/apport/package-hooks/source_splix.py
endif

binary-indep: 
	dh_testdir -i
	dh_testroot -i
	dh_installchangelogs -i ChangeLog
	dh_installdocs -i
	dh_installexamples -i
	dh_installman -i
	dh_strip -i
	dh_compress -i
	dh_fixperms -i
	dh_installdeb -i
	dh_shlibdeps -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

# Build architecture-dependent files here.
binary-arch: install
	dh_testdir -a
	dh_testroot -a
	dh_installchangelogs -a ChangeLog
	dh_installdocs -a
	dh_installexamples -a
	dh_installman -a
	dh_strip -a
	dh_compress -a
	dh_fixperms -a
	dh_installdeb -a
	dh_shlibdeps -a
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a

binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install configure get-orig-source

# Adapted from http://wiki.debian.org/SandroTosi/Svn_get-orig-source
PACKAGE = splix
SRC_VERSION := $(shell dpkg-parsechangelog | sed -ne 's/^Version: \(\([0-9]\+\):\)\?\(.*\)-.*/\3/p')
SVN_REVISION := $(shell echo $(SRC_VERSION) | awk -F"+" '{ print $$2 }' | sed 's/svn//' )
TARBALL = $(PACKAGE)_$(SRC_VERSION).orig.tar.gz
get-orig-source:
	rm -rf get-orig-source $(TARBALL)
	mkdir get-orig-source
	svn export -r $(SVN_REVISION) svn://svn.code.sf.net/p/splix/code/splix \
	get-orig-source/$(PACKAGE)-$(SRC_VERSION).orig
	GZIP='--best --no-name' tar czf $(TARBALL) -C get-orig-source $(PACKAGE)-$(SRC_VERSION).orig
	rm -rf get-orig-source
	echo "  "$(TARBALL)" created; move it to the right destination to build the package"