[pkg-java] r2883 - trunk/mysql-connector-java/debian

Marcus Better marcusb-guest at alioth.debian.org
Sat Dec 23 22:37:47 CET 2006


Author: marcusb-guest
Date: 2006-12-23 22:37:47 +0100 (Sat, 23 Dec 2006)
New Revision: 2883

Modified:
   trunk/mysql-connector-java/debian/rules
Log:
Use java-gcj-compat. No CDBS.


Modified: trunk/mysql-connector-java/debian/rules
===================================================================
--- trunk/mysql-connector-java/debian/rules	2006-12-23 21:37:26 UTC (rev 2882)
+++ trunk/mysql-connector-java/debian/rules	2006-12-23 21:37:47 UTC (rev 2883)
@@ -1,21 +1,65 @@
 #!/usr/bin/make -f
-# debian/rules file for mysql-connector-java (uses cdbs)
 
-include /usr/share/cdbs/1/rules/debhelper.mk
-include /usr/share/cdbs/1/rules/simple-patchsys.mk
-include /usr/share/cdbs/1/class/ant.mk
+JAVA_HOME	:= /usr/lib/jvm/java-gcj
+DEB_JARS_BASE	:= /usr/share/java
+JAVACMD	 	:= $(JAVA_HOME)/bin/java
 
-UPSTREAM_VERSION := $(shell head -1 debian/changelog | cut -f2 -d\( | cut -f1 -d\) | cut -f1 -d\-)
+DEB_JARS 	:= ant ant-launcher ant-junit commons-logging log4j-1.2 junit
+DEB_CLASSPATH = $(shell for jar in $(DEB_JARS); do \
+		if [ -f "$$jar" ]; then echo -n "$${jar}:"; fi; \
+		if [ -f "$$jar".jar ]; then echo -n "$${jar}.jar:"; fi; \
+		if [ -f $(DEB_JARS_BASE)/"$$jar" ]; then echo -n "$(DEB_JARS_BASE)/$${jar}:"; fi; \
+		if [ -f $(DEB_JARS_BASE)/"$$jar".jar ]; then echo -n "$(DEB_JARS_BASE)/$${jar}.jar:"; fi; \
+		done; \
+		if [ -f "$(JAVA_HOME)/lib/tools.jar" ]; then echo -n "$(JAVA_HOME)/lib/tools.jar"; fi)
 
-JAVA_HOME := /usr/lib/kaffe
-ANT_HOME := /usr/share/ant
 
-DEB_JARS := $(ANT_HOME)/lib/ant-launcher.jar log4j-1.2 junit
-DEB_ANT_BUILD_TARGET := dist
+ANT_INVOKE	:= $(JAVACMD) -classpath $(DEB_CLASSPATH) \
+		org.apache.tools.ant.Main $(ANT_ARGS)
 
-clean::  # remove the build/dist directory as the build.xml is not patched at this moment
-	rm -rf build
+PKGNAME		:= libmysql-java
+LIBNAME		:= mysql-connector-java
+INSTALL_DIR	:= $(CURDIR)/debian/$(PKGNAME)
+JAVALIB_DIR	:= $(INSTALL_DIR)/usr/share/java
+VERSION         := $(shell dpkg-parsechangelog | grep ^Version: | sed 's/Version: //' | cut -f1 -d-)
 
-install/libmysql-java::
-	install -m 644 build/mysql-connector-java-$(UPSTREAM_VERSION)/mysql-connector-java-$(UPSTREAM_VERSION)-bin.jar debian/libmysql-java/usr/share/java/mysql-$(UPSTREAM_VERSION).jar
-	ln -s mysql-$(UPSTREAM_VERSION).jar debian/libmysql-java/usr/share/java/mysql.jar	
+build: build-stamp
+build-stamp:
+	dh_testdir
+	$(ANT_INVOKE) dist
+	touch build-stamp
+
+clean:
+	dh_testdir
+	dh_testroot
+	$(ANT_INVOKE) clean
+	rm -rf dist
+	dh_clean
+
+install: build
+	dh_testdir
+	dh_testroot
+	dh_clean -k 
+	dh_installdirs
+
+binary-indep: build install
+	dh_testdir
+	dh_testroot
+	dh_installchangelogs CHANGES
+	dh_installdocs
+	dh_install
+	install -m 644 build/$(LIBNAME)-$(VERSION)/$(LIBNAME)-$(VERSION)-bin.jar $(JAVALIB_DIR)/$(LIBNAME)-$(VERSION).jar
+	ln -s $(LIBNAME)-$(VERSION).jar $(JAVALIB_DIR)/$(LIBNAME).jar
+	ln -s $(LIBNAME)-$(VERSION).jar $(JAVALIB_DIR)/mysql-$(VERSION).jar
+	ln -s $(JAVALIB_DIR)/mysql-$(VERSION).jar $(JAVALIB_DIR)/mysql.jar
+	dh_compress
+	dh_fixperms
+	dh_installdeb
+	dh_gencontrol
+	dh_md5sums
+	dh_builddeb
+
+binary-arch: build install
+
+binary: binary-indep binary-arch
+.PHONY: build clean binary-indep binary-arch binary install




More information about the pkg-java-commits mailing list