[r803734] Minor improvements to Debian packaging.
[harmony.git] / debian / rules
blobb26aa8be087231345ea24c636d7b5c8f67853a13
1 #!/usr/bin/make -f
2 # -*- makefile -*-
3 # Sample debian/rules that uses debhelper.
5 # This file was originally written by Joey Hess and Craig Small.
6 # As a special exception, when this file is copied by dh-make into a
7 # dh-make output file, you may use that output file without restriction.
8 # This special exception was added by Craig Small in version 0.37 of dh-make.
10 # Modified to make a template file for a multi-binary package with separated
11 # build-arch and build-indep targets by Bill Allombert 2001
13 # -lib /usr/share/java ensures that ant finds ecj.jar, etc
14 ANT_FLAGS = -lib /usr/share/java \
15 -Dhy.local.zlib=true -Dhy.zip.api=false \
16 -Dhy.no.thr=false -Dauto.fetch=true
17 VMDIR=$(CURDIR)/debian/harmony-5.0-drlvm
18 CLDIR=$(CURDIR)/debian/harmony-5.0-classlib
19 JREDIR=$(CURDIR)/debian/harmony-5.0-jre
20 JDKDIR=$(CURDIR)/debian/harmony-5.0-jdk
21 HDKDIR=$(CURDIR)/debian/harmony-5.0-hdk
23 # Uncomment this to turn on verbose mode.
24 #export DH_VERBOSE=1
26 # This has to be exported to make some magic below work.
27 export DH_OPTIONS
31 CFLAGS = -Wall -g
33 ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
34 CFLAGS += -O0
35 else
36 CFLAGS += -O1
37 endif
39 configure: configure-stamp
40 configure-stamp:
41 dh_testdir
42 # Add here commands to configure the package.
43 touch configure-stamp
46 #Architecture
47 build: build-arch build-indep
49 build-arch: build-arch-stamp
50 build-arch-stamp: configure-stamp
52 # Add here commands to compile the arch part of the package.
53 ant $(ANT_FLAGS)
54 touch $@
56 build-indep: build-indep-stamp
57 build-indep-stamp: configure-stamp
59 # Add here commands to compile the indep part of the package.
60 #$(MAKE) doc
61 touch $@
63 clean:
64 dh_testdir
65 dh_testroot
66 rm -f build-arch-stamp build-indep-stamp #CONFIGURE-STAMP#
68 # Add here commands to clean up after the build process.
69 ant $(ANT_FLAGS) clean
71 dh_clean --exclude ./working_classlib/modules/luni/src/main/native/fdlibm_dist/Makefile.orig --exclude ./working_classlib/modules/luni/src/main/native/fdlibm_dist/fdlibm.h.orig --exclude ./working_classlib/modules/luni/src/main/native/fdlibm_dist/s_lib_version.c.orig --exclude ./working_classlib/modules/archive/src/main/native/zlib_dist/Makefile.orig
73 install: install-indep install-arch
74 install-indep:
75 dh_testdir
76 dh_testroot
77 dh_clean -k -i --exclude ./working_classlib/modules/luni/src/main/native/fdlibm_dist/Makefile.orig --exclude ./working_classlib/modules/luni/src/main/native/fdlibm_dist/fdlibm.h.orig --exclude ./working_classlib/modules/luni/src/main/native/fdlibm_dist/s_lib_version.c.orig --exclude ./working_classlib/modules/archive/src/main/native/zlib_dist/Makefile.orig
78 dh_installdirs -i
80 # Add here commands to install the indep part of the package into
81 # debian/<package>-doc.
82 #INSTALLDOC#
84 dh_install -i
86 install-arch:
87 dh_testdir
88 dh_testroot
89 dh_clean -k -s --exclude ./working_classlib/modules/luni/src/main/native/fdlibm_dist/Makefile.orig --exclude ./working_classlib/modules/luni/src/main/native/fdlibm_dist/fdlibm.h.orig --exclude ./working_classlib/modules/luni/src/main/native/fdlibm_dist/s_lib_version.c.orig --exclude ./working_classlib/modules/archive/src/main/native/zlib_dist/Makefile.orig
90 dh_installdirs -s
92 mkdir -p $(VMDIR)/usr/lib/harmony-5.0/jdk/jre/bin
93 -rm -rf $(VMDIR)/usr/lib/harmony-5.0/jdk/jre/bin/drlvm
94 mv $(CURDIR)/target/hdk/jdk/jre/bin/default \
95 $(VMDIR)/usr/lib/harmony-5.0/jdk/jre/bin/drlvm
96 mv $(CURDIR)/target/hdk/jdk/jre/bin/libhythr.so \
97 $(VMDIR)/usr/lib/harmony-5.0/jdk/jre/bin
98 mkdir -p $(VMDIR)/usr/share/lintian/overrides
99 cp -pr $(CURDIR)/debian/harmony-5.0-drlvm.lintian \
100 $(VMDIR)/usr/share/lintian/overrides/harmony-5.0-drlvm
102 mkdir -p $(CLDIR)/usr/lib/harmony-5.0/jdk
103 -rm -rf $(CLDIR)/usr/lib/harmony-5.0/jdk/jre
104 mv $(CURDIR)/target/hdk/jdk/jre $(CLDIR)/usr/lib/harmony-5.0/jdk
106 mkdir -p $(JREDIR)/usr/lib/harmony-5.0/jdk/jre/bin
107 mv $(CLDIR)/usr/lib/harmony-5.0/jdk/jre/bin/java \
108 $(JREDIR)/usr/lib/harmony-5.0/jdk/jre/bin
110 mkdir -p $(JDKDIR)/usr/lib/harmony-5.0
111 -rm -rf $(JDKDIR)/usr/lib/harmony-5.0/jdk
112 mv $(CURDIR)/target/hdk/jdk $(JDKDIR)/usr/lib/harmony-5.0
114 mkdir -p $(HDKDIR)/usr/lib
115 -rm -rf $(HDKDIR)/usr/lib/harmony-5.0
116 mv $(CURDIR)/target/hdk $(HDKDIR)/usr/lib/harmony-5.0
118 dh_install -s
119 # Must not depend on anything. This is to be called by
120 # binary-arch/binary-indep
121 # in another 'make' thread.
122 binary-common:
123 dh_testdir
124 dh_testroot
125 dh_installchangelogs
126 dh_installdocs
127 dh_installexamples
128 # dh_installmenu
129 # dh_installdebconf
130 # dh_installlogrotate
131 # dh_installemacsen
132 # dh_installpam
133 # dh_installmime
134 # dh_python
135 # dh_installinit
136 # dh_installcron
137 # dh_installinfo
138 dh_installman
139 dh_link
140 dh_strip
141 dh_compress
142 dh_fixperms
143 # dh_perl
144 dh_makeshlibs
145 dh_installdeb
146 LD_LIBRARY_PATH=debian/harmony-5.0-drlvm/usr/lib/harmony-5.0/jdk/jre/bin:debian/harmony-5.0-drlvm/usr/lib/harmony-5.0/jdk/jre/bin/drlvm:$LD_LIBRARY_PATH dh_shlibdeps
147 dh_gencontrol
148 dh_md5sums
149 dh_builddeb
150 # Build architecture independant packages using the common target.
151 binary-indep: build-indep install-indep
152 $(MAKE) -f debian/rules DH_OPTIONS=-i binary-common
154 # Build architecture dependant packages using the common target.
155 binary-arch: build-arch install-arch
156 $(MAKE) -f debian/rules DH_OPTIONS=-s binary-common
158 binary: binary-arch binary-indep
159 .PHONY: build clean binary-indep binary-arch binary install install-indep install-arch configure