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

« back to all changes in this revision

Viewing changes to debian/rules

  • Committer: Bazaar Package Importer
  • Author(s): Martin Loschwitz
  • Date: 2011-08-24 09:32:00 UTC
  • Revision ID: james.westby@ubuntu.com-20110824093200-s8b8oxtn5a9xy3gq
Tags: 1:3.9.2-1
* Package rename due to restructuring from upstream
* Added resource-agents-dev package to hold the important header file
* New upstream release from new repository
* Updated to new Policy version, no changes necessary
* Adapt patches to work with the new upstream version

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/make -f
 
2
 
 
3
# Uncomment this to turn on verbose mode.
 
4
#export DH_VERBOSE=1
 
5
 
 
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:
 
70
        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
        -mv $(CURDIR)/debian/resource-agents/usr/sbin/rhev-check.sh $(CURDIR)/debian/resource-agents/usr/sbin/rhev-check
 
85
 
 
86
        dh_link
 
87
        dh_installchangelogs
 
88
        dh_installinit
 
89
        dh_lintian
 
90
        dh_strip
 
91
        dh_compress
 
92
        dh_fixperms
 
93
        dh_makeshlibs
 
94
        dh_perl
 
95
        dh_installdeb
 
96
        dh_shlibdeps
 
97
        dh_gencontrol
 
98
        dh_md5sums
 
99
        dh_builddeb
 
100
 
 
101
# Build architecture independant packages using the common target.
 
102
binary-indep: build-indep install-indep
 
103
        $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
 
104
 
 
105
# Build architecture dependant packages using the common target.
 
106
binary-arch: build-arch install-arch
 
107
        $(MAKE) -f debian/rules DH_OPTIONS=-s binary-common
 
108
 
 
109
binary: binary-arch binary-indep
 
110
.PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure