File: rules

package info (click to toggle)
openhpi 3.8.0-2
  • links: PTS
  • area: main
  • in suites: buster
  • size: 31,792 kB
  • sloc: ansic: 225,326; cpp: 63,687; java: 16,472; cs: 15,161; python: 11,884; sh: 11,508; makefile: 4,945; perl: 1,529; xml: 36; asm: 13
file content (186 lines) | stat: -rwxr-xr-x 6,061 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
#!/usr/bin/make -f
# -*- makefile -*-
# Sample debian/rules that uses debhelper.
# This file was originally written by Joey Hess and Craig Small.
# As a special exception, when this file is copied by dh-make into a
# dh-make output file, you may use that output file without restriction.
# This special exception was added by Craig Small in version 0.37 of dh-make.

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1
#export DEB_BUILD_MAINT_OPTIONS=hardening=+all
DPKG_EXPORT_BUILDFLAGS=1
include /usr/share/dpkg/buildflags.mk

# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
include /usr/share/dpkg/architecture.mk

# The following fails on ia64, because of alignment stuff
# CFLAGS = -Wall -g
CFLAGS = -g

export CPPFLAGS CFLAGS LDFLAGS
ifeq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
	CFLAGS += -O2
endif

ifeq ($(DEB_HOST_ARCH_OS), linux)
CONFFLAGS += --enable-watchdog
endif

configure: configure-stamp
configure-stamp:
	dh_testdir
	mkdir -p m4
	dh_autoreconf
	# Add here commands to configure the package.
	# The following Debian defaults don't work...need to figure out what's
	# wrong:
	# LDFLAGS="-Wl,-z,defs"
	chmod +x ltmain.sh configure
	./configure --host=$(DEB_HOST_GNU_TYPE) --build=$(DEB_BUILD_GNU_TYPE) --prefix=/usr --sysconfdir=/etc --with-varpath=/var/lib/openhpi --mandir=\$${prefix}/share/man --infodir=\$${prefix}/share/info --enable-daemon --enable-clients --enable-ipmi --enable-cpp_wrappers --enable-oa_soap --enable-ilo2_ribcl --enable-ov_rest --enable-snmp_bc --enable-ipmidirect --enable-simulator --enable-dynamic_simulator $(CONFFLAGS) CFLAGS="$(CFLAGS)"
	touch configure-stamp


build: build-stamp

build-arch: build-arch-stamp
build-arch-stamp: configure-stamp

build-indep: build-indep-stamp
build-indep-stamp: configure-stamp

build-stamp:  configure-stamp
	dh_testdir

	# Add here commands to compile the package.
	$(MAKE)

	touch $@

clean:
	dh_testdir
	dh_testroot
	rm -f build-stamp configure-stamp

	# Add here commands to clean up after the build process.
	# chmod -x ltmain.sh configure
	[ ! -f Makefile ] || $(MAKE) clean
	find . -name Makefile -exec rm -f "{}" ";"
	find . -name Makefile -exec rm -f "{}" ";"
	find . -depth -type d -name \$\(top_srcdir\) -exec rm -rf "{}" ";"
	find . -depth -type d -name \.deps -exec rm -rf "{}" ";"
	find . -depth -type d -name \$\(top_srcdir\) -exec rm -rf "{}" ";"
	# Should we remove the baselibs/csharp from the distro?

	rm -f config.log config.guess libtool config.status config.h rt-env.sh stamp-h1
	rm -f openhpi.spec openhpi.pc openhpid/openhpid.sh
	rm -f utils/openhpiutils.pc clients/.dirstamp
	dh_autoreconf_clean
	dh_clean 

install: build
	dh_testdir
	dh_testroot
	dh_prep 
	dh_installdirs

	# Add here commands to install the package into debian/openhpi.
	# Installing into debian/tmp, then using dh_install and the
	# package.install file to break up the files into packages.
	$(MAKE) install DESTDIR=$(CURDIR)/debian/tmp

	# openhpi is an empty package, but an empty .install file can't be
	# represented in a diff
	touch debian/openhpi.install


