~ubuntu-branches/debian/stretch/resource-agents/stretch

« back to all changes in this revision

Viewing changes to debian/rules

  • Committer: Bazaar Package Importer
  • Author(s): Martin Loschwitz
  • Date: 2011-10-20 12:10:13 UTC
  • Revision ID: james.westby@ubuntu.com-20111020121013-ficddzhosi473laz
Tags: 1:3.9.2-4
Adopted numerous changes from the Ubuntu packages, implemented by Andres 
Rodriguez to make co-maintaining these packages in Ubuntu and Debian a
bit easier.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
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.
2
8
 
3
9
# Uncomment this to turn on verbose mode.
4
10
#export DH_VERBOSE=1
5
11
 
6
 
# This has to be exported to make some magic below work.
7
 
export DH_OPTIONS
8
 
 
9
 
DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
10
 
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
11
 
 
12
 
CFLAGS = -Wall -g
13
 
ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
14
 
       CFLAGS += -O0
15
 
else
16
 
       CFLAGS += -O2
17
 
endif
18
 
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
19
 
       INSTALL_PROGRAM += -s
20
 
endif
21
 
 
22
 
ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
23
 
  NUMJOBS = $(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS)))
24
 
  MAKEFLAGS += -j$(NUMJOBS)
25
 
endif
26
 
 
27
 
 
28
 
DTMP:=$(CURDIR)/debian/tmp
29
 
RELEASE := $(shell dpkg-parsechangelog | awk '/^Version: / { print $$2 }')
30
 
UPSTREAM := $(shell echo "$(RELEASE)" | sed 's/:\?\([0-9\.]\+\)-[0-9].*/\1/')
31
 
 
32
 
configure-stamp: configure
33
 
configure: 
34
 
        dh_testdir
35
 
        test -x ./configure || ./autogen.sh
36
 
        ./configure --with-ocf-root=/usr/lib/ocf --with-initdir=/etc/init.d \
37
 
                    --prefix=/usr --sysconfdir=/etc --localstatedir=/var \
38
 
                    --mandir=/usr/share/man --libdir=/usr/lib --disable-fatal-warnings
39
 
        touch configure-stamp
40
 
 
41
 
 
42
 
build: build-arch build-indep
43
 
 
44
 
build-arch: build-arch-stamp
45
 
build-arch-stamp: configure-stamp  
46
 
        $(MAKE)
47
 
        touch $@
48
 
 
49
 
build-indep: build-indep-stamp
50
 
build-indep-stamp: configure-stamp  
51
 
        touch $@
52
 
 
53
 
clean: 
54
 
        dh_testdir
55
 
        dh_testroot
56
 
        [ ! -f Makefile ] || $(MAKE) clean
57
 
        [ ! -f Makefile ] || $(MAKE) distclean
58
 
        dh_clean 
59
 
 
60
 
install: install-indep install-arch
61
 
install-indep:
62
 
 
63
 
install-arch:
64
 
        dh_testdir
65
 
        dh_testroot
66
 
        dh_prep -s 
67
 
        $(MAKE) install DESTDIR=$(CURDIR)/debian/tmp
68
 
 
69
 
binary-common:
 
12
BUILDROOT := $(shell pwd)
 
13
 
 
14
get-orig-source:
 
15
        uscan --noconf --force-download --rename --repack --download-current-version --destdir=/
 
16
 
 
17
%:
 
18
        dh $@ 
 
19
 
 
20
override_dh_auto_configure:
 
21
        dh_testdir
 
22
        [ -f configure ] || sh autogen.sh
 
23
        if [ -e configure -a ! -x configure ]; then chmod u+x configure; fi
 
24
        ./configure --sbindir=/usr/sbin --libexecdir=/usr/lib                   \
 
25
                    --with-ocf-root=/usr/lib/ocf --with-initdir=/etc/init.d     \
 
26
                    --prefix=/usr --sysconfdir=/etc --localstatedir=/var        \
 
27
                    --mandir=/usr/share/man --libdir=/usr/lib --disable-fatal-warnings
 
28
 
 
29
override_dh_auto_install:
 
30
        $(MAKE) install DESTDIR=$(BUILDROOT)/debian/tmp
 
31
 
 
32
        # drbd8 ships this itself
 
33
        rm -f $(BUILDROOT)/debian/tmp/usr/share/cluster/drbd.metadata
 
34
        rm -f $(BUILDROOT)/debian/tmp/usr/share/cluster/drbd.sh
 
35
 
 
36
        # install example configuration file
 
37
        mkdir -p $(BUILDROOT)/debian/tmp/usr/share/doc/ldirectord/examples/
 
38
        cp -ax $(BUILDROOT)/debian/ldirectord.cf.example $(BUILDROOT)/debian/tmp/usr/share/doc/ldirectord/examples/ldirectord.cf
 
39
 
70
40
        dh_install --list-missing
71
 
        dh_testdir
72
 
        dh_testroot
73
 
        dh_installman
74
 
        dh_installdocs
75
 
        
76
 
        # install example configuration file
77
 
        mkdir -p $(CURDIR)/debian/ldirectord/usr/share/doc/ldirectord/examples/
78
 
        cp -ax $(CURDIR)/debian/ldirectord.cf.example $(CURDIR)/debian/ldirectord/usr/share/doc/ldirectord/examples/ldirectord.cf
79
 
 
80
 
        # install ldirectord default file
81
 
        mkdir -p $(CURDIR)/debian/ldirectord/etc/default/
82
 
        cp -ax $(CURDIR)/debian/ldirectord.default $(CURDIR)/debian/ldirectord/etc/default/ldirectord
83
 
 
84
 
        rm -rf $(CURDIR)/debian/resource-agents/usr/share/cluster/drbd.sh
85
 
        rm -rf $(CURDIR)/debian/resource-agents/usr/share/cluster/drbd.metadata
86
 
 
87
 
        dh_link
88
 
        dh_installchangelogs
89
 
        dh_installinit
90
 
        dh_lintian
91
 
        dh_strip
92
 
        dh_compress
93
 
        dh_fixperms
94
 
        dh_makeshlibs
95
 
        dh_perl
96
 
        dh_installdeb
97
 
        dh_shlibdeps
98
 
        dh_gencontrol
99
 
        dh_md5sums
100
 
        dh_builddeb
101
 
 
102
 
# Build architecture independant packages using the common target.
103
 
binary-indep: build-indep install-indep
104
 
        $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
105
 
 
106
 
# Build architecture dependant packages using the common target.
107
 
binary-arch: build-arch install-arch
108
 
        $(MAKE) -f debian/rules DH_OPTIONS=-s binary-common
109
 
 
110
 
binary: binary-arch binary-indep
111
 
.PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure