Tizen 2.1 base
[platform/upstream/lsb.git] / debian / rules
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 distribution = SLP
9
10 ifeq ($(distribution),SLP)
11 export DH_OPTIONS = -Nlsb-core -Nlsb-graphics -Nlsb-cxx -Nlsb-desktop -Nlsb-qt4 -Nlsb-languages -Nlsb-multimedia -Nlsb-printing -Nlsb -Nlsb-release -Nlsb
12 endif
13
14 # These are used for cross-compiling and for saving the configure script
15 # from having to guess our platform (since we know it already)
16 DEB_HOST_GNU_TYPE   ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
17 DEB_BUILD_GNU_TYPE  ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
18 DEB_HOST_ARCH       ?= $(shell dpkg-architecture -qDEB_HOST_ARCH)
19
20 ifneq (,$(findstring debug,$(DEB_BUILD_OPTIONS)))
21         CFLAGS += -g
22 endif
23 ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS)))
24         INSTALL_PROGRAM += -s
25 endif
26
27 # Map Debian architectures to LSB architectures
28 lsbarch=${DEB_HOST_ARCH}
29 ifeq (${lsbarch}, i386)
30 lsbarch=ia32
31 endif
32 ifeq (${lsbarch}, powerpc)
33 lsbarch=ppc32
34 endif
35
36 LIBC=libc6 (>> 2.3.5)
37 ifeq (${lsbarch}, hurd-i386)
38 LIBC=libc0.3 (>> 2.3.5)
39 endif
40 ifeq (${lsbarch}, kfreebsd-amd64)
41 LIBC=libc0.1 (>> 2.3.5)
42 endif
43 ifeq (${lsbarch}, kfreebsd-i386)
44 LIBC=libc0.1 (>> 2.3.5)
45 endif
46 ifeq (${lsbarch}, ia64)
47 LIBC=libc6.1 (>> 2.3.5)
48 endif
49 ifeq (${lsbarch}, alpha)
50 LIBC=libc6.1 (>> 2.3.5)
51 endif
52
53 configure: configure-stamp
54 configure-stamp:
55         dh_testdir
56         # Add here commands to configure the package.
57
58         touch configure-stamp
59
60 build: build-stamp
61
62 build-stamp: configure-stamp
63         dh_testdir
64
65         # Add here commands to compile the package.
66         #$(MAKE)
67         #/usr/bin/docbook-to-man debian/lsb.sgml > lsb.1
68
69         touch build-stamp
70
71 clean:
72         dh_testdir
73         dh_testroot
74         rm -f build-stamp configure-stamp *.py[co] debian/lsb*substvars
75
76         # Add here commands to clean up after the build process.
77
78         dh_clean
79
80 install: build
81         dh_testdir
82         dh_testroot
83         dh_prep
84         dh_installdirs
85
86 ifneq ($(distribution),SLP)
87         # Add here commands to install the package into debian/lsb.
88         #$(MAKE) install DESTDIR=$(CURDIR)/debian/lsb
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_release debian/lsb-release/usr/bin
92         cp -p lsb_release.py debian/lsb-release/usr/share/python-support/lsb-release
93         cp -p debian/lsb-release.bugscript debian/lsb-release/usr/share/bug/lsb-release
94 else
95         cp -p init-functions debian/lsb-base/lib/lsb
96 endif
97
98 # Build architecture-independent files here.
99 binary-indep: build install
100         dh_testdir
101         dh_testroot
102         dh_installdebconf -i
103         dh_installdocs -i
104 #       dh_installlogrotate
105 #       dh_installemacsen
106 #       dh_installpam
107 #       dh_installmime
108 #       dh_installinit
109         dh_installcron -i
110         dh_installman -i
111         dh_installinfo -i
112 #       dh_undocumented
113         dh_installchangelogs -i
114         dh_link -i
115         dh_strip -i
116         dh_compress -i
117         dh_fixperms -i
118 #       dh_makeshlibs
119 #       dh_perl
120 ifneq ($(distribution),SLP)
121         dh_pysupport -i
122 endif
123 #       dh_python
124         dh_installdeb -i
125         dh_shlibdeps -i
126         dh_gencontrol -i
127         dh_md5sums -i
128         dh_builddeb -i
129
130 # Build architecture-dependent files here.
131 binary-arch: build install
132         dh_testdir
133         dh_testroot
134         dh_installdebconf -a
135         dh_installdocs -a
136         dh_installexamples -a test/init-skeleton
137         dh_installmenu -a
138 #       dh_installlogrotate
139 #       dh_installemacsen
140 #       dh_installpam
141 #       dh_installmime
142 #       dh_installinit
143         dh_installcron -a
144         dh_installman -a lsb.8
145         dh_installinfo -a
146 #       dh_undocumented
147         dh_installchangelogs -a
148         @echo >> debian/lsb-core.substvars "glibc=${LIBC}"
149 #       @[ ${DEB_HOST_GNU_TYPE} != 'arm-linux-gnueabi' ] && echo >> debian/lsb-cxx.substvars "depends=libstdc++5" || true
150         @echo >> debian/lsb-core.substvars "provides=lsb-core-${lsbarch}"
151         @echo >> debian/lsb-cxx.substvars "provides=lsb-cxx-${lsbarch}"
152         @echo >> debian/lsb-graphics.substvars "provides=lsb-graphics-${lsbarch}"
153         @echo >> debian/lsb-desktop.substvars "provides=lsb-qt4-${lsbarch}, lsb-desktop-${lsbarch}"
154         @echo >> debian/lsb-qt4.substvars "provides=lsb-qt4-${lsbarch}"
155         @echo >> debian/lsb-multimedia.substvars "provides=lsb-multimedia-${lsbarch}"
156         @echo >> debian/lsb-languages.substvars "provides=lsb-languages-${lsbarch}"
157         @echo >> debian/lsb-printing.substvars "provides=lsb-printing-${lsbarch}"
158         @[ ${DEB_HOST_ARCH} = 'amd64' ] && echo >> debian/lsb-core.substvars "depends=libc6-i386, lib32z1" || true
159         @[ ${DEB_HOST_ARCH} = 'kfreebsd-amd64' ] && echo >> debian/lsb-core.substvars "depends=libc0.1-i386, lib32z1" || true
160         dh_link -a
161         dh_strip -a
162         dh_compress -a
163         dh_fixperms -a
164         dh_pysupport -a
165 #       dh_makeshlibs
166         dh_installdeb -a
167 #       dh_perl
168         dh_shlibdeps -a
169         dh_gencontrol -a
170         dh_md5sums -a
171         dh_builddeb -a
172
173 ifneq ($(distribution),SLP)
174 binary: binary-indep binary-arch
175 else
176 binary: binary-indep
177 binary-arch:
178 endif
179
180
181 .PHONY: build clean binary-indep binary-arch binary install configure