File: rules

package info (click to toggle)
lucene2 2.9.4+ds1-6
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 25,300 kB
  • ctags: 23,000
  • sloc: java: 166,802; xml: 5,774; sh: 733; perl: 601; jsp: 311; makefile: 65; csh: 4
file content (111 lines) | stat: -rwxr-xr-x 5,032 bytes parent folder | download
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
#!/usr/bin/make -f
# -*- makefile -*-

include /usr/share/cdbs/1/rules/debhelper.mk
include /usr/share/cdbs/1/class/ant.mk

# Uncomment this to turn on verbose mode.
#export DH_VERBOSE=1

DEB_INSTALL_CHANGELOGS_liblucene2-java := CHANGES.txt

JAVA_HOME := /usr/lib/jvm/default-java

DEB_ANT_BUILD_TARGET := javacc jar-core build-contrib war-demo javadocs
# Disable the tests because the cause random build failures (#749365)
#DEB_ANT_CHECK_TARGET := test
DEB_ANT_CLEAN_TARGET := clean clean-javacc

# Needed for running javacc and the unit tests
DEB_JARS = ant-nodeps ant-contrib ant-junit junit

# Upstream Lucene name
UPSTREAM_VERSION := $(shell echo $(DEB_UPSTREAM_VERSION) | grep -o "^[^+]*" | sed -e "s/~/-/" )
UPSTREAM_BASENAME := lucene-$(UPSTREAM_VERSION)
CHANGESFILE = ../lucene2_$(DEB_VERSION)_$(DEB_BUILD_ARCH).changes

clean::
	# 'ant test' in contrib/db leaves some stuff behind...
	rm -rf $(CURDIR)/contrib/db/bdb/index
	# Same for 'ant test' in contrib/benchmark
	rm -rf $(CURDIR)/contrib/benchmark/temp/*
	rm -rf $(CURDIR)/contrib/benchmark/work/index
	rm -rf $(CURDIR)/contrib/benchmark/work/reuters
	rm -rf $(CURDIR)/contrib/benchmark/work/reuters-out
	# Tags for backward compatibility testing
	rm -rf $(CURDIR)/tags
	# remove keyring, since it is a binary file
	rm -f debian/lucene-keyring.gpg
	rm -f debian/KEYS
	# remove all javacc-generated files from src and contrib, except those
	# that are not regenerated properly
	# Now done in build.xml target clean-javacc
	#fgrep -Rl "Generated By:JavaCC:" $(CURDIR)/src/ $(CURDIR)/contrib/ | grep -v analysis/standard/ParseException.java\\\|precedence\\\|surround | xargs rm -f
	rm -r -f test

install/liblucene2-java::
	# Install the libraries into the liblucene2-java package

	# Install the core library
	install -m 0644 build/lucene-core-$(UPSTREAM_VERSION).jar $(CURDIR)/debian/liblucene2-java/usr/share/java
	ln -s lucene-core-$(UPSTREAM_VERSION).jar $(CURDIR)/debian/liblucene2-java/usr/share/java/lucene-core.jar

	# Install contrib libraries
	CONTRIB_JARS=`find build/contrib/ -name \*-$(UPSTREAM_VERSION).jar` ; \
	for jarfile in $$CONTRIB_JARS; do \
	    install -m 0644 "$$jarfile" $(CURDIR)/debian/liblucene2-java/usr/share/java ; \
	    CONTRIB=`echo $$jarfile | sed "s/.*\\/lucene-\\([-a-z]*\\)-.*\\.jar/\\1/"` ; \
	    ln -s lucene-$$CONTRIB-$(UPSTREAM_VERSION).jar $(CURDIR)/debian/liblucene2-java/usr/share/java/lucene-$$CONTRIB.jar ; \
	done
	install -d $(CURDIR)/debian/liblucene2-java/usr/lib/liblucene2-java
	install contrib/lucli/run.sh $(CURDIR)/debian/liblucene2-java/usr/lib/liblucene2-java/lucli
	gzip <debian/lucli.1 >$(CURDIR)/debian/liblucene2-java/usr/lib/liblucene2-java/lucli.1.gz

install/liblucene2-java-doc::
	# Install the documentation into the liblucene2-java-doc package

	mkdir -p  $(CURDIR)/debian/liblucene2-java-doc/usr/share/doc/liblucene2-java-doc/
	cp -r docs $(CURDIR)/debian/liblucene2-java-doc/usr/share/doc/liblucene2-java-doc/
	cp -r build/docs/* $(CURDIR)/debian/liblucene2-java-doc/usr/share/doc/liblucene2-java-doc/docs/
	# Remove empty directories
	# rmdir --ignore-fail-on-non-empty $(CURDIR)/debian/liblucene2-java-doc/usr/share/doc/liblucene2-java-doc/docs/skin/css
	# rmdir --ignore-fail-on-non-empty $(CURDIR)/debian/liblucene2-java-doc/usr/share/doc/liblucene2-java-doc/docs/skin/scripts
	# rmdir --ignore-fail-on-non-empty $(CURDIR)/debian/liblucene2-java-doc/usr/share/doc/liblucene2-java-doc/docs/skin/translations
	# Remove unused embedded prototype library
	rm -f $(CURDIR)/debian/liblucene2-java-doc/usr/share/doc/liblucene2-java-doc/docs/skin/prototype.js
	install -d $(CURDIR)/debian/liblucene2-java-doc/usr/share/doc/liblucene2-java-doc/demo
	install -m 644 build/lucene-demos-$(UPSTREAM_VERSION).jar $(CURDIR)/debian/liblucene2-java-doc/usr/share/doc/liblucene2-java-doc/demo/
	install -m 644 build/luceneweb.war $(CURDIR)/debian/liblucene2-java-doc/usr/share/doc/liblucene2-java-doc/demo/
	# Fix Lintian error privacy-breach-logo and Lintian warning privacy-breach-generic
	find $(CURDIR)/debian/liblucene2-java-doc/ -type f -exec sed -i 's/http:\/\/www.apache.org\/images\/asf_logo_simple.png//g' {} \;
	find $(CURDIR)/debian/liblucene2-java-doc/ -type f -exec sed -i 's/http:\/\/lucene.apache.org\/images\/lucene_green_300.gif//g' {} \;


remove-source:
	rm -f build.xml
	rm -f common-build.xml
	rm -f *.txt
	rm -f *stamp
	rm -f *pom.xml.template
	rm -rf debian/patched
	rm -rf build dist docs example lib src contrib

restore-from-source: remove-source
	tar xzf ../lucene2_$(DEB_UPSTREAM_VERSION).orig.tar.gz
	mv $(UPSTREAM_BASENAME)/* .
	rmdir $(UPSTREAM_BASENAME)

get-orig-source:
	debian/get-orig-source.sh

check:
	lintian -i $(CHANGESFILE)
	zgrep "^---" ../lucene2_$(DEB_VERSION).diff.gz | grep -v debian ; [ $$? != 0 ]
	( for p in $(DEB_ALL_PACKAGES); do \
	      dpkg --contents ../$${p}_$(DEB_VERSION)_all.deb ; \
	  done ) | less

upload:
	dupload -t mentors $(CHANGESFILE)

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