rpms/libmatthew-java/devel classpath_fix.patch, NONE, 1.1 early_upstream.patch, NONE, 1.1 import.log, NONE, 1.1 install_doc.patch, NONE, 1.1 jpackage_compliance.patch, NONE, 1.1 libmatthew-java.spec, NONE, 1.1 makefile.patch, NONE, 1.1 openjdk.patch, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2
Omair Majid (omajid)
fedora-extras-commits at redhat.com
Fri Jun 27 19:52:55 UTC 2008
Author: omajid
Update of /cvs/pkgs/rpms/libmatthew-java/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv8128/devel
Modified Files:
.cvsignore sources
Added Files:
classpath_fix.patch early_upstream.patch import.log
install_doc.patch jpackage_compliance.patch
libmatthew-java.spec makefile.patch openjdk.patch
Log Message:
Initial import of libmatthew-java
classpath_fix.patch:
--- NEW FILE classpath_fix.patch ---
diff --git a/Makefile b/Makefile
index 5ba907f..9183316 100644
--- a/Makefile
+++ b/Makefile
@@ -57,11 +57,12 @@ cgi-$(CGIVER).jar: .classes
io-$(IOVER).jar: .classes
(cd classes; $(JAR) cf ../$@ cx/ath/matthew/io/*class)
unix-$(UNIXVER).jar: .classes
-ifeq ($(DEBUG),enable)
- echo "Class-Path: $(JARDIR)/debug-$(DEBUG).jar" > Manifest
-else
- echo "Class-Path: " > Manifest
-endif
+#ifeq ($(DEBUG),enable)
+# echo "Class-Path: $(JARDIR)/debug-$(DEBUG).jar" > Manifest
+#else
+# echo "Class-Path: " > Manifest
+#endif
+ echo > Manifest
(cd classes; $(JAR) cfm ../$@ ../Manifest cx/ath/matthew/unix/*class)
hexdump-$(HEXVER).jar: .classes
@@ -86,11 +87,13 @@ libmatthew-java-$(MATTVER).tar.gz: Makefile cx cgi-java.c unix-java.c README INS
debug-enable-$(DEBUGVER).jar: cx/ath/matthew/debug/Debug.jpp
make .enabledebug
- echo "Class-Path: $(JARDIR)/hexdump.jar" > Manifest
+ #echo "Class-Path: $(JARDIR)/hexdump.jar" > Manifest
+ echo > Manifest
(cd classes;jar cfm ../$@ ../Manifest cx/ath/matthew/debug/*.class)
debug-disable-$(DEBUGVER).jar: cx/ath/matthew/debug/Debug.jpp
make .disabledebug
- echo "Class-Path: $(JARDIR)/hexdump.jar" > Manifest
+ #echo "Class-Path: $(JARDIR)/hexdump.jar" > Manifest
+ echo > Manifest
(cd classes;jar cfm ../$@ ../Manifest cx/ath/matthew/debug/*.class)
.enabledebug: cx/ath/matthew/debug/Debug.jpp
mkdir -p classes
early_upstream.patch:
--- NEW FILE early_upstream.patch ---
diff --git a/unix-java.c b/unix-java.c
index 25f6282..15fffbf 100644
--- a/unix-java.c
+++ b/unix-java.c
@@ -18,6 +18,10 @@
*
*/
+
+/* _GNU_SOURCE is required to use struct ucred in glibc 2.8 */
+#define _GNU_SOURCE
+
#include "unix-java.h"
#include <stdio.h>
#include <stdlib.h>
@@ -381,9 +385,9 @@ JNIEXPORT void JNICALL Java_cx_ath_matthew_unix_UnixSocket_native_1send_1creds
cmsg->cmsg_len = CMSG_LEN(sizeof(struct ucred));
/* Initialize the payload: */
creds = (struct ucred *)CMSG_DATA(cmsg);
- creds.pid = getpid();
- creds.uid = getuid();
- creds.gid = getgid();
+ creds->pid = getpid();
+ creds->uid = getuid();
+ creds->gid = getgid();
#endif
int rv = sendmsg(sock, &msg, 0);
@@ -399,7 +403,7 @@ JNIEXPORT jbyte JNICALL Java_cx_ath_matthew_unix_UnixSocket_native_1recv_1creds
(JNIEnv *env, jobject o, jint sock, jintArray jcreds)
{
struct msghdr msg;
- char buf = 0;
+ char iov_buf = 0;
struct iovec iov;
msg.msg_name = NULL;
msg.msg_namelen = 0;
@@ -408,7 +412,7 @@ JNIEXPORT jbyte JNICALL Java_cx_ath_matthew_unix_UnixSocket_native_1recv_1creds
msg.msg_iovlen = 1;
msg.msg_control = NULL;
msg.msg_controllen = 0;
- iov.iov_base = &buf;
+ iov.iov_base = &iov_buf;
iov.iov_len = 1;
#ifdef SCM_CREDENTIALS
@@ -422,9 +426,9 @@ JNIEXPORT jbyte JNICALL Java_cx_ath_matthew_unix_UnixSocket_native_1recv_1creds
recvmsg(sock, &msg, 0);
#ifdef SCM_CREDENTIALS
- for (cmsg = CMSG_FIRSTHDR(&msgh);
+ for (cmsg = CMSG_FIRSTHDR(&msg);
cmsg != NULL;
- cmsg = CMSG_NXTHDR(&msgh,cmsg)) {
+ cmsg = CMSG_NXTHDR(&msg,cmsg)) {
if (cmsg->cmsg_level == SOL_SOCKET
&& cmsg->cmsg_type == SCM_CREDENTIALS) {
creds = (struct ucred *) CMSG_DATA(cmsg);
@@ -432,11 +436,15 @@ JNIEXPORT jbyte JNICALL Java_cx_ath_matthew_unix_UnixSocket_native_1recv_1creds
}
}
if (NULL != creds) {
- (*env)->SetIntArrayRegion(env, jcreds, 0, 3, creds);
+ jint cred_array[3];
+ cred_array[0] = creds->pid;
+ cred_array[1] = creds->uid;
+ cred_array[2] = creds->gid;
+ (*env)->SetIntArrayRegion(env, jcreds, 0, 3, &cred_array[0]);
}
#endif
- return buf;
+ return iov_buf;
}
--- NEW FILE import.log ---
libmatthew-java-0_7_1-1_fc9:HEAD:libmatthew-java-0.7.1-1.fc9.src.rpm:1214596290
install_doc.patch:
--- NEW FILE install_doc.patch ---
diff --git a/Makefile b/Makefile
index 7607a79..4f6e728 100644
--- a/Makefile
+++ b/Makefile
@@ -39,7 +39,7 @@ DEBUG?=disable
.NOPARALLEL:
-all: unix-$(UNIXVER).jar cgi-$(CGIVER).jar debug-enable-$(DEBUGVER).jar debug-disable-$(DEBUGVER).jar io-$(IOVER).jar hexdump-$(HEXVER).jar libcgi-java.so libunix-java.so
+all: unix-$(UNIXVER).jar cgi-$(CGIVER).jar debug-enable-$(DEBUGVER).jar debug-disable-$(DEBUGVER).jar io-$(IOVER).jar hexdump-$(HEXVER).jar libcgi-java.so libunix-java.so doc
classes: .classes
.classes: $(SRC)
@@ -134,4 +134,4 @@ install-jar: unix-$(UNIXVER).jar cgi-$(CGIVER).jar debug-enable-$(DEBUGVER).jar
ln -sf cgi-$(CGIVER).jar $(DESTDIR)$(JARDIR)/cgi.jar
ln -sf hexdump-$(HEXVER).jar $(DESTDIR)$(JARDIR)/hexdump.jar
-install: install-native install-jar
+install: install-native install-jar install-doc
jpackage_compliance.patch:
--- NEW FILE jpackage_compliance.patch ---
commit e918f093b3f8accc607e38b1d0142b629b78c495
Author: Omair Majid <omajid at toddler.yyz.redhat.com>
Date: Thu Jun 19 16:35:58 2008 -0400
fit Jpackage guidlines
diff --git a/Makefile b/Makefile
index bae6552..7607a79 100644
--- a/Makefile
+++ b/Makefile
@@ -21,10 +21,10 @@ else
LDFLAGS+=-lc
endif
-PREFIX?=/usr/local
-JARDIR?=$(PREFIX)/share/java
+PREFIX?=/usr
+JARDIR?=$(PREFIX)/lib/libmatthew-java
DOCDIR?=$(PREFIX)/share/doc/libmatthew-java/
-LIBDIR?=$(PREFIX)/lib/jni
+LIBDIR?=$(PREFIX)/lib/libmatthew-java
MATTVER=0.7
DEBUGVER=1.1
diff --git a/cx/ath/matthew/cgi/CGI.java b/cx/ath/matthew/cgi/CGI.java
index 5f1ee6a..c7291a2 100644
--- a/cx/ath/matthew/cgi/CGI.java
+++ b/cx/ath/matthew/cgi/CGI.java
@@ -52,7 +52,7 @@ abstract public class CGI
private native Object[] getfullenv(Class c);
private native void setenv(String var, String value);
{
- System.loadLibrary("cgi-java");
+ System.load("/usr/lib/libmatthew-java/libcgi-java.so");
}
/**
diff --git a/cx/ath/matthew/unix/UnixServerSocket.java b/cx/ath/matthew/unix/UnixServerSocket.java
index 9556aa6..2ffeb7f 100644
--- a/cx/ath/matthew/unix/UnixServerSocket.java
+++ b/cx/ath/matthew/unix/UnixServerSocket.java
@@ -26,7 +26,7 @@ import java.io.IOException;
*/
public class UnixServerSocket
{
- static { System.loadLibrary("unix-java"); }
+ static { System.load("/usr/lib/libmatthew-java/libunix-java.so"); }
private native int native_bind(String address, boolean abs) throws IOException;
private native void native_close(int sock) throws IOException;
private native int native_accept(int sock) throws IOException;
diff --git a/cx/ath/matthew/unix/UnixSocket.java b/cx/ath/matthew/unix/UnixSocket.java
index c1dab21..c68d0c0 100644
--- a/cx/ath/matthew/unix/UnixSocket.java
+++ b/cx/ath/matthew/unix/UnixSocket.java
@@ -30,7 +30,7 @@ import cx.ath.matthew.debug.Debug;
*/
public class UnixSocket
{
- static { System.loadLibrary("unix-java"); }
+ static { System.load("/usr/lib/libmatthew-java/libunix-java.so"); }
private native void native_set_pass_cred(int sock, boolean passcred) throws IOException;
private native int native_connect(String address, boolean abs) throws IOException;
private native void native_close(int sock) throws IOException;
--- NEW FILE libmatthew-java.spec ---
%define with_gcj %{!?_without_gcj:1}%{?_without_gcj:0}
Name: libmatthew-java
Version: 0.7.1
Release: 1%{?dist}
Summary: A few useful Java libraries
Group: Development/Libraries
License: LGPLv2
# actual upstream:
#URL: http://matthew.ath.cx/projects/java/
#Source0: http://matthew.ath.cx/projects/java/%{name}-%{version}.tar.gz
# upstream author is also the debian maintainer for this package.
# he gets newer releases into debian before he puts them up on
# the upstream website. so we use the "original" source from debian
# (ie, the source before debian patches are applied to it)
URL: http://packages.debian.org/source/sid/%{name}
Source0: http://ftp.de.debian.org/debian/pool/main/libm/%{name}/%{name}_%{version}.orig.tar.gz
Patch0: early_upstream.patch
Patch1: install_doc.patch
Patch2: jpackage_compliance.patch
Patch3: classpath_fix.patch
Patch4: openjdk.patch
Patch5: makefile.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: java-1.6.0-openjdk-devel
BuildRequires: jpackage-utils
Requires: java-1.6.0-openjdk
Requires: jpackage-utils
%if %{with_gcj}
BuildRequires: java-gcj-compat-devel >= 1.0.31
Requires(post): java-gcj-compat >= 1.0.31
Requires(postun): java-gcj-compat >= 1.0.31
%endif
%description
A colleciton of Java libraries:
- Unix Sockets Library
This is a collection of classes and native code to allow you to read
and write Unix sockets in Java.
- Debug Library
This is a comprehensive logging and debugging solution.
- CGI Library
This is a collection of classes and native code to allow you to write
CGI applications in Java.
- I/O Library
This provides a few much needed extensions to the Java I/O subsystem.
- Hexdump
This class formats byte-arrays in hex and ascii for display.
%package javadoc
Summary: Javadoc for %{name}
Group: Development/Libraries
Requires: jpackage-utils
%description javadoc
Javadoc for %{name}
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
%build
make %{?_smp_mflags} \
CFLAGS='%{optflags}'\
GCJFLAGS='%{optflags}' \
LDFLAGS='%{optflags}' \
PPFLAGS='%{optflags}'
%install
rm -rf $RPM_BUILD_ROOT
make install \
DESTDIR=$RPM_BUILD_ROOT \
JARDIR=%{_libdir}/%{name} \
LIBDIR=%{_libdir}/%{name} \
DOCDIR=%{_javadocdir}/%{name}
%if %{with_gcj}
%{_bindir}/aot-compile-rpm
%endif
%post
%if %{with_gcj}
if [ -x %{_bindir}/rebuild-gcj-db ]
then
%{_bindir}/rebuild-gcj-db
fi
%endif
%postun
%if %{with_gcj}
if [ -x %{_bindir}/rebuild-gcj-db ]
then
%{_bindir}/rebuild-gcj-db
fi
%endif
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%{_libdir}/%{name}
%doc COPYING INSTALL README
%if %{with_gcj}
%attr(-,root,root) %{_libdir}/gcj/%{name}
%endif
%files javadoc
%{_javadocdir}/%{name}
%changelog
* Wed Jun 25 2008 Omair Majid <omajid at redhat.com> 0.7.1-1.fc9
- Initial build for fedora
makefile.patch:
--- NEW FILE makefile.patch ---
--- a/Makefile
+++ b/Makefile
index 66b303d..67fd151 100644
@@ -3,23 +3,26 @@ JAVADOC?=javadoc
JAR?=jar
JAVAH?=javah
GCJ?=gcj
CC?=gcc
-LD?=ld
-PPFLAGS+=-C -P
-CFLAGS+=-fpic -Wall -Os -pedantic -std=c99 -Werror
-GCJFLAGS+=-fjni
-#JCFLAGS+=-source 5.0
+LD?=gcc
+JPPFLAGS+=-C -P
+CFLAGS+=-Wall -Os -pedantic -Werror
+CSTD?=-std=c99
+CSHAREFLAG+=-fpic
+GCJJNIFLAG=-fjni
+#JVERCFLAGS+=-source 5.0
+JCFLAGS+=
INCLUDES+=-I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux
JAVADOCFLAGS?=-quiet -author -link http://java.sun.com/j2se/1.4.2/docs/api/
LDVER?=$(shell ld -v | cut -d' ' -f1)
UNAME?=$(shell uname -s)
ifeq ($(LDVER),GNU)
-LDFLAGS+=-fpic -shared -lc
+LDSHAREFLAGS+=-fpic -shared
else
-LDFLAGS+=-lc
+LDSHAREFLAGS+=-lc
endif
PREFIX?=/usr
JARDIR?=$(PREFIX)/lib/libmatthew-java
@@ -44,9 +47,9 @@ all: unix-$(UNIXVER).jar cgi-$(CGIVER).jar debug-enable-$(DEBUGVER).jar debug-di
classes: .classes
.classes: $(SRC)
mkdir -p classes
$(MAKE) .$(DEBUG)debug
- $(JAVAC) $(JCFLAGS) -d classes -cp classes $^
+ $(JAVAC) $(JVERCFLAGS) $(JCFLAGS) -d classes -cp classes $^
touch .classes
clean:
rm -rf classes doc
rm -f .classes .enabledebug .disabledebug *.o *.h *.so *.tar.gz *.jar *.cgi Manifest
@@ -63,18 +66,18 @@ unix-$(UNIXVER).jar: .classes
hexdump-$(HEXVER).jar: .classes
(cd classes; $(JAR) cf ../$@ cx/ath/matthew/utils/Hexdump.class)
%.o: %.c %.h
- $(CC) $(CFLAGS) $(INCLUDES) -c -o $@ $<
+ $(CC) $(CFLAGS) $(CSTD) $(CSHAREFLAG) $(INCLUDES) -c -o $@ $<
lib%.so: %.o
- $(LD) $(LDFLAGS) -o $@ $<
+ $(CC) $(LDFLAGS) $(LDSHAREFLAGS) -o $@ $<
unix-java.h: .classes
$(JAVAH) -classpath classes -o $@ cx.ath.matthew.unix.UnixServerSocket cx.ath.matthew.unix.UnixSocket cx.ath.matthew.unix.USInputStream cx.ath.matthew.unix.USOutputStream
cgi-java.h: .classes
$(JAVAH) -classpath classes -o $@ cx.ath.matthew.cgi.CGI
test.cgi: cgi-$(CGIVER).jar libcgi-java.so
- $(GCJ) $(GCJFLAGS) -L. -lcgi-java -o test.cgi --main=cx.ath.matthew.cgi.testcgi cgi-$(CGIVER).jar
+ $(GCJ) $(GCJFLAGS) $(GCJJNIFLAG) -L. -lcgi-java -o test.cgi --main=cx.ath.matthew.cgi.testcgi cgi-$(CGIVER).jar
libmatthew-java-$(MATTVER).tar.gz: Makefile cx cgi-java.c unix-java.c README INSTALL COPYING changelog
mkdir -p libmatthew-java-$(MATTVER)
cp -a $^ libmatthew-java-$(MATTVER)
@@ -87,16 +90,16 @@ debug-disable-$(DEBUGVER).jar: cx/ath/matthew/debug/Debug.jpp
make .disabledebug
(cd classes;jar cfm ../$@ ../Manifest cx/ath/matthew/debug/*.class)
.enabledebug: cx/ath/matthew/debug/Debug.jpp
mkdir -p classes
- cpp $(PPFLAGS) -DDEBUGSETTING=true < cx/ath/matthew/debug/Debug.jpp > cx/ath/matthew/debug/Debug.java
- $(JAVAC) $(JCFLAGS) -cp classes -d classes cx/ath/matthew/debug/Debug.java cx/ath/matthew/utils/Hexdump.java
+ cpp $(PPFLAGS) $(JPPFLAGS) -DDEBUGSETTING=true < cx/ath/matthew/debug/Debug.jpp > cx/ath/matthew/debug/Debug.java
+ $(JAVAC) $(JVERCFLAGS) $(JCFLAGS) -cp classes -d classes cx/ath/matthew/debug/Debug.java cx/ath/matthew/utils/Hexdump.java
rm -f .disabledebug
touch .enabledebug
.disabledebug: cx/ath/matthew/debug/Debug.jpp
mkdir -p classes
- cpp $(PPFLAGS) -DDEBUGSETTING=false < cx/ath/matthew/debug/Debug.jpp > cx/ath/matthew/debug/Debug.java
- $(JAVAC) $(JCFLAGS) -cp classes -d classes cx/ath/matthew/debug/Debug.java cx/ath/matthew/utils/Hexdump.java
+ cpp $(PPFLAGS) $(JPPFLAGS) -DDEBUGSETTING=false < cx/ath/matthew/debug/Debug.jpp > cx/ath/matthew/debug/Debug.java
+ $(JAVAC) $(JVERCFLAGS) $(JCFLAGS) -cp classes -d classes cx/ath/matthew/debug/Debug.java cx/ath/matthew/utils/Hexdump.java
rm -f .enabledebug
touch .disabledebug
cx/ath/matthew/debug/Debug.java: .disabledebug
doc/index.html:
openjdk.patch:
--- NEW FILE openjdk.patch ---
diff --git a/Makefile b/Makefile
index 5ba907f..54019bc 100644
--- a/Makefile
+++ b/Makefile
@@ -8,7 +8,7 @@ LD?=ld
PPFLAGS+=-C -P
CFLAGS+=-fpic -Wall -Os -pedantic -std=c99 -Werror
GCJFLAGS+=-fjni
-JCFLAGS+=-source 5.0
+#JCFLAGS+=-source 5.0
INCLUDES+=-I$(JAVA_HOME)/include -I$(JAVA_HOME)/include/linux
JAVADOCFLAGS?=-quiet -author -link http://java.sun.com/j2se/1.4.2/docs/api/
Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/libmatthew-java/devel/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- .cvsignore 27 Jun 2008 17:00:45 -0000 1.1
+++ .cvsignore 27 Jun 2008 19:52:15 -0000 1.2
@@ -0,0 +1 @@
+libmatthew-java_0.7.1.orig.tar.gz
Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/libmatthew-java/devel/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- sources 27 Jun 2008 17:00:45 -0000 1.1
+++ sources 27 Jun 2008 19:52:15 -0000 1.2
@@ -0,0 +1 @@
+d6145d37c6d289713d68c5745eab23af libmatthew-java_0.7.1.orig.tar.gz
More information about the fedora-extras-commits
mailing list