1 | #!/usr/bin/make -f
|
---|
2 | # -*- makefile -*-
|
---|
3 | # Sample debian/rules that uses debhelper.
|
---|
4 | # GNU copyright 1997 to 1999 by Joey Hess.
|
---|
5 | #
|
---|
6 | # $Id$
|
---|
7 | #
|
---|
8 |
|
---|
9 | # Uncomment this to turn on verbose mode.
|
---|
10 | #export DH_VERBOSE=1
|
---|
11 |
|
---|
12 | # Define package name variable for a one-stop change.
|
---|
13 | PACKAGE_NAME = PBPKG
|
---|
14 |
|
---|
15 | # These are used for cross-compiling and for saving the configure script
|
---|
16 | # from having to guess our platform (since we know it already)
|
---|
17 | DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
|
---|
18 | DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
|
---|
19 |
|
---|
20 | CFLAGS = -Wall -g
|
---|
21 |
|
---|
22 | ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
|
---|
23 | CFLAGS += -O0
|
---|
24 | else
|
---|
25 | CFLAGS += -O2
|
---|
26 | endif
|
---|
27 | ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
|
---|
28 | INSTALL_PROGRAM += -s
|
---|
29 | endif
|
---|
30 |
|
---|
31 | # Build both architecture dependent and independent
|
---|
32 | build: build-arch
|
---|
33 |
|
---|
34 | # Build architecture dependent
|
---|
35 | build-arch: build-arch-stamp
|
---|
36 |
|
---|
37 | build-arch-stamp:
|
---|
38 | dh_testdir
|
---|
39 |
|
---|
40 | # Compile the package.
|
---|
41 | $(MAKE)
|
---|
42 | chmod 644 script*/*
|
---|
43 | touch build-stamp
|
---|
44 |
|
---|
45 | # Clean up
|
---|
46 | clean:
|
---|
47 | dh_testdir
|
---|
48 | dh_testroot
|
---|
49 | rm -f build-arch-stamp #CONFIGURE-STAMP#
|
---|
50 | # Clean temporary document directory
|
---|
51 | rm -rf debian/doc-temp
|
---|
52 | # Clean up.
|
---|
53 | -$(MAKE) distclean
|
---|
54 | rm -f config.log
|
---|
55 | ifneq "$(wildcard /usr/share/misc/config.sub)" ""
|
---|
56 | cp -f /usr/share/misc/config.sub config.sub
|
---|
57 | endif
|
---|
58 | ifneq "$(wildcard /usr/share/misc/config.guess)" ""
|
---|
59 | cp -f /usr/share/misc/config.guess config.guess
|
---|
60 | endif
|
---|
61 |
|
---|
62 | dh_clean
|
---|
63 |
|
---|
64 | # Install architecture dependent and independent
|
---|
65 | install: install-arch
|
---|
66 |
|
---|
67 | # Install architecture dependent
|
---|
68 | install-arch: build-arch
|
---|
69 | dh_testdir
|
---|
70 | dh_testroot
|
---|
71 | dh_clean -k -s
|
---|
72 | dh_installdirs -s
|
---|
73 |
|
---|
74 | # Install the package files into build directory:
|
---|
75 | dh_install -s
|
---|
76 | rm -rf $(CURDIR)/debian/$(PACKAGE_NAME)
|
---|
77 | mkdir -p $(CURDIR)/debian/$(PACKAGE_NAME)/usr/bin
|
---|
78 | mkdir -p $(CURDIR)/debian/$(PACKAGE_NAME)/usr/share/man/man1
|
---|
79 | install -p -m 755 afio $(CURDIR)/debian/$(PACKAGE_NAME)/usr/bin
|
---|
80 | install -p -m 644 afio.1 $(CURDIR)/debian/$(PACKAGE_NAME)/usr/share/man/man1
|
---|
81 |
|
---|
82 | # Must not depend on anything. This is to be called by
|
---|
83 | # binary-arch/binary-indep
|
---|
84 | # in another 'make' thread.
|
---|
85 | binary-common:
|
---|
86 | dh_testdir
|
---|
87 | dh_testroot
|
---|
88 | #dh_installchangelogs changelog
|
---|
89 | dh_installdocs
|
---|
90 | dh_installman
|
---|
91 | dh_link
|
---|
92 | dh_strip
|
---|
93 | dh_compress
|
---|
94 | dh_fixperms
|
---|
95 | dh_installdeb
|
---|
96 | dh_shlibdeps
|
---|
97 | dh_gencontrol
|
---|
98 | dh_md5sums
|
---|
99 | dh_builddeb
|
---|
100 |
|
---|
101 | # Build architecture dependant packages using the common target.
|
---|
102 | binary-arch: build-arch install-arch
|
---|
103 | $(MAKE) -f debian/rules DH_OPTIONS=-a binary-common
|
---|
104 |
|
---|
105 | # Build architecture depdendent and independent packages
|
---|
106 | binary: binary-arch
|
---|
107 | .PHONY: clean binary
|
---|
108 |
|
---|