debian swirl logo

Back to the packages list aspectj

#!/usr/bin/make -f

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

JAVA_HOME := /usr/lib/jvm/default-java
MODULES := org.aspectj/modules
DEB_BUILDDIR = $(MODULES)/build
DEB_ANT_BUILD_TARGET = aspectj
DEB_JARS = xalan2 ant-junit
DEB_COMPRESS_EXCLUDE = .pdf .java .xml

MKDIR := mkdir -p
LN_S := ln -sf

AJ_SCRIPTS  := debian/ajc debian/ajbrowser debian/ajdoc debian/aj debian/aj5
AJ_MANPAGES := debian/ajc.1 debian/ajdoc.1 debian/aj.1 debian/ajbrowser.1

AJ_ANT_HOME := $(MODULES)/lib/ant
AJ_ANT_JARS := ant.jar ant-junit.jar
AJ_XML_JARS := xercesImpl.jar xml-apis.jar

AJ_JUNIT_HOME := $(MODULES)/lib/junit
AJ_JUNIT_JARS := junit.jar

AJ_COMMONS_HOME := $(MODULES)/lib/commons
AJ_COMMONS_JAR := commons-logging.jar

AJ_ECLIPSE_HOME := $(MODULES)/lib/eclipse
AJ_BCEL_HOME := $(MODULES)/lib/bcel
AJ_ASM_HOME := $(MODULES)/lib/asm
AJ_JROCKIT_HOME := $(MODULES)/lib/ext/jrockit

VERSION := $(shell echo $(DEB_UPSTREAM_VERSION) | sed 's/+dfsg//')

pre-build:: debian/stamp-bootstrap

debian/aj.1: debian/aj.sgml
		docbook-to-man $< > $@

debian/ajbrowser.1: debian/ajbrowser.sgml
		docbook-to-man $< > $@

# reuse the DocBook xml documents here to generate manpages.
debian/%.1: org.aspectj/modules/docs/devGuideDB/%.xml
		sh debian/manpage_from.sh $< > $@

.PHONY: bootstrap
bootstrap: debian/stamp-bootstrap

debian/stamp-bootstrap: DEB_BUILDDIR= $(CURDIR)
debian/stamp-bootstrap: DEB_ANT_BUILDFILE= $(CURDIR)/debian/bootstrap.xml
debian/stamp-bootstrap:
	# Setup symlinks: ant
		$(MKDIR) $(AJ_ANT_HOME)/lib
		for f in $(AJ_ANT_JARS) ; do \
		   $(LN_S) /usr/share/ant/lib/$$f $(AJ_ANT_HOME)/lib ; \
		done
		for f in $(AJ_XML_JARS) ; do \
		   $(LN_S) /usr/share/java/$$f $(AJ_ANT_HOME)/lib ; \
		done

	# JUnit
		$(MKDIR) $(AJ_JUNIT_HOME)
		for f in $(AJ_JUNIT_JARS) ; do \
		   $(LN_S) /usr/share/java/$$f $(AJ_JUNIT_HOME) ; \
		done

	# commons-logging
		$(MKDIR) $(AJ_COMMONS_HOME)
		$(LN_S) /usr/share/java/$(AJ_COMMONS_JAR) $(AJ_COMMONS_HOME)/commons.jar
		
	# Setup our local.properties
		cp debian/local.properties $(MODULES)/build

	# asm3
		$(MKDIR) $(AJ_ASM_HOME)
		$(LN_S) /usr/share/java/asm3.jar $(AJ_ASM_HOME)/asm-3.1.jar
		$(LN_S) /usr/share/java/asm3.jar $(AJ_ASM_HOME)/asm-3.3.1.renamed.jar
		
	# eclipse (JDT)
		$(MKDIR) $(AJ_ECLIPSE_HOME)
		$(LN_S) /usr/lib/eclipse/plugins/org.eclipse.equinox.common_*.jar $(AJ_ECLIPSE_HOME)/org.eclipse.equinox.common.jar
		$(LN_S) /usr/lib/eclipse/plugins/org.eclipse.equinox.registry_*.jar $(AJ_ECLIPSE_HOME)/org.eclipse.equinox.registry.jar
		$(LN_S) /usr/lib/eclipse/plugins/org.eclipse.core.resources_*.jar $(AJ_ECLIPSE_HOME)/org.eclipse.core.resources.jar
		$(LN_S) /usr/lib/eclipse/plugins/org.eclipse.core.runtime_*.jar $(AJ_ECLIPSE_HOME)/org.eclipse.core.runtime.jar
		$(LN_S) /usr/lib/eclipse/plugins/org.eclipse.core.jobs_*.jar $(AJ_ECLIPSE_HOME)/org.eclipse.core.jobs.jar
		$(LN_S) /usr/lib/eclipse/plugins/org.eclipse.osgi_*.jar $(AJ_ECLIPSE_HOME)/org.eclipse.osgi.jar
		
		$(DEB_ANT_INVOKE)
		touch $@

