~ubuntu-branches/ubuntu/raring/lsb/raring-proposed

1 by Chris Lawrence
Note that Debian's run-parts ignores certain lsb cron.* scripts, in
1
#!/usr/bin/make -f
2
# Sample debian/rules that uses debhelper.
3
# GNU copyright 1997 to 1999 by Joey Hess.
4
5
# Uncomment this to turn on verbose mode.
6
#export DH_VERBOSE=1
7
8
# These are used for cross-compiling and for saving the configure script
9
# from having to guess our platform (since we know it already)
10
DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
11
DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
23 by Dustin Kirkland
* Merge from debian unstable, remaining changes:
12
DEB_HOST_ARCH_CPU  ?= $(shell dpkg-architecture -qDEB_HOST_ARCH_CPU 2>/dev/null)
8 by Jeff Bailey
Resynchronise with Debian.
13
14
# Take account of old dpkg-architecture output.
23 by Dustin Kirkland
* Merge from debian unstable, remaining changes:
15
ifeq ($(DEB_HOST_ARCH_CPU),)
16
  DEB_HOST_ARCH_CPU := $(shell dpkg-architecture -qDEB_BUILD_GNU_CPU)
17
  ifeq ($(DEB_HOST_ARCH_CPU),x86_64)
18
    DEB_HOST_ARCH_CPU := amd64
8 by Jeff Bailey
Resynchronise with Debian.
19
  endif
20
endif
1 by Chris Lawrence
Note that Debian's run-parts ignores certain lsb cron.* scripts, in
21
22
ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
23
	CFLAGS += -g
24
endif
25
ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
26
	INSTALL_PROGRAM += -s
