[1467] | 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 | config.status: configure
|
---|
| 31 | dh_testdir
|
---|
| 32 |
|
---|
| 33 | # Configure the package.
|
---|
| 34 | CFLAGS="$(CFLAGS)" ./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr
|
---|
| 35 | --mandir=\$${prefix}/share/man
|
---|
| 36 |
|
---|
| 37 | # Build both architecture dependent and independent
|
---|
| 38 | build: build-arch build-indep
|
---|
| 39 |
|
---|
| 40 | # Build architecture dependent
|
---|
| 41 | build-arch: build-arch-stamp
|
---|
| 42 |
|
---|
| 43 | build-arch-stamp: config.status
|
---|
| 44 | dh_testdir
|
---|
| 45 |
|
---|
| 46 | # Compile the package.
|
---|
| 47 | $(MAKE)
|
---|
| 48 |
|
---|
| 49 | touch build-stamp
|
---|
| 50 |
|
---|
| 51 | # Build architecture independent
|
---|
| 52 | build-indep: build-indep-stamp
|
---|
| 53 |
|
---|
| 54 | build-indep-stamp: config.status
|
---|
| 55 | # Nothing to do, the only indep item is the manual which is available as html in original source
|
---|
| 56 | touch build-indep-stamp
|
---|
| 57 |
|
---|
| 58 | # Clean up
|
---|
| 59 | clean:
|
---|
| 60 | dh_testdir
|
---|
| 61 | dh_testroot
|
---|
| 62 | rm -f build-arch-stamp build-indep-stamp #CONFIGURE-STAMP#
|
---|
| 63 | # Clean temporary document directory
|
---|
| 64 | rm -rf debian/doc-temp
|
---|
| 65 | # Clean up.
|
---|
| 66 | -$(MAKE) distclean
|
---|
| 67 | rm -f config.log
|
---|
| 68 | ifneq "$(wildcard /usr/share/misc/config.sub)" ""
|
---|
| 69 | cp -f /usr/share/misc/config.sub config.sub
|
---|
| 70 | endif
|
---|
| 71 | ifneq "$(wildcard /usr/share/misc/config.guess)" ""
|
---|
| 72 | cp -f /usr/share/misc/config.guess config.guess
|
---|
| 73 | endif
|
---|
| 74 |
|
---|
| 75 | dh_clean
|
---|
| 76 |
|
---|
| 77 | # Install architecture dependent and independent
|
---|
| 78 | install: install-arch install-indep
|
---|
| 79 |
|
---|
| 80 | # Install architecture dependent
|
---|
| 81 | install-arch: build-arch
|
---|
| 82 | dh_testdir
|
---|
| 83 | dh_testroot
|
---|
| 84 | dh_clean -k -s
|
---|
| 85 | dh_installdirs -s
|
---|
| 86 |
|
---|
| 87 | # Install the package files into build directory:
|
---|
| 88 | # - start with upstream make install
|
---|
| 89 | $(MAKE) install prefix=$(CURDIR)/debian/$(PACKAGE_NAME)/usr mandir=$(CURDIR)/debian/$(PACKAGE_NAME)/usr/share/man
|
---|
| 90 | # - copy html manual to temporary location for renaming
|
---|
| 91 | mkdir -p debian/doc-temp
|
---|
| 92 | dh_install -s
|
---|
| 93 |
|
---|
| 94 | # Install architecture independent
|
---|
| 95 | install-indep: build-indep
|
---|
| 96 | dh_testdir
|
---|
| 97 | dh_testroot
|
---|
| 98 | dh_clean -k -i
|
---|
| 99 | dh_installdirs -i
|
---|
| 100 | dh_install -i
|
---|
| 101 |
|
---|
| 102 | # Must not depend on anything. This is to be called by
|
---|
| 103 | # binary-arch/binary-indep
|
---|
| 104 | # in another 'make' thread.
|
---|
| 105 | binary-common:
|
---|
| 106 | dh_testdir
|
---|
| 107 | dh_testroot
|
---|
| 108 | dh_installchangelogs ChangeLog
|
---|
| 109 | dh_installdocs
|
---|
| 110 | dh_installman
|
---|
| 111 | dh_link
|
---|
| 112 | dh_strip
|
---|
| 113 | dh_compress
|
---|
| 114 | dh_fixperms
|
---|
| 115 | dh_installdeb
|
---|
| 116 | dh_shlibdeps
|
---|
| 117 | dh_gencontrol
|
---|
| 118 | dh_md5sums
|
---|
| 119 | dh_builddeb
|
---|
| 120 |
|
---|
| 121 | # Build architecture independant packages using the common target.
|
---|
| 122 | binary-indep: build-indep install-indep
|
---|
| 123 | $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
|
---|
| 124 |
|
---|
| 125 | # Build architecture dependant packages using the common target.
|
---|
| 126 | binary-arch: build-arch install-arch
|
---|
| 127 | $(MAKE) -f debian/rules DH_OPTIONS=-a binary-common
|
---|
| 128 |
|
---|
| 129 | # Build architecture depdendent and independent packages
|
---|
| 130 | binary: binary-arch binary-indep
|
---|
| 131 | .PHONY: clean binary
|
---|
| 132 |
|
---|