Name: flexdock
Version: 1.0
Release: 1%{?dist}
Summary: Docking framework for Java Swing GUI apps
Group: Development/Libraries
#Licence is MIT on their website
License: MIT
URL: https://flexdock.dev.java.net/
Source0: %{name}-%{version}.tar.gz
# Invoke this script to download and remove non-free components
# * Original Source# contains code that we cannot ship.
# * Upstream does not provide a tarball
Source1: %{name}-generate-tarball.sh
# This patch is fedora specific -- System.loadLibrary fix to help locate JNI components
Patch0: flexdock-jni.patch
#Removes the java media framework from the demos to satisfy reqs
Patch1: flexdock-nojmf.patch
#Modifies the build process -- fedora specific
Patch2: flexdock-build.patch
#Fixes the skinlf search paths in the skinlf.jar (1 of 2)
Patch3: flexdock-skinlfTitlebarui-path.patch
#Fixes the skinlf search paths in the skinlf.jar (2 of 2)
Patch4: flexdock-skinlfPainter-path.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: ant
BuildRequires: ant-apache-regexp
BuildRequires: ant-commons-logging
BuildRequires: java-devel
BuildRequires: jgoodies-looks
BuildRequires: jpackage-utils
BuildRequires: libX11-devel
BuildRequires: skinlf
Requires: ant-commons-logging
Requires: java
Requires: jgoodies-looks
Requires: jpackage-utils
Requires: skinlf
%description
FlexDock is a Java docking framework for use in cross-platform
Swing applications.
%prep
%setup -q
#Modify the jni dir that is hardcoded in the patch
cp %{PATCH0} ./tmpJniPatch
sed -i 's!%%{_libdir}/%%{name}!%{_libdir}/%{name}!' tmpJniPatch
#Apply patches
#Apply patch0
patch -p0 --fuzz=0 < tmpJniPatch
%patch1
%patch2
%patch3
%patch4
#Override the build file's default hard-coded paths
echo "sdk.home=%{_jvmdir}/java" > workingcopy.properties
#remove *dll
find ./ -name \*.dll -exec rm {} \;
#remove .so files
find ./ -name \*.so -exec rm {} \;
#Remove the jmf-using demo files
rm src/java/demo/org/flexdock/demos/raw/jmf/MediaPanel.java
rm src/java/demo/org/flexdock/demos/raw/jmf/JMFDemo.java
#JAR "dependency" handling
#==========
build-jar-repository -s -p lib commons-logging skinlf jgoodies-looks.jar
pushd lib
ln -s jgoodies-looks.jar looks-2.2.1.jar
ln -s commons-logging.jar commons-logging-1.1.jar
popd
JAR_files=""
for j in $(find -name \*.jar); do
if [ ! -L $j ] ; then
JAR_files="$JAR_files $j"
fi
done
if [ ! -z "$JAR_files" ] ; then
echo "These JAR files should be deleted and symlinked to system JAR files: $JAR_files"
exit 1
fi
#=========
#Endline convert Doc files
for i in "README-RELEASE LICENSE.txt README release-notes.txt" ;
do
%{__sed} -i 's/\r//' $i
done
%build
export CLASSPATH=$(build-classpath jgoodies-looks skinlf commons-logging)
ant -v -Dbuild.sysclasspath=first build.with.native jar
ant -v -Dbuild.sysclasspath=first compile.native
%install
rm -rf %{buildroot}
#Create dirs needed.
mkdir -p %{buildroot}/%{_libdir}/%{name}
#flexdock has funny arch flags, such as "libRubberBand-linux-x86.so" on i386
SOFILE=`find ./ -name libRubberBand*so`
install -pm755 $SOFILE %{buildroot}/%{_libdir}/%{name}/libRubberBand-0.so
#install jar file into lib dir as it is a JNI requiring jar
install -pm644 build/%{name}-%{version}.jar %{buildroot}/%{_libdir}/%{name}/%{name}-%{version}.jar
pushd .
cd %{buildroot}/%{_libdir}/%{name}
ln -s %{name}-%{version}.jar %{name}.jar
popd
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
%doc LICENSE.txt README README-RELEASE release-notes.txt
%{_libdir}/%{name}
%changelog
* Fri Dec 9 2011 Clément <davidcl> David <c.david86@gmail.com> 1.0-1
- Bump version
* Thu Oct 13 2011 Clément David <c.david86@gmail.com> 0.5.4-1
- Bump version
* Tue Aug 16 2011 Clément David <c.david86@gmail.com> 0.5.2-1
- Bump version
- Normalize patches
- Normalize tarball name and root
* Thu Jun 23 2011 <mycae(a!t)yahoo.com> 0.5.1-19
- Fix FTBFS bug 715626 - classpath change
* Tue Feb 08 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.1-18
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild
* Sat Dec 19 2009 <mycae(a!t)yahoo.com> 0.5.1-17
- tag bump
* Sat Dec 19 2009 <mycae(a!t)yahoo.com> 0.5.1-16
- tag bump
* Sat Dec 19 2009 <mycae(a!t)yahoo.com> 0.5.1-15
- Fix patch to match sed expression
- Don't modify jni patch in-place
* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 0.5.1-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild
* Sat Mar 28 2009 <mycae(a!t)yahoo.com> 0.5.1-13
- Version bump due to tag mess
* Thu Mar 26 2009 <mycae(a!t)yahoo.com> 0.5.1-12
- Added a named symlink to versioned jar
* Tue Feb 24 2009 <mycae(a!t)yahoo.com> 0.5.1-11
- Created clean tarball to remove jmf
* Thu Feb 19 2009 <mycae(a!t)yahoo.com> 0.5.1-10
- Applied patch from Dominik 'Rathann' Mierzejewski
- Added BuildRequires for apache-regexp (needed for F9)
- Removed overly complex java detection
* Thu Jan 21 2009 <mycae(a!t)yahoo.com> 0.5.1-9
- Alter the way I handle stripping of the SOFILE
- Alphabetically sort build and buildrequires
- Add full stop & de-indent description
- Use build-jar-repository
- Change sdk.home from OR to case statment
* Tue Jan 20 2009 <mycae(a!t)yahoo.com> 0.5.1-8
- Set defattr
- Fix arch (again)
- Change install dir from %%libdir to %%libdir/%%name
- Update patch0 to match changed so dir + make dynamic
* Sat Dec 20 2008 <mycae(a!t)yahoo.com> 0.5.1-7
- Re-enable system skinlf link & jar check.
* Thu Dec 04 2008 <mycae(a!t)yahoo.com> 0.5.1-6
- Use ant to build jar, rather than straight from bash.
- Fix build patch to correct native .so building
- Thanks goes to akurtakov for assitance.
- Fixed dos->unix line ending for doc files
- Added dos2unix buildrequires
- Fix arch flag
- Added libX11 dep for native so
- Added symlink for so
* Sun Nov 23 2008 <mycae(a!t)yahoo.com> 0.5.1-5
- Fix documentation
- Change group
- Fix version numbering
- Link in skinlf to proposed package
* Sun Nov 16 2008 <mycae(a!t)yahoo.com> 0.5.1-4
- Update package revision number
- Fix Top level dir of jar file
* Sat Nov 01 2008 <mycae(a!t)yahoo.com> 0.5.1-3
- Add patch to remove non-free components from flexdock (thanks to Sylvestre Ledru from Scilab)
- Correct deps to include jgoodies & skinlf
* Sun Oct 26 2008 <mycae(a!t)yahoo.com> 0.5.1-2
- Fix % { _libs } to % { _libdir }
- Added Jar file creation during build
- Add jar file dependency check
- Cleanup filelist to just .so and .jar
- Add JNI path patch
* Tue Sep 30 2008 <mycae(a!t)yahoo.com> 0.5.1-1
- Create spec file