grml2iso: make sure to exit properly if provided argument to -c option does not exist
[grml2usb.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 build: build-arch build-indep
15 build-arch: build-stamp
16 build-indep: build-stamp
17
18 build-stamp:
19         dh_testdir
20
21         egrep -q "PROG_VERSION = '\*\*\*UNRELEASED\*\*\*'" grml2usb || (echo "PROG_VERSION in grml2usb wrong." && exit 2)
22         $(MAKE)
23         cd mbr && $(MAKE) && cd ..
24         touch build-stamp
25
26 clean:
27         dh_testdir
28         dh_testroot
29         rm -f build-stamp
30
31         # Add here commands to clean up after the build process.
32         $(MAKE) clean
33         cd mbr && $(MAKE) clean && cd ..
34         dh_clean
35
36 install: build
37         dh_testdir
38         dh_testroot
39         dh_prep
40         dh_installdirs usr/share/grml2usb/grub usr/share/grml2usb/mbr
41
42         # Add here commands to install the package into debian/grml2usb.
43         install -m 755 grml2usb               debian/grml2usb/usr/sbin/grml2usb
44         sed -i -e "s/PROG_VERSION = '\*\*\*UNRELEASED\*\*\*'/PROG_VERSION = '$(VERSION)'/" debian/grml2usb/usr/sbin/grml2usb
45         install -m 755 grml2iso               debian/grml2usb/usr/sbin/grml2iso
46         install -m 644 mbr/mbrmgr             debian/grml2usb/usr/share/grml2usb/mbr/mbrmgr
47         install -m 644 mbr/mbrldr             debian/grml2usb/usr/share/grml2usb/mbr/mbrldr
48         cp -a          grub/                  debian/grml2usb/usr/share/grml2usb/
49
50 # Build architecture-dependent files here.
51 binary-arch: build-arch install
52         dh_testdir
53         dh_testroot
54         dh_installchangelogs
55         dh_installdocs TODO
56         dh_installman grml2usb.8 grml2iso.8
57         dh_strip
58         dh_compress
59         dh_fixperms
60         dh_installdeb
61         dh_shlibdeps
62         dh_gencontrol
63         dh_md5sums
64         dh_builddeb
65
66 # Build architecture-independent files here.
67 binary-indep: build-indep install
68 # Nothing to do.
69
70 binary: binary-indep binary-arch
71 .PHONY: build clean binary-indep binary-arch binary install