summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Nagy2015-06-08 20:32:58 +0200
committerDaniel Nagy2015-06-08 20:32:58 +0200
commitabb4f80d635e5a9b5c0d72d73425553e38014e11 (patch)
tree1c8beac64166d4a0988f14d534aa7227a7ac5084
downloadaur-libmatthew-java.tar.gz
import to aur4
-rw-r--r--.SRCINFO33
-rw-r--r--Makefile33
-rw-r--r--PKGBUILD63
-rw-r--r--ant.patch12
-rw-r--r--build.xml121
-rw-r--r--libmatthew-java.ChangeLog.markdown4
-rw-r--r--setClasspath.sh10
7 files changed, 276 insertions, 0 deletions
diff --git a/.SRCINFO b/.SRCINFO
new file mode 100644
index 000000000000..aca840d889a1
--- /dev/null
+++ b/.SRCINFO
@@ -0,0 +1,33 @@
+pkgbase = libmatthew-java
+ pkgdesc = Libraries for Java: unix sockets, CGI, hexdump
+ pkgver = 0.8
+ pkgrel = 5
+ url = http://www.matthew.ath.cx/projects/java
+ changelog = libmatthew-java.ChangeLog.markdown
+ arch = i686
+ arch = x86_64
+ license = Expat
+ makedepends = java-environment
+ makedepends = apache-ant
+ makedepends = gcc
+ depends = java-runtime
+ depends = glibc
+ replaces = matthew-java
+ source = http://www.java2s.com/Code/JarDownload/libmatthew/libmatthew-0.8-x86_64-sources.jar.zip
+ source = build.xml
+ source = ant.patch
+ source = Makefile
+ source = setClasspath.sh
+ md5sums = 946a87b891bac3021d6cbf6f61321ed3
+ md5sums = 9a463b93dc05caec6d80cfb1ae76798e
+ md5sums = 14bfe88a88143b598ee5c9bd9f0fb087
+ md5sums = 73bc9ff2922322215a4f0dd9b24e9c81
+ md5sums = f00a4d642f2e7f1c7c41f591f461d157
+ sha256sums = fe8c47c0b0db4598f1782bd926fdad48027af05da3a1e7b2f3376ba9d091d387
+ sha256sums = 815d92a888b6d78bdead61146af0aa79007dca6015e693a230f91aca366885a9
+ sha256sums = 119ce6358011568d6afb7bda5079feb4b221fca80e4414f56f60c69091720d52
+ sha256sums = e735d7d37876e0a2ad125f46bcec6073772ce6cf42124f90f1181f4be8c96b27
+ sha256sums = 60196fbe850d098ccc80073eea893405249171a8328060940a1fd81d7d1c621c
+
+pkgname = libmatthew-java
+
diff --git a/Makefile b/Makefile
new file mode 100644
index 000000000000..b052660c44e5
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,33 @@
+CC?=gcc
+LD?=gcc
+CFLAGS+=-Wall -Os -pedantic -Werror
+CSTD?=-std=c99
+CSHAREFLAG+=-fpic -fno-stack-protector
+INCLUDES?=-I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux
+
+LDVER?=$(shell ld -v | cut -d' ' -f1)
+
+ifeq ($(LDVER),GNU)
+LDSHAREFLAGS+=-fpic -shared
+else
+LDSHAREFLAGS+=-lc
+endif
+
+PREFIX?=/usr
+JARDIR?=$(PREFIX)/share/java/libmatthew-java/
+DOCDIR?=$(PREFIX)/share/doc/libmatthew-java/
+LIBDIR?=$(PREFIX)/lib/
+
+MATTVER=0.8
+
+DEBUG?=disable
+
+all: libcgi-java.so libunix-java.so
+
+clean:
+ rm -f *.o *.so
+
+%.o: %.c %.h
+ $(CC) $(CFLAGS) $(CSTD) $(CSHAREFLAG) $(INCLUDES) -c -o $@ $<
+lib%.so: %.o
+ $(CC) $(LDFLAGS) $(LDSHAREFLAGS) -o $@ $<
diff --git a/PKGBUILD b/PKGBUILD
new file mode 100644
index 000000000000..b68e1c9123fe
--- /dev/null
+++ b/PKGBUILD
@@ -0,0 +1,63 @@
+# Maintainer: Daniel Nagy <danielnagy at gmx de>
+# Contributor: [Vitaliy Berdinskikh](mailto:ur6lad@archlinux.org.ua) aka UR6LAD
+
+pkgname=libmatthew-java
+pkgver=0.8
+pkgrel=5
+pkgdesc="Libraries for Java: unix sockets, CGI, hexdump"
+arch=('i686' 'x86_64')
+url="http://www.matthew.ath.cx/projects/java"
+license=('Expat')
+depends=('java-runtime' 'glibc')
+makedepends=('java-environment' 'apache-ant' 'gcc')
+replaces=('matthew-java')
+source=( "http://www.java2s.com/Code/JarDownload/libmatthew/libmatthew-$pkgver-x86_64-sources.jar.zip"
+ "build.xml" "ant.patch" "Makefile" "setClasspath.sh" )
+changelog=${pkgname}.ChangeLog.markdown
+
+build() {
+ cd "${srcdir}"
+
+ mkdir ${pkgname}-${pkgver} && cd ${pkgname}-${pkgver}
+
+ jar xf ../libmatthew-0.8-x86_64-sources.jar
+ cp ../build.xml ../Makefile ./
+ patch -p2 < ../ant.patch
+
+ mkdir -p src/main/java
+ mv cx src/main/java
+ ant jars unix.h cgi.h
+ make
+}
+
+package() {
+ install -m755 -d "${pkgdir}"/usr/share/java/${pkgname} "${pkgdir}"/usr/lib
+
+ cd "${srcdir}"
+
+ install -m644 setClasspath.sh "${pkgdir}"/usr/share/java/${pkgname}
+
+ cd ${pkgname}-${pkgver}
+
+ for i in dist/*.jar; do
+ install -m 644 ${i} "${pkgdir}"/usr/share/java/${pkgname}
+ done
+ for i in "${pkgdir}"/usr/share/java/${pkgname}/*.jar; do
+ _tmpfilename=${i##*\/}
+ ln -sf ${_tmpfilename} "${pkgdir}"/usr/share/java/${pkgname}/${_tmpfilename/-[0-9]\.[0-9]/}
+ done
+ for i in *.so; do
+ install -m 644 ${i} "${pkgdir}"/usr/lib
+ done
+}
+
+md5sums=('946a87b891bac3021d6cbf6f61321ed3'
+ '9a463b93dc05caec6d80cfb1ae76798e'
+ '14bfe88a88143b598ee5c9bd9f0fb087'
+ '73bc9ff2922322215a4f0dd9b24e9c81'
+ 'f00a4d642f2e7f1c7c41f591f461d157')
+sha256sums=('fe8c47c0b0db4598f1782bd926fdad48027af05da3a1e7b2f3376ba9d091d387'
+ '815d92a888b6d78bdead61146af0aa79007dca6015e693a230f91aca366885a9'
+ '119ce6358011568d6afb7bda5079feb4b221fca80e4414f56f60c69091720d52'
+ 'e735d7d37876e0a2ad125f46bcec6073772ce6cf42124f90f1181f4be8c96b27'
+ '60196fbe850d098ccc80073eea893405249171a8328060940a1fd81d7d1c621c')
diff --git a/ant.patch b/ant.patch
new file mode 100644
index 000000000000..5b89e0c99543
--- /dev/null
+++ b/ant.patch
@@ -0,0 +1,12 @@
+diff -ur a/libmatthew-java-0.8/cx/ath/matthew/debug/Debug.jpp b/libmatthew-java-0.8/cx/ath/matthew/debug/Debug.jpp
+--- a/libmatthew-java-0.8/cx/ath/matthew/debug/Debug.jpp 2011-06-28 11:26:14.000000000 +0300
++++ b/libmatthew-java-0.8/cx/ath/matthew/debug/Debug.jpp 2011-07-16 09:01:31.000000000 +0300
+@@ -93,7 +93,7 @@
+ /** Verbose debug messages */
+ public static final int VERBOSE = 6;
+ /** Set this to false to disable compilation of Debug statements */
+- public static final boolean debug = DEBUGSETTING;
++ public static final boolean debug = @DEBUGSETTING@;
+ /** The current output stream (defaults to System.err) */
+ public static PrintStream debugout = System.err;
+ private static Properties prop = null;
diff --git a/build.xml b/build.xml
new file mode 100644
index 000000000000..2eb7da4e46f2
--- /dev/null
+++ b/build.xml
@@ -0,0 +1,121 @@
+
+<project name="libmatthew-java" default="jar" basedir=".">
+
+ <description>Libraries for Java: unix sockets, CGI, hexdump</description>
+
+ <property file="local.properties"/>
+
+ <property name="ant.project.version" value="0.4"/>
+ <property name="libmatthew.unix.version" value="0.5"/>
+ <property name="libmatthew.cgi.version" value="0.6"/>
+ <property name="libmatthew.debug.version" value="1.1"/>
+ <property name="libmatthew.io.version" value="0.1"/>
+ <property name="libmatthew.hexdump.version" value="0.2"/>
+ <property name="src" location="src"/>
+ <property name="src.main.java" location="${src}/main/java"/>
+ <property name="build" location="build"/>
+ <property name="build.output" location="${build}"/>
+ <property name="dist" location="dist"/>
+
+ <property name="jardir" value="/usr/share/java/${ant.project.name}"/>
+
+ <target name="init">
+ <tstamp prefix="touch.time"/>
+ <condition property="java.5.available">
+ <or>
+ <contains string="${java.version}" substring="1.5"/>
+ <contains string="${java.version}" substring="1.6"/>
+ <contains string="${java.version}" substring="1.7"/>
+ </or>
+ </condition>
+ <fail message="This package requires Java 5, 6 or 7." unless="java.5.available"/>
+ <condition property="ant.1.7.available">
+ <or>
+ <contains string="${ant.version}" substring="1.7"/>
+ <contains string="${ant.version}" substring="1.8"/>
+ <contains string="${ant.version}" substring="1.9"/>
+ </or>
+ </condition>
+ <fail message="This package requires Ant 1.7 or 1.8 or 1.9 ." unless="ant.1.7.available"/>
+ <mkdir dir="${build.output}"/>
+ </target>
+
+ <target name="clean" description="Clean the output directories">
+ <delete dir="${build}"/>
+ <delete dir="${dist}"/>
+ </target>
+
+ <target name="compile" depends="init" description="Compile the code">
+ <javac srcdir="${src.main.java}" destdir="${build.output}" encoding="UTF-8" excludes="cx/ath/matthew/debug/Debug.java" optimize="true" target="1.5" source="1.5">
+ <!--<compilerarg value="-Xlint:unchecked"/>--></javac>
+ </target>
+
+ <target name="unix.jar" depends="compile" description="Create the JAR">
+ <mkdir dir="${dist}"/>
+ <jar jarfile="${dist}/unix-${libmatthew.unix.version}.jar" includes="cx/ath/matthew/unix/**" basedir="${build.output}"/>
+ </target>
+
+ <target name="cgi.jar" depends="compile" description="Create the JAR">
+ <mkdir dir="${dist}"/>
+ <jar jarfile="${dist}/cgi-${libmatthew.cgi.version}.jar" includes="cx/ath/matthew/cgi/**" basedir="${build.output}"/>
+ </target>
+
+ <target name="debug-enable.jar" depends="init" description="Create the JAR">
+ <mkdir dir="${dist}"/>
+ <delete dir="${build.output}/cx/ath/matthew/debug"/>
+ <filter token="DEBUGSETTING" value="true"/>
+ <copy file="${src.main.java}/cx/ath/matthew/debug/Debug.jpp" tofile="${src.main.java}/cx/ath/matthew/debug/Debug.java" filtering="on" overwrite="true"/>
+ <javac srcdir="${src.main.java}" destdir="${build.output}" encoding="UTF-8" includes="cx/ath/matthew/debug/Debug.java" optimize="true" target="1.5" source="1.5"/>
+ <jar jarfile="${dist}/debug-enable-${libmatthew.debug.version}.jar" includes="cx/ath/matthew/debug/**" basedir="${build.output}">
+ <manifest>
+ <attribute name="Class-Path" value="${jardir}/hexdump.jar"/>
+ </manifest>
+ </jar>
+ </target>
+
+ <target name="debug-disable.jar" depends="init" description="Create the JAR">
+ <mkdir dir="${dist}"/>
+ <delete dir="${build.output}/cx/ath/matthew/debug"/>
+ <filter token="DEBUGSETTING" value="false"/>
+ <copy file="${src.main.java}/cx/ath/matthew/debug/Debug.jpp" tofile="${src.main.java}/cx/ath/matthew/debug/Debug.java" filtering="on" overwrite="true"/>
+ <javac srcdir="${src.main.java}" destdir="${build.output}" encoding="UTF-8" includes="cx/ath/matthew/debug/Debug.java" optimize="true" target="1.5" source="1.5"/>
+ <jar jarfile="${dist}/debug-disable-${libmatthew.debug.version}.jar" includes="cx/ath/matthew/debug/**" basedir="${build.output}">
+ <manifest>
+ <attribute name="Class-Path" value="${jardir}/hexdump.jar"/>
+ </manifest>
+ </jar>
+ </target>
+
+ <target name="io.jar" depends="compile" description="Create the JAR">
+ <mkdir dir="${dist}"/>
+ <jar jarfile="${dist}/io-${libmatthew.io.version}.jar" includes="cx/ath/matthew/io/**" basedir="${build.output}"/>
+ </target>
+
+ <target name="hexdump.jar" depends="compile" description="Create the JAR">
+ <mkdir dir="${dist}"/>
+ <jar jarfile="${dist}/hexdump-${libmatthew.hexdump.version}.jar" includes="cx/ath/matthew/utils/Hexdump.class" basedir="${build.output}"/>
+ </target>
+
+ <target name="jars" depends="unix.jar,cgi.jar,debug-enable.jar,debug-disable.jar,io.jar,hexdump.jar"></target>
+
+ <target name="unix.h">
+ <javah classpath="${build.output}" outputFile="${basedir}/unix-java.h">
+ <class name="cx.ath.matthew.unix.UnixServerSocket"/>
+ <class name="cx.ath.matthew.unix.UnixSocket"/>
+ <class name="cx.ath.matthew.unix.USInputStream"/>
+ <class name="cx.ath.matthew.unix.USOutputStream"/>
+ </javah>
+ </target>
+
+ <target name="cgi.h">
+ <javah classpath="${build.output}" outputFile="${basedir}/cgi-java.h" class="cx.ath.matthew.cgi.CGI"/>
+ </target>
+
+ <target name="source" depends="init" description="Pack project">
+ <mkdir dir="${dist}"/>
+ <tar destfile="${dist}/${ant.project.name}-src-${touch.time.DSTAMP}${touch.time.TSTAMP}.tar" basedir="${basedir}" includes="src/** *.c build.xml changelog COPYING INSTAL README Makefile"/>
+ <gzip destfile="${dist}/${ant.project.name}-src-${touch.time.DSTAMP}${touch.time.TSTAMP}.tar.gz" src="${dist}/${ant.project.name}-src-${touch.time.DSTAMP}${touch.time.TSTAMP}.tar"/>
+ <delete file="${dist}/${ant.project.name}-src-${touch.time.DSTAMP}${touch.time.TSTAMP}.tar"/>
+ </target>
+
+</project>
diff --git a/libmatthew-java.ChangeLog.markdown b/libmatthew-java.ChangeLog.markdown
new file mode 100644
index 000000000000..886d6edc23f8
--- /dev/null
+++ b/libmatthew-java.ChangeLog.markdown
@@ -0,0 +1,4 @@
+Version 0.8-1 (Sat Jul 16 09:12:14 EEST 2011)
+---
+
+* Change classpath variables: remove D-Bus jars, rename
diff --git a/setClasspath.sh b/setClasspath.sh
new file mode 100644
index 000000000000..8494da619c81
--- /dev/null
+++ b/setClasspath.sh
@@ -0,0 +1,10 @@
+#!/bin/sh
+
+##
+# This script will set libmatthew-java classpath variables.
+##
+
+LIBMATTHEW_HOME=/usr/share/java/libmatthew
+UNIX_SOCKETS=${LIBMATTHEW_HOME}/unix.jar:${LIBMATTHEW_HOME}/debug-disable.jar:${LIBMATTHEW_HOME}/hexdump.jar
+UNIX_SOCKET_DEBUG=${LIBMATTHEW_HOME}/unix.jar:${LIBMATTHEW_HOME}/debug-enable.jar:${LIBMATTHEW_HOME}/hexdump.jar
+