[gluegen2] Initial import from SRPM
Clément David
davidcl at fedoraproject.org
Wed Oct 3 06:15:23 UTC 2012
commit 4a6d6111c50fb6653cfe5f46214dd8b09a2dfe6b
Author: Clément DAVID <davidcl at fedorapeople.org>
Date: Wed Oct 3 08:14:28 2012 +0200
Initial import from SRPM
.gitignore | 1 +
gluegen2-0001-renamed-library.patch | 11 +
gluegen2-0002-use-fedora-jni.patch | 27 +++
gluegen2-0003-disable-executable-tmp-tests.patch | 26 +++
gluegen2.spec | 229 ++++++++++++++++++++++
sources | 1 +
6 files changed, 295 insertions(+), 0 deletions(-)
---
diff --git a/.gitignore b/.gitignore
index e69de29..48aecbd 100644
--- a/.gitignore
+++ b/.gitignore
@@ -0,0 +1 @@
+/gluegen-v2.0-rc10.tar.7z
diff --git a/gluegen2-0001-renamed-library.patch b/gluegen2-0001-renamed-library.patch
new file mode 100644
index 0000000..76ac410
--- /dev/null
+++ b/gluegen2-0001-renamed-library.patch
@@ -0,0 +1,11 @@
+--- a/src/java/com/jogamp/common/os/Platform.java
++++ b/src/java/com/jogamp/common/os/Platform.java
+@@ -139,7 +139,7 @@ public class Platform extends PlatformPr
+ private static final String useTempJarCachePropName = "jogamp.gluegen.UseTempJarCache";
+
+ /** fixed basename of JAR file and native library */
+- private static final String libBaseName = "gluegen-rt";
++ private static final String libBaseName = "gluegen2-rt";
+
+ //
+ // static initialization order:
diff --git a/gluegen2-0002-use-fedora-jni.patch b/gluegen2-0002-use-fedora-jni.patch
new file mode 100644
index 0000000..e81944d
--- /dev/null
+++ b/gluegen2-0002-use-fedora-jni.patch
@@ -0,0 +1,27 @@
+--- a/src/java/com/jogamp/common/os/Platform.java
++++ b/src/java/com/jogamp/common/os/Platform.java
+@@ -177,8 +177,7 @@ public class Platform extends PlatformPr
+ platformClassJarURL = _platformClassJarURL;
+ }
+
+- USE_TEMP_JAR_CACHE = (OS_TYPE != OSType.ANDROID) && isRunningFromJarURL() &&
+- Debug.getBooleanProperty(useTempJarCachePropName, true, true);
++ USE_TEMP_JAR_CACHE = false;
+
+ loadGlueGenRTImpl();
+
+@@ -246,7 +245,13 @@ public class Platform extends PlatformPr
+ System.err.println("Catched "+e0.getClass().getSimpleName()+": "+e0.getMessage()+", while TempJarCache.bootstrapNativeLib() of "+nativeJarURL+" ("+jarUrlRoot+" + "+nativeJarName+")");
+ }
+ }
+- DynamicLibraryBundle.GlueJNILibLoader.loadLibrary(libBaseName, false, Platform.class.getClassLoader());
++ try {
++ final String path = "%{_libdir}/%{name}/";
++ final String lib = path + System.mapLibraryName(libBaseName);
++ System.load(lib);
++ } catch (Exception e) {
++ e.printStackTrace();
++ }
+ return null;
+ }
+ });
diff --git a/gluegen2-0003-disable-executable-tmp-tests.patch b/gluegen2-0003-disable-executable-tmp-tests.patch
new file mode 100644
index 0000000..4e0bd8e
--- /dev/null
+++ b/gluegen2-0003-disable-executable-tmp-tests.patch
@@ -0,0 +1,26 @@
+--- a/src/junit/com/jogamp/common/util/TestTempJarCache.java
++++ b/src/junit/com/jogamp/common/util/TestTempJarCache.java
+@@ -189,6 +189,7 @@ public class TestTempJarCache extends Ju
+ Assert.assertEquals(f0, f1);
+ }
+
++ @org.junit.Ignore
+ @Test
+ public void testTempJarCache02AddNativeLibs() throws IOException {
+ if(AndroidVersion.isAvailable) { System.err.println("n/a on Android"); return; }
+@@ -209,6 +210,7 @@ public class TestTempJarCache extends Ju
+ Assert.assertTrue(f.exists());
+ }
+
++ @org.junit.Ignore
+ @Test
+ public void testTempJarCache03AddNativeJarLibs() throws IOException {
+ if(AndroidVersion.isAvailable) { System.err.println("n/a on Android"); return; }
+@@ -234,6 +236,7 @@ public class TestTempJarCache extends Ju
+ assertTempFileCachesIndividualInstances(true, fileCache2, fileCache3);
+ }
+
++ @org.junit.Ignore
+ @Test
+ public void testTempJarCache04bDiffClassLoader() throws IOException {
+ if(AndroidVersion.isAvailable) { System.err.println("n/a on Android"); return; }
diff --git a/gluegen2.spec b/gluegen2.spec
new file mode 100644
index 0000000..2c2bdc8
--- /dev/null
+++ b/gluegen2.spec
@@ -0,0 +1,229 @@
+# baserelease defines which build revision of this version we're building.
+# The magical name baserelease is matched by the rpmdev-bumpspec tool, which
+# you should use.
+%global baserelease 4
+%global src_name gluegen-v2.0-rc10
+
+Name: gluegen2
+Version: 2.0
+Release: 0.%{baserelease}.rc10%{?dist}
+Summary: Java/JNI glue code generator to call out to ANSI C
+
+Group: Development/Libraries
+License: BSD
+URL: http://jogamp.org/
+Source0: http://jogamp.org/deployment/jogamp-current/archive/Sources/%{src_name}.tar.7z
+Patch1: %{name}-0001-renamed-library.patch
+# gluegen2.spec: W: patch-not-applied Patch2: 0002-use-fedora-jni.patch
+# Applied with %%{_libdir} and %%{name} resolved
+Patch2: %{name}-0002-use-fedora-jni.patch
+Patch3: %{name}-0003-disable-executable-tmp-tests.patch
+
+BuildRequires: java-devel >= 1:1.6.0
+BuildRequires: jpackage-utils
+BuildRequires: p7zip
+BuildRequires: ant-antlr
+BuildRequires: ant-contrib
+BuildRequires: ant-junit
+BuildRequires: cpptasks
+BuildRequires: maven
+
+Requires: java >= 1:1.6.0
+Requires: jpackage-utils
+
+%description
+GlueGen is a tool which automatically generates the Java and JNI
+code necessary to call C libraries. It reads as input ANSI C header
+files and separate configuration files which provide control over
+many aspects of the glue code generation. GlueGen uses a complete
+ANSI C parser and an internal representation (IR) capable of
+representing all C types to represent the APIs for which it
+generates interfaces.
+
+%package devel
+Summary: GlueGen2 devel utilities required to build JOGL2
+Group: Development/Libraries
+BuildArch: noarch
+
+Requires: %{name} = %{version}-%{release}
+Requires: ant-antlr
+Requires: ant-contrib
+Requires: ant-junit
+Requires: cpptasks
+
+%description devel
+GlueGen devel utilities provide some ant targets and shared files to build
+application.
+
+%package javadoc
+Summary: Javadoc for GlueGen2
+Group: Documentation
+BuildArch: noarch
+
+Requires: jpackage-utils
+
+%description javadoc
+Javadoc for GlueGen2.
+
+%package doc
+Summary: GlueGen's user manual
+Group: Documentation
+BuildArch: noarch
+
+%description doc
+GlueGen's user manual.
+
+%prep
+# inline %%setup as 7z archive are not supported
+%setup -c -T -n %{src_name}
+cd ..
+7za e -y %{SOURCE0}
+tar -xf %{src_name}.tar
+rm %{src_name}.tar
+cd %{src_name}
+chmod -Rf a+rX,u+w,g-w,o-w .
+
+%patch1 -p1
+sed -e "s|%%{_libdir}|%{_libdir}|;s|%%{name}|%{name}|" %{PATCH2} \
+ >use-fedora-jni.patch
+/usr/bin/patch -s -p1 --fuzz=0 <use-fedora-jni.patch
+%patch3 -p1
+
+# Fix wrong-script-end-of-line-encoding
+rm make/scripts/*.bat
+
+# Fix spurious-executable-perm
+chmod -x LICENSE.txt
+chmod -x doc/manual/index.html
+chmod -x make/stub_includes/*/*
+chmod -x src/native/*/*
+find src/java/ -type f -exec chmod -x {} +
+find make/ -type f -exec chmod -x {} +
+
+# Fix non-executable-script
+chmod +x make/scripts/*.sh
+
+# Fix script-without-shebang
+sed -i -e '1i#!/bin/sh' make/scripts/*.sh
+
+# Remove bundled dependencies
+find -name "*.jar" -type f -exec rm {} \;
+find -name "*.apk" -type f -exec rm {} \;
+rm -fr make/lib
+
+# Remove hardcoded classpath
+sed -i '/Class-Path/I d' make/Manifest
+
+# git executable should not be used, use true (to avoid checkout) instead
+sed -i 's/executable="git"/executable="true"/' make/build.xml
+
+# 7z executable is not provided, use true (to avoid archive) instead
+sed -i 's/executable="7z"/executable="true"/' make/jogamp-archivetasks.xml
+
+# mvn executable should not be used, use true (to avoid install) instead
+sed -i 's/executable="mvn"/executable="true"/' make/build.xml
+
+%build
+cd make
+ant -Djavacdebug=true \
+ -Djavacdebuglevel=lines,vars,source \
+ -Dc.compiler.debug=true \
+ \
+ -Dantlr.jar=$(build-classpath antlr.jar) \
+ -Djunit.jar=$(build-classpath junit.jar) \
+ -Dant.jar=$(build-classpath ant.jar) \
+ -Dant-junit.jar=/usr/share/java/ant/ant-junit.jar \
+ \
+ -Djavadoc.link=%{_javadocdir}/java \
+ \
+ all \
+ javadoc \
+ maven.install
+
+%install
+mkdir -p %{buildroot}%{_javadir}/%{name} \
+ %{buildroot}%{_libdir}/%{name} \
+ %{buildroot}%{_jnidir}
+
+install build/gluegen.jar %{buildroot}%{_javadir}/%{name}.jar
+install build/gluegen-rt.jar %{buildroot}%{_libdir}/%{name}/%{name}-rt.jar
+install build/obj/libgluegen-rt.so %{buildroot}%{_libdir}/%{name}/lib%{name}-rt.so
+ln -s ../%{name}/%{name}-rt.jar %{buildroot}%{_jnidir}/
+
+# Provide JPP pom
+mkdir -p %{buildroot}%{_mavenpomdir}
+install -pm 644 build/pom-gluegen.xml %{buildroot}%{_mavenpomdir}/JPP-%{name}.pom
+install -pm 644 build/pom-gluegen-rt.xml %{buildroot}%{_mavenpomdir}/JPP-%{name}-rt.pom
+%add_maven_depmap JPP-%{name}.pom %{name}.jar
+%add_maven_depmap JPP-%{name}-rt.pom %{name}-rt.jar
+
+# Make the devel package. This package is needed to build JOGL2
+%global gluegen_devel_dir %{_datadir}/gluegen2
+%global inst_srcdir %{buildroot}%{gluegen_devel_dir}
+mkdir -p %{inst_srcdir} %{inst_srcdir}/build
+cp -rdf -t %{inst_srcdir} make
+cp build/artifact.properties %{inst_srcdir}/build/artifact.properties
+
+# Make the javadoc package
+mkdir -p %{buildroot}%{_javadocdir}/%{name}
+cp -rdf build/javadoc/gluegen/javadoc/* %{buildroot}%{_javadocdir}/%{name}
+
+# Make the doc package
+mkdir -p %{buildroot}%{_docdir}/%{name}
+cp -rdf doc/manual/* %{buildroot}%{_docdir}/%{name}
+
+%check
+cd make
+_JAVA_OPTIONS="-Djogamp.debug=true -Djava.library.path=../build/test/build/natives" ant -Djavacdebug=true \
+ -Dc.compiler.debug=true \
+ -Djavacdebug=true \
+ -Djavacdebuglevel=lines,vars,source \
+ -Dcommon.gluegen.build.done=true \
+ \
+ -Dantlr.jar=$(build-classpath antlr.jar) \
+ -Djunit.jar=$(build-classpath junit.jar) \
+ -Dant.jar=$(build-classpath ant.jar) \
+ -Dant-junit.jar=/usr/share/java/ant/ant-junit.jar \
+ -Dgluegen.jar=%{buildroot}%{_javadir}/%{name}.jar \
+ -Dgluegen-rt.jar=%{buildroot}%{_libdir}/%{name}/%{name}-rt.jar \
+ -Dswt.jar=%{_jnidir}/swt.jar \
+ \
+ junit.run
+
+%files
+%doc LICENSE.txt
+%{_jnidir}/%{name}-rt.jar
+%{_libdir}/%{name}
+%{_mavendepmapfragdir}/%{name}
+%{_mavenpomdir}/JPP-%{name}-rt.pom
+
+%files devel
+%doc LICENSE.txt
+%{_javadir}/%{name}.jar
+%{_mavenpomdir}/JPP-%{name}.pom
+%{gluegen_devel_dir}
+
+%files javadoc
+%doc LICENSE.txt
+%{_javadocdir}/%{name}
+
+%files doc
+%doc LICENSE.txt
+%{_docdir}/%{name}
+
+%changelog
+* Mon Oct 01 2012 Clément David <c.david86 at gmail.com> - 2.0-0.4.rc10
+- Prefix patches with package name
+- Use /usr/share/gluegen2 devel files
+
+* Thu Sep 27 2012 Clément David <c.david86 at gmail.com> - 2.0-0.3.rc10
+- Patch to use System.load(..)
+- Use devel subpackage for gluegen2 ant task
+
+* Mon Sep 20 2012 Clément David <c.david86 at gmail.com> - 2.0-0.2.rc10
+- Add javadoc subpackage
+- Provide maven pom files
+
+* Mon Sep 10 2012 Clément David <c.david86 at gmail.com> - 2.0-0.1.rc10
+- Initial package with inspiration on gluegen spec
+
diff --git a/sources b/sources
index e69de29..ec64909 100644
--- a/sources
+++ b/sources
@@ -0,0 +1 @@
+63d628a17f4a9b6579cd43a5856e55dd gluegen-v2.0-rc10.tar.7z
More information about the scm-commits
mailing list