#!/usr/bin/make -f

export VERSION=$(shell dpkg-parsechangelog -SVersion | sed -e 's,^\(.*:\)*\(.*\)+dfsg-.*,\2,')

%:
	dh $@ --buildsystem=ivy --with maven-repo-helper

override_dh_auto_build:
	dh_auto_build -- -buildfile queryparser/build.xml regenerate
	dh_auto_build -- -Dversion=$(VERSION) jar

override_dh_installchangelogs:
	dh_installchangelogs CHANGES.txt

override_dh_auto_clean:
	dh_auto_clean
	rm -rf debian/_ivy
	find -path \*/lib/\*.jar | xargs -r rm -f

get-orig-pom:
	for module in parent solr-grandparent analyzers-common analyzers-icu analyzers-kuromoji analyzers-morfologik analyzers-phonetic analyzers-smartcn analyzers-stempel analyzers-uima benchmark classification codecs core demo expressions facet grouping highlighter join memory misc queries queryparser replicator sandbox spatial suggest test-framework; do \
		wget https://repo1.maven.org/maven2/org/apache/lucene/lucene-$$module/$(VERSION)/lucene-$$module-$(VERSION).pom -O debian/poms/lucene-$$module.pom.xml ; \
	done
