Adjust version string of script during package build-time
[grml-hwinfo.git] / debian / rules
1 #!/usr/bin/make -f
2 # -*- makefile -*-
3 # Sample debian/rules that uses debhelper.
4 # This file was originally written by Joey Hess and Craig Small.
5 # As a special exception, when this file is copied by dh-make into a
6 # dh-make output file, you may use that output file without restriction.
7 # This special exception was added by Craig Small in version 0.37 of dh-make.
8
9 # Uncomment this to turn on verbose mode.
10 #export DH_VERBOSE=1
11
12 VERSION:=$(shell dpkg-parsechangelog | awk '/Version: / { print $$2 }')
13
14
15 build: build-stamp
16
17 build-stamp:
18         dh_testdir
19         egrep -q "^VERSION=.*UNRELEASED" grml-hwinfo || \
20           (echo "Wrong version in grml-hwinfo" && exit 2)
21
22         touch build-stamp
23
24 clean:
25         dh_testdir
26         dh_testroot
27         rm -f build-stamp
28
29         dh_clean
30
31 install: build
32         dh_testdir
33         dh_testroot
34         dh_clean -k
35         dh_installdirs
36
37         # Add here commands to install the package into debian/grml-hwinfo.
38         install -m 755 grml-hwinfo $(CURDIR)/debian/grml-hwinfo/usr/bin/
39         install -m 755 sysdump     $(CURDIR)/debian/grml-hwinfo/usr/bin/
40
41 # Build architecture-dependent files here.
42 binary-arch: build install
43 # We have nothing to do by default.
44
45 # Build architecture-independent files here.
46 binary-indep: build install
47         dh_testdir
48         dh_testroot
49         dh_installchangelogs
50         dh_installdocs
51         dh_installman grml-hwinfo.1 sysdump.8
52         sed -i -e "s/^VERSION='\*\*\*UNRELEASED\*\*\*'/VERSION='$(VERSION)'/" $(CURDIR)/debian/grml-hwinfo/usr/bin/grml-hwinfo
53         dh_link
54         dh_strip
55         dh_compress
56         dh_fixperms
57         dh_installdeb
58         dh_shlibdeps
59         dh_gencontrol
60         dh_md5sums
61         dh_builddeb
62
63 binary: binary-indep binary-arch
64 .PHONY: build clean binary-indep binary-arch binary install