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 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96
|
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.
# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
PACKAGE := drawxtl
#DVERSION := $(shell dpkg-parsechangelog | sed -n -e 's/^Version: \(.*\)-[^-]*$$/\1/p' )
#UVERSION := $(shell dpkg-parsechangelog | sed -n -e 's/^Version: \(.*\)\.dfsg.*$$/\1/p' )
STRIPPED_UVERSION := $(shell dpkg-parsechangelog | sed -n -e 's/^Version: \(.*\)+dfsg.*/\1/p' | sed 's/\.//g' )
include /usr/share/dpatch/dpatch.make
CFLAGS = -Wall -g
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif
build: build-stamp
build-stamp: patch-stamp
dh_testdir
$(MAKE) -C source/DRAWxtl$(STRIPPED_UVERSION)/ \
OS=Linux \
prefix=/usr \
libdir=/usr/lib/ \
LINKFLTKGL="-lfltk_gl -lfltk" \
OPTIM="$(CFLAGS) -Wunused -fno-exceptions"
touch $@
clean: unpatch
dh_testdir
dh_testroot
rm -f build-stamp patch-stamp
# Add here commands to clean up after the build process.
$(MAKE) -C source/DRAWxtl$(STRIPPED_UVERSION)/ clean
dh_clean
install: build
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs
binary-indep: build install
binary-arch: build install
dh_testdir
dh_testroot
dh_installchangelogs docs/readme.txt
dh_installdocs docs/DRAWxtl$(STRIPPED_UVERSION).pdf
dh_install exe/DRAWxtl$(STRIPPED_UVERSION) usr/bin/
dh_installman
dh_installmenu
dh_installexamples examples/*
# dh_installmime
dh_link usr/bin/DRAWxtl$(STRIPPED_UVERSION) usr/bin/drawxtl \
usr/share/doc/drawxtl/DRAWxtl$(STRIPPED_UVERSION).pdf usr/share/doc/drawxtl/DRAWxtl.pdf \
usr/share/man/man1/drawxtl.1.gz usr/share/man/man1/DRAWxtl$(STRIPPED_UVERSION).1.gz
dh_strip
dh_compress
find debian/$(PACKAGE)/usr/share/doc/$(PACKAGE)/examples/ -type f \
! -name "*.gz" -exec gzip -9nf {} ";"
dh_fixperms
dh_installdeb
dh_shlibdeps
dh_gencontrol
dh_md5sums
dh_builddeb
binary: binary-indep binary-arch
get-orig-source:
set -ex ; \
TMPDIR=`mktemp -d $(PACKAGE).XXXXXX` ; \
UVERSION=`uscan --force-download --dehs --destdir "$$TMPDIR" | grep upstream-version | sed -e 's/<[^>]*>//g'` ; \
DVERSION="$$UVERSION"+dfsg ; \
PKGDIR=$(PACKAGE)-"$$DVERSION".orig ; \
mkdir -p "$$TMPDIR"/"$$PKGDIR" ; \
tar --directory="$$TMPDIR"/"$$PKGDIR" --strip-components=1 \
-xzf "$$TMPDIR"/$(PACKAGE)_"$$UVERSION".orig.tar.gz ; \
rm -f "$$TMPDIR"/"$$PKGDIR"/exe/libglut.so "$$TMPDIR"/"$$PKGDIR"/docs/DRAWxtl53.pdf ; \
GZIP=-9 tar --directory="$$TMPDIR" -czf \
$(CURDIR)/$(PACKAGE)_"$$DVERSION".orig.tar.gz "$$PKGDIR" ; \
rm -rf "$$TMPDIR"
.PHONY: build clean binary-indep binary-arch binary install get-orig-source
|