.PHONY: clean-bootstrap
clean-bootstrap: DEB_BUILDDIR= $(CURDIR)
clean-bootstrap: DEB_ANT_BUILDFILE= $(CURDIR)/debian/bootstrap.xml
clean-bootstrap:
		$(DEB_ANT_INVOKE) clean
		rm -f debian/stamp-bootstrap

install/aspectj:: $(AJ_MANPAGES)
		for f in $(AJ_SCRIPTS) ; do \
		   dh_install $$f /usr/bin ; \
		done

install/libaspectj-java::
		mh_installpom -plibaspectj-java -e$(VERSION) org.aspectj/modules/build/aspectjrt.pom
		mh_installjar -plibaspectj-java -e$(VERSION) -l org.aspectj/modules/build/aspectjrt.pom \
			org.aspectj/modules/aj-build/dist/tools/lib/aspectjrt.jar
		mh_installpom -plibaspectj-java -e$(VERSION) org.aspectj/modules/build/aspectjtools.pom
		mh_installjar -plibaspectj-java -e$(VERSION) -l org.aspectj/modules/build/aspectjtools.pom \
			org.aspectj/modules/aj-build/dist/tools/lib/aspectjtools.jar
		mh_installpom -plibaspectj-java -e$(VERSION) org.aspectj/modules/build/aspectjweaver.pom
		mh_installjar -plibaspectj-java -e$(VERSION) -l org.aspectj/modules/build/aspectjweaver.pom \
			org.aspectj/modules/aj-build/dist/tools/lib/aspectjweaver.jar

install/aspectj-doc::
		mv org.aspectj/modules/docs/dist/doc/changes.html org.aspectj/modules/docs/dist/doc/changelog.html
		html2text -o org.aspectj/modules/docs/dist/doc/changelog.txt org.aspectj/modules/docs/dist/doc/changelog.html
		dh_installchangelogs org.aspectj/modules/docs/dist/doc/changelog.html
		dh_installchangelogs org.aspectj/modules/docs/dist/doc/changelog.txt

clean::
		rm -Rf $(AJ_ECLIPSE_HOME)
		rm -Rf $(AJ_BOOT_HOME)/lib/aspectj*.jar
		rm -Rf $(AJ_ASM_HOME)/asm-3.1.jar
		rm -f $(DEB_BUILDDIR)/local.properties $(AJ_MANPAGES)
		rm -Rf $(AJ_COMMONS_HOME)
		rm -Rf $(AJ_JUNIT_HOME)
		rm -Rf $(AJ_ANT_HOME)
		rm -Rf $(MODULES)/aj-build
		-rm -rf debian/tmp

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

Builds:

aspectj
aspect-oriented extension for java - tools
aspectj-doc
aspect-oriented extension for java - documentation
libaspectj-java
aspect-oriented extension for java - library
libaspectj-java-doc
aspect-oriented extension for java - api documentation