debian swirl logo

Back to the packages list maven-debian-helper

#!/usr/bin/make -f

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

PACKAGE              := $(DEB_SOURCE_PACKAGE)
VERSION              := $(shell echo ${DEB_UPSTREAM_VERSION} | sed -r 's/([0-9\.]+).*/\1/')
JAVA_HOME            := /usr/lib/jvm/default-java
DEB_JARS             := ant-junit junit commons-io classworlds maven-core maven-artifact maven-artifact-manager maven-model \
 maven-compat maven-plugin-api maven-project maven-scm-api velocity file-management plexus-utils \
 plexus-container-default-alpha maven-repo-helper
DEB_ANT_BUILD_TARGET := package #javadoc
DEB_ANT_BUILDFILE    := debian/build.xml
DEB_ANT_ARGS         := -Dpackage=$(PACKAGE) -Dbin.package=$(PACKAGE)
API_DOCS             := target/api

debian/.mh:
		mkdir -p debian/.mh

debian/.mh/bin: debian/.mh
		cp -R bin debian/.mh/

debian/.mh/etc: debian/.mh
		cp -R etc debian/.mh/

debian/.mh/share: debian/.mh
		cp -R share debian/.mh/

makebuilddir/$(PACKAGE):: debian/.mh/bin debian/.mh/etc debian/.mh/share

# Generation of man pages
SCRIPTS       := $(wildcard bin/mh_*)
MAN_PAGES     := $(addprefix debian/.mh/doc/,$(addsuffix .1, $(notdir $(SCRIPTS))))
debian/.mh/mh_% : bin/mh_%
		mkdir -p debian/.mh
		cp $< $@
		chmod +x $@
debian/.mh/doc/mh_%.1 : debian/.mh/mh_% 
		mkdir -p debian/.mh/doc
		help2man -N -o $@ $<
man-pages: $(MAN_PAGES)
build/$(PACKAGE):: man-pages

install/$(PACKAGE)::
		mh_install -p$(PACKAGE)
		pod2man -c 'Maven for Debian GNU/Linux' \
		  -r maven-debian-helper-$(DEB_UPSTREAM_VERSION) \
		  man/mvn-debian.pod > man/mvn-debian.1
		dh_installman $(MAN_PAGES) man/mvn-debian.1
		install -D share/perl/maven.pm debian/tmp/$$(perl -MConfig -e 'print $$Config{vendorlib}')/Debian/Debhelper/Buildsystem/maven.pm

cleanbuilddir::
		mh_unpatchpoms -p$(PACKAGE)

clean::
		-$(RM) man/mvn-debian.1
		mh_clean

# Helper target, to use when updating the version of this package
update-package-version:
		perl -p -i -e "s/^    ([0-9\.]+<)/    ${VERSION}
		perl -p -i -e "s/^        ([0-9\.]+<)/        ${VERSION}
	perl -p -i -e "s/maven-debian-helper \(>= ([0-9\.]+)\)/maven-debian-helper \(>= ${VERSION})/" share/cdbs/1/class/maven-vars.mk maven-packager-utils/src/main/resources/control.vm


Builds:

maven-debian-helper
helper tools for building debian packages with maven