%global dependencies bsh jakarta-commons-codec jakarta-commons-lang jakarta-commons-net jakarta-oro jgoodies-forms jgoodies-looks opencsv gdata/gdata-core gdata/gdata-calendar gdata/gdata-client TVAnytimeAPI lucene xtvd-lib l2fprod-common/l2fprod-common-tasks jakarta-commons-compress skinlf bea-stax-api bea-stax-ri Name: tvbrowser Version: 2.7.4 Release: 2%{?dist} Summary: Free EPG for over 500 stations Group: Applications/Multimedia License: GPLv2 URL: http://tvbrowser.org/ Source0: http://downloads.sourceforge.net/%{name}/%{name}-%{version}-src.zip Source1: %{name}.desktop Patch0: tvbrowser-sh.patch Patch1: tvbrowser-ExporterFactory-noOutlookExporter.patch Patch2: tvbrowser-StartupSettingsTab-nojRegistryKey.patch Patch3: tvbrowser-BbcBackstageDataService-modern-commonscompress.patch Patch4: tvbrowser-TVBrowser-nojRegistryKey.patch Patch5: tvbrowser-buildfile-nojunit.patch Patch6: tvbrowser-buildfile-utf8.patch Patch7: tvbrowser-buildfile-nozip.patch Patch8: tvbrowser-buildfile-nowin-nomacosx-nodeb.patch BuildArch: noarch BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRequires: java-devel >= 1:1.6.0 BuildRequires: jpackage-utils BuildRequires: desktop-file-utils BuildRequires: ant BuildRequires: bsh BuildRequires: jakarta-commons-codec BuildRequires: jakarta-commons-lang BuildRequires: jakarta-commons-net BuildRequires: jakarta-commons-compress BuildRequires: jakarta-oro BuildRequires: jgoodies-forms BuildRequires: jgoodies-looks BuildRequires: opencsv BuildRequires: gdata-java BuildRequires: TVAnytimeAPI BuildRequires: lucene BuildRequires: xtvd-lib BuildRequires: skinlf BuildRequires: l2fprod-common BuildRequires: bea-stax BuildRequires: bea-stax-api Requires: java >= 1:1.6.0 Requires: jpackage-utils Requires: skinlf >= 1:6.7-10.cvs20091205 %description TV-Browser is a free electronic program guide (EPG). It offers more than 500 stations. %package javadoc Summary: Javadocs for TV-Browser Group: Documentation Requires: %{name} = %{version}-%{release} Requires: jpackage-utils %description javadoc TV-Browser EPG development documentation. %prep %setup -q # remove all lines that either contain the win.dir or the unpacked.dir as they contain or do bad stuff for str in \ "win.dir" \ "unpacked.dir" do %{__sed} -i -e "/${str}/d" build.xml done %patch0 -p0 %patch1 -p0 %patch2 -p0 %patch3 -p0 %patch4 -p0 %patch5 -p0 %patch6 -p0 %patch7 -p0 %patch8 -p0 # Change the line endings but preserve the timestamp %{__sed} -i.tmp 's/\r//' txt/LICENSE.txt touch -r txt/LICENSE.txt.tmp txt/LICENSE.txt %{__sed} -i.tmp 's/\r//' txt/COPYRIGHT.txt touch -r txt/COPYRIGHT.txt.tmp txt/COPYRIGHT.txt # remove all precompiled jars and classes find \( -name '*.jar' -o -name '*.dll' -o -name '*.class' \) -exec rm -f '{}' \; # remove unnecessary stuff (that could be problematic) rm -rf lib/* deployment/win deployment/macosx src/tvbrowser/ui/mainframe/macosx tvdatakit src/calendarexportplugin/exporter/OutlookExporter.java # rebuild lib/* with symlinks to the locally installed libs build-jar-repository -p -s lib %{dependencies} # iso-8859-1 -> utf-8 for all java files or javadoc generation fails for i in `find * -type f -name *.java -print`; do cp $i %{name}-%{version}.tmp iconv -f iso-8859-1 -t utf-8 -o $i %{name}-%{version}.tmp done rm -rf %{name}-%{version}.tmp %build ant runtime-linux public-doc %install rm -rf $RPM_BUILD_ROOT # javadoc install -d $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version} cp -rp doc/* $RPM_BUILD_ROOT%{_javadocdir}/%{name}-%{version} ln -s %{name}-%{version} $RPM_BUILD_ROOT%{_javadocdir}/%{name} pushd runtime/%{name}_linux # jars install -d $RPM_BUILD_ROOT%{_javadir}/%{name} install -m644 %{name}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/%{name}-%{version}.jar ln -s %{name}-%{version}.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/%{name}.jar # properties install -m644 linux.properties $RPM_BUILD_ROOT%{_javadir}/%{name} # plugins install -d $RPM_BUILD_ROOT%{_javadir}/%{name}/plugins install -m644 plugins/*.jar $RPM_BUILD_ROOT%{_javadir}/%{name}/plugins # themes install -d $RPM_BUILD_ROOT%{_javadir}/%{name}/themepacks install -m644 themepacks/*.zip $RPM_BUILD_ROOT%{_datadir}/java/%{name}/themepacks # imgs install -d $RPM_BUILD_ROOT%{_javadir}/%{name}/imgs install -m644 imgs/* $RPM_BUILD_ROOT%{_javadir}/%{name}/imgs # icons install -d $RPM_BUILD_ROOT%{_javadir}/%{name}/icons cp -a icons/* $RPM_BUILD_ROOT%{_javadir}/%{name}/icons/ # shellscript install -d $RPM_BUILD_ROOT%{_bindir} touch $RPM_BUILD_ROOT%{_bindir}/%{name} echo "#!/bin/sh" > $RPM_BUILD_ROOT%{_bindir}/%{name} echo "cd %{_javadir}/%{name}" >> $RPM_BUILD_ROOT%{_bindir}/%{name} echo "java -Xms16m -Xmx128m -Djava.library.path=\"%{_javadir}/%{name}\" -Dpropertiesfile=linux.properties -classpath %{_javadir}/%{name}/%{name}.jar:`build-classpath %{dependencies}` tvbrowser.TVBrowser" >> $RPM_BUILD_ROOT%{_bindir}/%{name} chmod 755 $RPM_BUILD_ROOT%{_bindir}/%{name} popd desktop-file-install --vendor="fedora" --dir=${RPM_BUILD_ROOT}%{_datadir}/applications %{SOURCE1} %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %doc runtime/%{name}_linux/COPYRIGHT.txt runtime/%{name}_linux/LICENSE.txt %{_bindir}/%{name} %dir %{_javadir}/%{name} %{_javadir}/%{name}/%{name}.jar %{_javadir}/%{name}/%{name}-%{version}.jar %{_javadir}/%{name}/imgs/ %{_javadir}/%{name}/icons/ %{_javadir}/%{name}/linux.properties %{_javadir}/%{name}/plugins/ %{_javadir}/%{name}/themepacks/ %{_datadir}/applications/fedora-%{name}.desktop %files javadoc %defattr(-,root,root,-) %{_javadocdir}/%{name} %{_javadocdir}/%{name}-%{version}/ %changelog * Wed Dec 09 2009 Sandro Mathys - 2.7.4-2 - Minor changes in the spec file - Fixed some issues with the jakarta-commons-compress 1.0 * Thu Oct 01 2009 Sandro Mathys - 2.7.4-1 - New version * Thu Apr 20 2009 Sandro Mathys - 2.7.3-2 - Changes in the l2fprod-common package made it necessary to adapt the path of one dependency. * Fri Mar 13 2009 Sandro Mathys - 2.7.3-1 - New version * Sat Jan 10 2009 Sandro Mathys - 2.7.2-1 - New version * Thu Dec 18 2008 Sandro Mathys - 2.7.1-2 - The buildfile is no longer getting patched to look for the libs in the javadir. Instead, the lib directory is now rebuilt by using build-jar-repository - To strip away the hardcoded lib-versions sed is now used instead of patching them out of the buildfile - To avoid the unpacking and repacking of 3rd party jars from the system, sed is used to strip away related lines of the buildfile - The 'nowin' patch was simplified by stripping away win-only jars from the buildfile with sed as far as possible * Tue Dec 16 2008 Sandro Mathys - 2.7.1-1 - initial build (thanks Rudolf 'che' Kastl for the help)