# Build architecture-independent files here.
binary-indep: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs -i
	dh_installdocs -i --all debian/README.Debian
	dh_installexamples -i
#	dh_install --sourcedir=debian/tmp -i
#	dh_installmenu -i
#	dh_installdebconf -i	
#	dh_installlogrotate -i
#	dh_installemacsen -i
#	dh_installpam -i
#	dh_installmime -i
#	dh_python -i
#	dh_installinit -i
#	dh_installcron -i
#	dh_installinfo -i
#	dh_installwm -i
#	dh_installudev -i
	dh_lintian -i
#	dh_undocumented -i
	dh_installman -i
	dh_link -i
	dh_compress -i
	dh_fixperms -i
#	dh_perl -i
	dh_installdeb -i
	dh_gencontrol -i
	dh_md5sums -i
	dh_builddeb -i

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs -a
	dh_installdocs -a --all debian/README.Debian
	dh_installexamples -a
	# Using the upstream init script...better way to do this?
	rm -f debian/openhpid.init
	mv debian/tmp/etc/init.d/openhpid debian/openhpid.init
	# For now, not shipping the .la files because they are a support
	# liability as far as version dependencies go
	rm -f debian/tmp/usr/lib/*.la
	rm -f debian/tmp/usr/lib/openhpi/*.la
	# The following are for specific documentation files that upstream
	# puts in a nonstandard place:
	mv debian/tmp/usr/share/doc/openhpi*/README debian/libopenhpi3/usr/share/doc/libopenhpi3/
	mv debian/tmp/usr/share/doc/openhpi*/README.daemon debian/libopenhpi3/usr/share/doc/libopenhpi3/
	# Our debian/copyright file includes the contents of this one
	rm debian/tmp/usr/share/doc/openhpi*/COPYING
	# Upstream doesn't "install" these files anywhere and they're useful:
	cp plugins/ilo2_ribcl/OpenHPI_ProLiant_DevGuide.pdf debian/openhpi-plugin-ilo2-ribcl/usr/share/doc/openhpi-plugin-ilo2-ribcl/
	cp plugins/oa_soap/OpenHPI_Blade_DevGuide.pdf debian/openhpi-plugin-oa-soap/usr/share/doc/openhpi-plugin-oa-soap/
	cp plugins/ov_rest/OpenHPI_Synergy_DevGuide.pdf debian/openhpi-plugin-ov-rest/usr/share/doc/openhpi-plugin-ov-rest/
	cp plugins/snmp_bc/bc2hpi.pdf debian/openhpi-plugin-snmp-bc/usr/share/doc/openhpi-plugin-snmp-bc/
	mkdir -p debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig
	mv debian/tmp/usr/lib/pkgconfig/*  debian/tmp/usr/lib/$(DEB_HOST_MULTIARCH)/pkgconfig
	dh_install --sourcedir=debian/tmp --fail-missing -a
#	dh_installmenu -a
#	dh_installdebconf -a	
#	dh_installlogrotate -a
#	dh_installemacsen -a
#	dh_installpam -a
#	dh_installmime -a
#	dh_python -a
	dh_installinit -a
#	dh_installcron -a
#	dh_installinfo -a
#	dh_installwm -a
#	dh_installudev -a
	dh_lintian -a
#	dh_undocumented -a
	dh_installman -a
	dh_link -a
	dh_strip -a
	dh_compress -a
	dh_fixperms -a
#	dh_perl -a
	dh_makeshlibs -a -X/usr/lib/openhpi	# Could add -V here
	dh_installdeb -a
	dh_shlibdeps -a -- --warnings=1
	dh_gencontrol -a
	dh_md5sums -a
	dh_builddeb -a
binary: binary-indep binary-arch
.PHONY: build clean binary-indep binary-arch binary install