27
endif
28
3 by LaMont Jones
Fix build-depends
29
# Map Debian architectures to LSB architectures
23 by Dustin Kirkland
* Merge from debian unstable, remaining changes:
30
lsbarch=${DEB_HOST_ARCH_CPU}
3 by LaMont Jones
Fix build-depends
31
ifeq (${lsbarch}, i386)
5 by Colin Watson
Resynchronise with Debian.
32
lsbarch=ia32
3 by LaMont Jones
Fix build-depends
33
endif
34
ifeq (${lsbarch}, powerpc)
5 by Colin Watson
Resynchronise with Debian.
35
lsbarch=ppc32
36
endif
37
44 by Matthias Klose
Use python3 instead of python2.
38
twotothree = 2to3-$(shell py3versions -dv)
39
5 by Colin Watson
Resynchronise with Debian.
40
LIBC=libc6 (>> 2.3.5)
51 by Colin Watson
* Cherry-pick from Debian 3.2-28 (LP: #837745):
41
ifeq (${lsbarch}, amd64)
42
LIBC=libc6 (>= 2.13-17)
43
endif
5 by Colin Watson
Resynchronise with Debian.
44
ifeq (${lsbarch}, hurd-i386)
45
LIBC=libc0.3 (>> 2.3.5)
46
endif
47
ifeq (${lsbarch}, ia64)
48
LIBC=libc6.1 (>> 2.3.5)
49
endif
50
ifeq (${lsbarch}, alpha)
51
LIBC=libc6.1 (>> 2.3.5)
3 by LaMont Jones
Fix build-depends
52
endif
53
1 by Chris Lawrence
Note that Debian's run-parts ignores certain lsb cron.* scripts, in
54
configure: configure-stamp
55
configure-stamp:
56
	dh_testdir
57
	# Add here commands to configure the package.
58
59
	touch configure-stamp
60
61
build: build-stamp
62
1.1.1 by Chris Lawrence
Fix Replaces line to use the correct version in lsb-base.
63
build-stamp: configure-stamp
1 by Chris Lawrence
Note that Debian's run-parts ignores certain lsb cron.* scripts, in
64
	dh_testdir
65
66
	# Add here commands to compile the package.
67
	#$(MAKE)
68
	#/usr/bin/docbook-to-man debian/lsb.sgml > lsb.1
69
70
	touch build-stamp
71
72
clean:
73
	dh_testdir
74
	dh_testroot
1.1.1 by Chris Lawrence
Fix Replaces line to use the correct version in lsb-base.
75
	rm -f build-stamp configure-stamp *.py[co] debian/lsb*substvars
1 by Chris Lawrence
Note that Debian's run-parts ignores certain lsb cron.* scripts, in
76
77
	# Add here commands to clean up after the build process.
78
79
	dh_clean
80
81
install: build
82
	dh_testdir
83
	dh_testroot
1.2.1 by Chris Lawrence
* Provide lsb_release module for Python applications. (Closes: #486262)
84
	dh_prep
1 by Chris Lawrence
Note that Debian's run-parts ignores certain lsb cron.* scripts, in
85
	dh_installdirs
86
87
	# Add here commands to install the package into debian/lsb.
88
	#$(MAKE) install DESTDIR=$(CURDIR)/debian/lsb
5 by Colin Watson
Resynchronise with Debian.
89
	cp -p initdutils.py install_initd remove_initd lsbinstall debian/lsb-core/usr/lib/lsb
90
	cp -p init-functions debian/lsb-base/lib/lsb
91
	cp -p lsb-base-logging-ubuntu.sh debian/lsb-base/etc/lsb-base-logging.sh
14 by Colin Watson
* Resynchronise with Debian. Remaining changes:
92
	cp -p lsb_release debian/lsb-release/usr/bin
34 by Michael Vogt
* rebuild using python-central and DH_PYCENTRAL=include-links
93
	cp -p lsb_release.py debian/lsb-release/usr/share/pyshared/
1.1.2 by Chris Lawrence
* Revert change in 3.2-16 that broke killproc due to my misunderstanding
94
	cp -p debian/lsb-release.bugscript debian/lsb-release/usr/share/bug/lsb-release
39 by Till Kamppeter
* sendmail, debian/control, debian/rules, debian/lsb-invalid-mta.dirs:
95
	cp -p sendmail debian/lsb-invalid-mta/usr/sbin
1 by Chris Lawrence
Note that Debian's run-parts ignores certain lsb cron.* scripts, in
96
44 by Matthias Klose
Use python3 instead of python2.
97
	$(twotothree) -n -w debian/lsb-base/lib/lsb
67 by Ma Xiaojun
* debian/rules: Add necessary 2to3.
98
	$(twotothree) -n -w debian/lsb-core/usr/lib/lsb/*
44 by Matthias Klose
Use python3 instead of python2.
99
	$(twotothree) -n -w debian/lsb-release/usr/bin/lsb_release
100
	mkdir -p debian/lsb-release/usr/lib/python3/dist-packages
101
	cp -p lsb_release.py debian/lsb-release/usr/lib/python3/dist-packages
102
	$(twotothree) -n -w debian/lsb-release/usr/lib/python3/dist-packages
103
104
	: # make python scripts starting with '#!' executable
105
	for i in `find debian/lsb-core/usr/lib/lsb debian/lsb-release/usr/bin debian/lsb-release/usr/share/python3/dist-packages -type f`; do \
106
	  sed '1s,#!.*python[^ ]*\(.*\),#! /usr/bin/python3\1,' \
107
		$$i > $$i.temp; \
108
	  if cmp --quiet $$i $$i.temp; then \
109
	    rm -f $$i.temp; \
110
	  else \
111
	    mv -f $$i.temp $$i; \
112
	    chmod 755 $$i; \
113
	    echo "fixed interpreter: $$i"; \
114
	  fi; \
115
	done
116
117
1 by Chris Lawrence
Note that Debian's run-parts ignores certain lsb cron.* scripts, in
118
# Build architecture-independent files here.
119
binary-indep: build install
1.1.1 by Chris Lawrence
Fix Replaces line to use the correct version in lsb-base.
120
	dh_testdir
121
	dh_testroot
122
	dh_installdebconf -i
123
	dh_installdocs -i
124
#	dh_installlogrotate
125
#	dh_installemacsen
126
#	dh_installpam
127
#	dh_installmime
128
#	dh_installinit
129
	dh_installcron -i
130
	dh_installman -i
131
	dh_installinfo -i
132
#	dh_undocumented
133
	dh_installchangelogs -i
134
	dh_link -i
135
	dh_strip -i
136
	dh_compress -i
137
	dh_fixperms -i
138
#	dh_makeshlibs
1.2.1 by Chris Lawrence
* Provide lsb_release module for Python applications. (Closes: #486262)
139
#	dh_perl
44 by Matthias Klose
Use python3 instead of python2.
140
	dh_python3 -i
43 by Michael Vogt
* switch from python-central to dh_python2
141
	dh_python2 -i
1.2.1 by Chris Lawrence
* Provide lsb_release module for Python applications. (Closes: #486262)
142
#	dh_python
1.1.1 by Chris Lawrence
Fix Replaces line to use the correct version in lsb-base.
143
	dh_installdeb -i
144
	dh_shlibdeps -i
145
	dh_gencontrol -i
146
	dh_md5sums -i
147
	dh_builddeb -i
1 by Chris Lawrence
Note that Debian's run-parts ignores certain lsb cron.* scripts, in
148
149
# Build architecture-dependent files here.
150
binary-arch: build install
151
	dh_testdir
152
	dh_testroot
1.1.1 by Chris Lawrence
Fix Replaces line to use the correct version in lsb-base.
153
	dh_installdebconf -a
154
	dh_installdocs -a
1.1.2 by Chris Lawrence
* Revert change in 3.2-16 that broke killproc due to my misunderstanding
155
	dh_installexamples -a test/init-skeleton
1.1.1 by Chris Lawrence
Fix Replaces line to use the correct version in lsb-base.
156
	dh_installmenu -a
1 by Chris Lawrence
Note that Debian's run-parts ignores certain lsb cron.* scripts, in
157
#	dh_installlogrotate
158
#	dh_installemacsen
159
#	dh_installpam
160
#	dh_installmime
161
#	dh_installinit
1.1.1 by Chris Lawrence
Fix Replaces line to use the correct version in lsb-base.
162
	dh_installcron -a
163
	dh_installman -a lsb.8
164
	dh_installinfo -a
1 by Chris Lawrence
Note that Debian's run-parts ignores certain lsb cron.* scripts, in
165
#	dh_undocumented
1.1.1 by Chris Lawrence
Fix Replaces line to use the correct version in lsb-base.
166
	dh_installchangelogs -a
5 by Colin Watson
Resynchronise with Debian.
167
	@echo >> debian/lsb-core.substvars "glibc=${LIBC}"
23 by Dustin Kirkland
* Merge from debian unstable, remaining changes:
168
#	@[ ${DEB_HOST_GNU_TYPE} != 'arm-linux-gnueabi' ] && echo >> debian/lsb-cxx.substvars "depends=libstdc++5" || true
5 by Colin Watson
Resynchronise with Debian.
169
	@echo >> debian/lsb-core.substvars "provides=lsb-core-${lsbarch}"
170
	@echo >> debian/lsb-cxx.substvars "provides=lsb-cxx-${lsbarch}"
171
	@echo >> debian/lsb-graphics.substvars "provides=lsb-graphics-${lsbarch}"
23 by Dustin Kirkland
* Merge from debian unstable, remaining changes:
172
	@echo >> debian/lsb-desktop.substvars "provides=lsb-qt4-${lsbarch}, lsb-desktop-${lsbarch}"
8 by Jeff Bailey
Resynchronise with Debian.
173
	@echo >> debian/lsb-qt4.substvars "provides=lsb-qt4-${lsbarch}"
22 by Matthias Klose
* Merge with Debian; remaining changes:
174
	@echo >> debian/lsb-multimedia.substvars "provides=lsb-multimedia-${lsbarch}"
175
	@echo >> debian/lsb-languages.substvars "provides=lsb-languages-${lsbarch}"
176
	@echo >> debian/lsb-printing.substvars "provides=lsb-printing-${lsbarch}"
23 by Dustin Kirkland
* Merge from debian unstable, remaining changes:
177
	@[ ${DEB_HOST_ARCH_CPU} = 'amd64' ] && echo >> debian/lsb-core.substvars "depends=libc6-i386, lib32z1" || true
1.1.1 by Chris Lawrence
Fix Replaces line to use the correct version in lsb-base.
178
	dh_link -a
179
	dh_strip -a
180
	dh_compress -a
181
	dh_fixperms -a
43 by Michael Vogt
* switch from python-central to dh_python2
182
	dh_python2 -a
1 by Chris Lawrence
Note that Debian's run-parts ignores certain lsb cron.* scripts, in
183
#	dh_makeshlibs
1.1.1 by Chris Lawrence
Fix Replaces line to use the correct version in lsb-base.
184
	dh_installdeb -a
1 by Chris Lawrence
Note that Debian's run-parts ignores certain lsb cron.* scripts, in
185
#	dh_perl
1.1.1 by Chris Lawrence
Fix Replaces line to use the correct version in lsb-base.
186
	dh_shlibdeps -a
187
	dh_gencontrol -a
188
	dh_md5sums -a
189
	dh_builddeb -a
1 by Chris Lawrence
Note that Debian's run-parts ignores certain lsb cron.* scripts, in
190
191
binary: binary-indep binary-arch
192
.PHONY: build clean binary-indep binary-arch binary install configure