Blob Blame History Raw
Name:		flexdock
Version:	0.5.1
Release:	17%{?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}-clean.tar.gz

# Original Source# Contains code that we cannot ship. 
# Download the upstream tarball and invoke this script while in the
# tarball's directory
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 -qc

#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 -p 1 --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 {} \;

#JAR "dependency" handling
#==========
#delete and symlink any jar files we know about

#rm commands commented out, as we delete these
#at repackage time

# Apache commons Logging component
# http://commons.apache.org/logging/
#rm -f lib/commons-logging-1.1.jar

#remove jmf, as it is only used in a demo,
#which is unused after patching
#rm -rf lib/jmf

#" Looks" project
# https://looks.dev.java.net/
#rm -f lib/looks-2.1.1.jar

#skinlf "Skin look and Feel" project
# https://skinlf.dev.java.net/
#rm -f lib/skinlf.jar


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)
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
* 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