File: rules

package info (click to toggle)
easymock 3.2%2Bds-4
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,324 kB
  • ctags: 2,320
  • sloc: java: 12,656; xml: 220; makefile: 48
file content (58 lines) | stat: -rwxr-xr-x 2,102 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
#!/usr/bin/make -f
export JAVA_HOME=/usr/lib/jvm/default-java
export CLASSPATH=/usr/share/java/objenesis.jar:/usr/share/java/cglib3.jar:/usr/share/java/junit4.jar
PKD  = $(abspath $(dir $(MAKEFILE_LIST)))
PKG  = $(word 2,$(shell dpkg-parsechangelog -l$(PKD)/changelog | grep ^Source))
VER ?= $(shell dpkg-parsechangelog -l$(PKD)/changelog | perl -ne 'print $$1 if m{^Version:\s*([\d\.]+)}')
DTYPE = +ds

%:
	dh $@ --with javahelper,jh_maven_repo_helper

override_dh_auto_build:
	ant -f $(CURDIR)/debian/build.xml jar javadoc test

override_dh_auto_clean:
	dh_auto_clean
	ant -f $(CURDIR)/debian/build.xml clean

.PHONY: get-orig-source
## http://wiki.debian.org/onlyjob/get-orig-source
get-orig-source: $(PKG)_$(VER)$(DTYPE).orig.tar.xz $(info I: $(PKG)_$(VER)$(DTYPE))
	@

$(PKG)-$(VER):
	@echo "# Downloading..."
	uscan --noconf --verbose --rename --repack --destdir=$(CURDIR) --check-dirname-level=0 --force-download --download-version $(VER) $(PKD)
	@echo "# Extracting..."
	mkdir -p \
		$(PKG)-$(VER)-PRE \
		$(PKG)-$(VER)/src \
		$(PKG)-$(VER)/samples \
		$(PKG)-$(VER)/tests \
	&& tar -xf $(PKG)_$(VER).orig.tar.* --directory $(PKG)-$(VER)-PRE --strip-components 1 \
	|| $(RM) -r $(PKG)-$(VER)-PRE
	unzip $(PKG)-$(VER)-PRE/easymock-$(VER)-sources.jar -d $(PKG)-$(VER)/src
	unzip $(PKG)-$(VER)-PRE/easymock-$(VER)-samples.jar -d $(PKG)-$(VER)/samples
	unzip $(PKG)-$(VER)-PRE/easymock-$(VER)-tests.jar -d $(PKG)-$(VER)/tests
	@echo "# Cleaning-up..."
	$(RM) -r -v \
		$(PKG)-$(VER)-PRE/*.jar
	cp -v $(PKG)-$(VER)-PRE/* $(PKG)-$(VER)
	cd $(PKG)-$(VER) \
	&& $(RM) -r -v \
		samples/META-INF/ \
		tests/META-INF/ \
		src/META-INF/ \
	&& find . -depth -type f -name "*.class" -exec $(RM) '{}' \;

$(PKG)_$(VER)$(DTYPE).orig.tar.xz: $(PKG)-$(VER)
	@echo "# Packing..."
	find -L "$(PKG)-$(VER)" -xdev -type f -print | sort \
	| XZ_OPT="-6v" tar -caf "$(PKG)_$(VER)$(DTYPE).orig.tar.xz" -T- --owner=root --group=root --mode=a+rX \
	&& $(RM) -r "$(PKG)-$(VER)" "$(PKG)-$(VER)-PRE"


get-orig-pom:
	wget -O debian/pom.xml \
	http://repo1.maven.org/maven2/org/easymock/easymock/$(VER)/easymock-$(VER).pom