Blob Blame History Raw
%define svnrel 11564

Name:		jmol
Version:	11.8
Release:	1.%{svnrel}svn%{?dist}
Summary:	An open-source Java viewer for chemical structures in 3D
Group:		Applications/Engineering
License:	LGPLv2+
URL:		http://jmol.sourceforge.net
BuildArch:	noarch

# The official release package doesn't have support for building the jar files,
# so we use SVN instead.

# The source package has been created from SVN sources:
# svn export -r %{svnrel} https://jmol.svn.sourceforge.net/svnroot/jmol/branches/v11_6/Jmol
# tar cvf jmol-%{name}-%{version}.%{svnrel}.tar
# xz %{name}-%{version}.%{svnrel}.tar
Source0:	%{name}-%{version}.%{svnrel}.tar.xz
# Image available at "http://wiki.jmol.org:81/index.php/Image:Jmol_icon_128.png"
Source1:	Jmol_icon_128.png
# Patch to get Jmol to build in Fedora
Patch0:		jmol-11.8-fedorabuild.patch

BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildRequires:	ant, ant-contrib
BuildRequires:	desktop-file-utils
BuildRequires:	gettext-devel
BuildRequires:	java-devel >= 1:1.6.0
BuildRequires:	jpackage-utils
# For javax.vecmath
BuildRequires:	vecmath

%if 0%{?rhel} == 5
BuildRequires:	xz
%endif

Requires:	java >= 1:1.6.0
Requires:	jpackage-utils

%description
Jmol is a free, open source molecule viewer for students, educators, 
and researchers in chemistry and biochemistry.


%package javadoc
Summary:	Javadocs for %{name}
Group:		Documentation
Requires:	%{name} = %{version}-%{release}

%description javadoc
This package contains the API documentation for %{name}.


%package doc
Summary:	Documentation for %{name}
Group:		Documentation
Requires:	%{name} = %{version}-%{release}

%description doc
The documentation for %{name}.


%prep
%setup -q -n Jmol
%patch0 -p1 -b .fedorabuild
find -name '*.class' -exec rm -f '{}' \;
find -name '*.jar' -exec rm -f '{}' \;

# Remove executable permissions from documentation
chmod 644 README.txt
chmod 644 COPYRIGHT.txt

# Make desktop file
cat > jmol.desktop << EOF
[Desktop Entry]
Encoding=UTF-8
Name=Jmol
Comment=An open-source Java viewer for chemical structures in 3D
Exec=jmol
Icon=jmol
Terminal=false
Type=Application
Categories=Education;Science;
EOF

%build
ant doc main

%install
rm -rf %{buildroot}
install -D -p -m 755 jmol %{buildroot}%{_bindir}/%{name}
#install -D -p -m 644 build/JmolUnsigned.jar %{buildroot}%{_datadir}/%{name}/Jmol.jar
install -D -p -m 644 build/Jmol.jar %{buildroot}%{_datadir}/%{name}/Jmol.jar
install -D -p -m 644 build/JmolApplet.jar %{buildroot}%{_datadir}/%{name}/JmolApplet.jar
install -D -p -m 644 %{SOURCE1} %{buildroot}%{_datadir}/pixmaps/%{name}.png

# Install desktop file
desktop-file-install --dir=${RPM_BUILD_ROOT}%{_datadir}/applications --vendor=fedora jmol.desktop

# Javadoc files
mkdir -p %{buildroot}%{_javadocdir}/%{name}
cp -rp build/javadoc/* %{buildroot}%{_javadocdir}/%{name}

%clean
rm -rf %{buildroot}

%files
%defattr(-,root,root,-)
%doc build/doc/* README.txt COPYRIGHT.txt LICENSE.txt
%{_bindir}/%{name}
%{_datadir}/%{name}/
%{_datadir}/pixmaps/%{name}.png
%{_datadir}/applications/fedora-%{name}.desktop

%files javadoc
%defattr(-,root,root,-)
%{_javadocdir}/%{name}/

%files doc
%defattr(-,root,root,-)
%doc build/doc/*

%changelog
* Tue Sep 22 2009 Jussi Lehtola <jussilehtola@fedoraproject.org> - 11.8-1.11564
- Update to 11.8 series, svn revision 11564.

* Fri Jul 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 11.6-12.11223svn
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

* Thu Jul 16 2009 Jussi Lehtola <jussilehtola@fedoraproject.org> - 11.6-11.11223svn
- Include desktop file in the spec.

* Thu Jul 16 2009 Jussi Lehtola <jussilehtola@fedoraproject.org> - 11.6-10.11223svn
- Bump release to be able to rebuild in koji.

* Thu Jul 16 2009 Jussi Lehtola <jussilehtola@fedoraproject.org> - 11.6-9.11223svn
- Update to svn revision 11223.

* Wed Feb 25 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 11.6-8.10506svn
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Thu Dec 18 2008 Jussi Lehtola <jussilehtola@fedoraproject.org> - 11.6-7.10506svn
- Remove jpackage-utils from the Requires of the documentation packages.

* Fri Oct 24 2008 Jussi Lehtola <jussilehtola@fedoraproject.org> - 11.6-6.10137svn
- Fix build on EPEL 5.

* Fri Oct 24 2008 Jussi Lehtola <jussilehtola@fedoraproject.org> - 11.6-5.10137svn
- Disable JAR signing.

* Fri Oct 24 2008 Jussi Lehtola <jussilehtola@fedoraproject.org> - 11.6-4.10137svn
- Add gettext-devel to BR and fix desktop-file-install.

* Thu Oct 23 2008 Jussi Lehtola <jussilehtola@fedoraproject.org> - 11.6-3.10137svn
- Update to svn revision 10137.

* Tue Oct 14 2008 Jussi Lehtola <jussilehtola@fedoraproject.org> - 11.6-2.10081svn
- Review fixes.

* Mon Oct 13 2008 Jussi Lehtola <jussilehtola@fedoraproject.org> - 11.6-1.10081svn
- First release.