File: rules

package info (click to toggle)
groovy 0.1.0beta10-2
  • links: PTS
  • area: contrib
  • in suites: sarge
  • size: 11,636 kB
  • ctags: 7,195
  • sloc: java: 44,640; xml: 1,199; sh: 544; makefile: 79; ansic: 43
file content (167 lines) | stat: -rwxr-xr-x 4,747 bytes parent folder | download | duplicates (2)
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
#!/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

antlibjars = ant.jar ant-junit.jar ant-launcher.jar
sharejars = asm.jar asm-analysis.jar asm-attrs.jar asm-util.jar bsf.jar \
            classworlds.jar commons-cli.jar commons-logging.jar junit.jar \
	    mockobjects-core.jar mx4j.jar regexp.jar servlet-2.3.jar
groovylibdir = $(CURDIR)/debian/lib
groovybins = grok groovy groovyc groovyConsole groovysh


configure: configure-stamp
configure-stamp:
	dh_testdir
	# Add here commands to configure the package.
	
	# Extract bundled dependencies (see README.Debian for explanation)
	mkdir -p $(groovylibdir)
	cd $(CURDIR)/debian/lib && uudecode $(CURDIR)/debian/bundled.tar.bz2.uue | tar xvjf - 

	# Symlink pre-packged dependencies already available as Debian packages
	
	# ant jars from /usr/share/ant/lib
	for i in $(antjars); do \
		echo "Symlinking /usr/share/ant/lib/$$i to $(groovylibdir)"; \
		ln -s /usr/share/ant/lib/$$i $(groovylibdir); \
	done
	
	# core jars from /usr/share/java
	for i in $(sharejars); do \
		echo "Symlinking /usr/share/java/$$i to $(groovylibdir)"; \
		ln -s /usr/share/java/$$i $(groovylibdir); \
	done


	touch configure-stamp


build: build-stamp

build-stamp: configure-stamp 
	dh_testdir

	# Add here commands to compile the package.
	#$(MAKE)
	ant -Dlibdir=$(groovylibdir) -Dtargetinstalldir=$(CURDIR)/debian/groovy/usr/share/groovy
	#docbook-to-man debian/groovy.sgml > groovy.1

	touch build-stamp

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

	# Add here commands to clean up after the build process.
	#-$(MAKE) clean
	ant clean
	rm -rf $(groovylibdir)

	dh_clean 

install: build
	dh_testdir
	dh_testroot
	dh_clean -k 
	dh_installdirs

	# Add here commands to install the package into debian/groovy.
	#$(MAKE) install DESTDIR=$(CURDIR)/debian/groovy
	
	# install batch scripts
	for i in $(groovybins); do \
		install -m 755 src/bin/$$i $(CURDIR)/debian/groovy/usr/share/groovy/bin; \
	done
	
	# insert fixed GROOVY_HOME into all bin files
	#for i in $(CURDIR)/debian/groovy/usr/share/groovy/bin/*; do \
	#	cat $$i | sed 's#CLASSWORLDS_VERSION=\"1.0\"#&\nGROOVY_HOME=\"/usr/share/groovy\"\n#' > /tmp/groovy.tmp; \
	#	mv /tmp/groovy.tmp $$i; \
	#	chmod 755 $$i; \
	#done

	# install configuration files
	for i in src/conf/*; do \
		install -m 644 $$i $(CURDIR)/debian/groovy/usr/share/groovy/conf; \
	done
	
	# install bundled libraries (others are symlinked via the links file)
	for i in `find debian/lib -type f`; do \
		install -m 644 $$i $(CURDIR)/debian/groovy/usr/share/groovy/lib; \
	done
	
	# install groovy library
	install -m 644 target/groovy-1.0*.jar $(CURDIR)/debian/groovy/usr/share/groovy/lib
	
	# build and install embedded groovy library
	ant -Dlibdir=$(groovylibdir) -Dtargetinstalldir=$(CURDIR)/debian/groovy/usr/share/groovy embedded
	
	# install website documentation
	uudecode debian/website-1.0beta8.tar.bz2.uue | \
		( cd $(CURDIR)/debian/groovy-doc/usr/share/doc/groovy-doc && tar xvjf - )
	
	# build and install groovy API javadoc
	ant -Dlibdir=$(groovylibdir) \
		-Djavadocdir=$(CURDIR)/debian/groovy-doc/usr/share/doc/groovy-doc/groovy.codehaus.org/apidocs javadoc

	# build and install groovy JDK documentation
	ant -Dlibdir=$(groovylibdir) groovy-jdk

	# install groovy examples
	cp -ra src/examples $(CURDIR)/debian/groovy-doc/usr/share/doc/groovy-doc
	
# Build architecture-independent files here.
binary-indep: build install
# We have nothing to do by default.

# Build architecture-dependent files here.
binary-arch: build install
	dh_testdir
	dh_testroot
	dh_installchangelogs 
	dh_installdocs
	dh_installexamples
#	dh_install
#	dh_installmenu
#	dh_installdebconf	
#	dh_installlogrotate
#	dh_installemacsen
#	dh_installpam
#	dh_installmime
#	dh_installinit
#	dh_installcron
#	dh_installinfo
	dh_installman
	dh_link
	dh_strip
	dh_compress
	dh_fixperms
#	dh_perl
#	dh_python
#	dh_makeshlibs
	dh_installdeb
	dh_shlibdeps
	dh_gencontrol
	dh_md5sums
	dh_builddeb

binary: binary-indep binary-arch

# Makes a 1 link shallow copy of the Groovy website for the groovy-doc package
site:
	rm -rf debian/site
	mkdir debian/site
	cd debian/site && wget -E -k -r -l 2 -p http://groovy.codehaus.org/
	cd debian/site && tar cvjf - * | uuencode -m /dev/stdout > ../website-1.0beta8.tar.bz2.uue
	rm -rf debian/site

.PHONY: build clean binary-indep binary-arch binary install configure