Blob Blame History Raw
# TODO:
# - add subpackages for:
#       - OmegaT-LanguageTool-src_0.4-2.3.zip
#       - OmegaT-Scripting-src_0.5-2.5.0_03.zip
#       - OmegaT-tokenizers-src_0.4_2-2.1.zip
# - fix desktop-install warning
# - new logo
# - update l10n.es

# fixing #901660
%global debug_package  %{nil}

Name:           OmegaT
%global namer   omegat
Summary:        Computer Aid Translation tool
Version:        2.6.1
%global versionr 2.6.1_01_Beta
#Release:       1%{?dist}
Release:        0.7.Beta%{?dist}
Source0:        http://downloads.sourceforge.net/omegat/%{name}_%{versionr}_Source.zip
Source2:        OmegaT-lib-mnemonics-build.xml
Source3:        OmegaT-build.xml
Url:            http://www.omegat.org/
Group:          Applications/Text

BuildRequires:  ant, java-devel >= 1.6.0, jpackage-utils
BuildRequires:  desktop-file-utils, dos2unix
BuildRequires:  htmlparser, vldocking >= 2.1.4
BuildRequires:  jna
BuildRequires:  ws-jaxme
BuildRequires:  swing-layout
BuildRequires:  hunspell <= 1.4.0

BuildRequires:  svnkit >= 1.7.5
BuildRequires:  jsch
BuildRequires:  sqljet >= 1.1.4
# OmegaT brings org.eclipse.jgit-1.2.0.201112221803-r.jar but Fedora is 1.1.0
BuildRequires:  jgit
BuildRequires:  antlr3-tool

Requires:       java, jpackage-utils
Requires:       vldocking >= 2.1.4
Requires:       htmlparser
Requires:       hunspell <= 1.4.0
Requires:       jna
Requires:       swing-layout
Requires:       ws-jaxme
Requires:       svnkit
Requires:       jsch
Requires:       sqljet
Requires:       jgit
Requires:       antlr3-java

License:        GPLv2+
# http://svn.debian.org/wsvn/pkg-java/trunk04-get-rid-of-MRJAdapter.patch
Patch1:         OmegaT-04-get-rid-of-MRJAdapter.patch
Patch2:         OmegaT-help-path.patch
# http://svn.debian.org/wsvn/pkg-java/trunk/omegat/debian/patches/05-remove-jmyspell-alternative.patch
Patch3:         OmegaT-05-remove-jmyspell-alternative.patch
Patch4:         OmegaT-06-use-system-hunspell.patch

# reported at http://sourceforge.net/mailarchive/forum.php?thread_name=CAARR2rZ2uT1KOrLLVF9wdS6Ybq_sU_o1u08U54BLzxqxZoyRUQ%40mail.gmail.com&forum_name=omegat-development
Patch5:         OmegaT-07-use-openjdk-swingworker.patch

%description
OmegaT is a free translation memory application written in Java.
It is a tool intended for professional translators. It does not
translate for you!

OmegaT has the following features:

 * Fuzzy matching
 * Match propagation
 * Simultaneous processing of multiple-file projects
 * Simultaneous use of multiple translation memories
 * External glossaries
 * Document file formats:
        XHTML and HTML
        Microsoft Office 2007 XML
        OpenOffice.org/StarOffice
        XLIFF (Okapi)
        MediaWiki (Wikipedia)
        Plain text
 * Unicode (UTF-8) support: can be used with non-Latin alphabets
 * Support for right-to-left languages
 * Compatible with other translation memory applications (TMX)

%prep
%setup -q -c -n %{name}-%{version}
%patch1 -p1
%patch2 -p1
%patch3 -p1
%patch4 -p1
%ifarch x86_64  # get rids the hardlink to hunspell 
sed -i -e "s|/usr/lib/libhunspell|/usr/lib64/libhunspell|g" src/org/omegat/util/OConsts.java
%endif

%patch5 -p1

# not needed outside Netbeans
rm nbproject/org-netbeans-modules-java-j2seproject-copylibstask.jar

# clean dependencies:
rm lib/svnkit-1.7.5.jar
rm lib/jsch-0.1.46.jar
rm lib/sqljet-1.1.3.jar
rm lib/org.eclipse.jgit-1.2.0.201112221803-r.jar
rm lib/antlr-runtime-3.4.jar

# is not really used??
rm lib/sjsxp-1.0.2.jar

# seems to be included in svnkit:
rm lib/sequence-library-1.0.2.jar 

rm lib/vldocking_2.1.4.jar
rm lib/htmlparser.jar
rm lib/sources/htmlparser1_6_20060610.zip-source.zip
rm lib/jmyspell-core-1.0.0-beta-2.jar
rm lib/jna.jar
rm -r native/*
rm lib/swing-layout-1.0.jar

###  JAXB dependencies
rm lib/activation.jar
rm lib/jaxb-api.jar
rm lib/jaxb-impl.jar
rm lib/jsr173_1.0_api.jar 
rm lib/sources/JAXB/jsr173_1.0_src.jar

# not needed outside MacOSX:
rm lib/MRJAdapter.jar
rm lib/sources/MRJAdapter-source.zip

# not needed outside windows
rm -rf release/win32-specific/

# seems they are not really needed... 
rm -rf ./test/lib/junit-4.4.jar
rm -rf ./test/lib/xmlunit-1.1.jar

## gen/lib/jaxb-xjc.jar
rm -rf gen/lib/jaxb-xjc.jar

# using the internal openjdk one:
rm -rf lib/swing-worker-1.2.jar

%build

# cleaning:
sed -i '/class-path/I d' manifest-template.mf

pushd lib-mnemonics
cp %{SOURCE2} build.xml
ant dist
popd

cp %{SOURCE3} build.xml
ant dist

%install 
rm -Rf %{buildroot}

#install our jar file
#make some install dirs
mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_javadir}
mkdir -p %{buildroot}%{_datadir}/%{namer}/docs
mkdir -p %{buildroot}%{_datadir}/%{namer}/images

install -pm  0755 dist/OmegaT.jar %{buildroot}%{_javadir}/OmegaT-%{version}.jar
install -pm  0755 lib-mnemonics/dist/lib-mnemonics.jar %{buildroot}%{_javadir}/OmegaT-lib-mnemonics-%{version}.jar

pushd %{buildroot}%{_javadir}
        ln -s OmegaT-%{version}.jar %{buildroot}%{_javadir}/OmegaT.jar
        ln -s OmegaT-lib-mnemonics-%{version}.jar %{buildroot}%{_javadir}/lib-mnemonics.jar
popd

cp -pR release/index.html docs/ images/ %{buildroot}%{_datadir}/%{namer}/

%{jpackage_script       \
org.omegat.Main         \
""                      \
""                      \
OmegaT:svnkit:jsch:sqljet:antlr3-runtime:jgit/jgit:htmlparser:vldocking:jna:lib-mnemonics:jaxme/jaxme2:jaxme/jaxme2-rt:jaxme/jaxmejs:jaxme/jaxmepm:jaxme/jaxmexs:swing-layout \
%{namer}                \
true                    \
}


#Menu entry
install -d -m755 %{buildroot}%{_datadir}/applications

cat > %{buildroot}%{_datadir}/applications/fedora-%{namer}.desktop <<EOF
[Desktop Entry]
Encoding=UTF-8
Name=%name
Exec=%{namer}
Icon=/usr/share/omegat/images/OmegaT.png
Comment=Computer Aid Translation tool
Comment[es]=Herramienta de asistencia a la traducción
Terminal=false
Type=Application
Categories=Translation;Java;Office;
X-AppInstall-Package=%{namer}
EOF

desktop-file-install  --vendor "fedora" --dir=%{buildroot}%{_datadir}/applications/ %{buildroot}%{_datadir}/applications/fedora-%{namer}.desktop 

# fixing end of line making rpmlint happy
dos2unix -k -f release/*.txt


%files
%dir %{_datadir}/%{namer}
%{_datadir}/%{namer}/*
%{_bindir}/*
%{_javadir}/*
%{_datadir}/applications/fedora-%{namer}.desktop

%doc ./release/changes.txt release/doc-license.txt release/license.txt release/readme*.txt release/join.html


%changelog
* Sat Jan 19 2013 Ismael Olea <ismael@olea.org> - 2.6.1-0.7.Beta
- removing empty debuginfo file generation, #901660
- substituing tabs with spaces

* Mon Dec 10 2012 Ismael Olea <ismael@olea.org> - 2.6.1-0.6.Beta
- update hunspell patch to 1.3.*
- adding a buildrequire to break builds when major change in hunspell
- tuning the external hunspell dependency on x86_64 and removed the noarch feature due to this
- thus, fixing #884212

* Fri Oct 5 2012 Ismael Olea <ismael@olea.org> - 2.6.1-0.5.Beta
- update to 2.6.1_01_Beta
- adjusting requires

* Fri Oct 5 2012 Ismael Olea <ismael@olea.org> - 2.6.1-0.4.Beta
- tuning the precise buildrequires versions

* Wed Sep 26 2012 Ismael Olea <ismael@olea.org> - 2.6.1-0.3_Beta
- update to 2.6.1_Beta

* Thu Sep 24 2012 Ismael Olea <ismael@olea.org> - 2.6.0-0.2.04_Beta
- removing external omegat.sh using jpackage_script
- substituing OmegaT-06-use-external-hunspell.patch with OmegaT-06-use-system-hunspell.patch

* Thu Sep 23 2012 Ismael Olea <ismael@olea.org> - 2.6.0-0.1.04_Beta
- updating to 2.6.0_04_Beta
- changed $RPM_BUILD_ROOT into % buildroot

* Tue Feb 6 2012 Ismael Olea <ismael@olea.org> - 2.3.0_06-1
- updating to 2.3.0_06
- removing patch OmegaT-fix-encoding-java7.patch since is now in upstream
- cosmetic changes

* Thu Jan 12 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.3.0_03-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Tue Nov 22 2011 <ismael@olea.org > - 2.3.0_03-2
- added OmegaT-fix-encoding-java7.patch:
  java 1.7 now managed as error encoding typos

* Mon Nov 21 2011 <ismael@olea.org > - 2.3.0_03-1
- updated to 2.3.0_03

* Tue Apr 19 2011 <ismael@olea.org> - 2.2.3-0.2.04_Beta
- updated to 2.2.3_04_Beta
- minor spec cleaning

* Thu Dec 29 2010 <ismael@olea.org> - 2.2.3-0.1.Beta
- updated to 2.2.3_Beta
- fixed hunspell integration
- swing-worker patch

* Wed Aug 11 2010 Ismael Olea <ismael@olea.org> 2.0.5_04-1
- updating to 2.0.5_04
- removing references to javadoc generation
- removing support for jmyspell (from Tiago's OmegaT-05-remove-jmyspell-alternative.patch)
- using local hunspell (from Tiago's OmegaT-06-use-external-hunspell.patch )
- spec cleaning

* Mon Jul 27 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.7.3_04-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

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

* Mon Feb 23 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.7.3_04-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild

* Wed Nov 26 2008 Ismael Olea <ismael@olea.org> 2.0.0_Beta-2
- Porting MRJAdapter removing patch
- Porting OmegaT-help-path.patch from http://svn.debian.org/wsvn/pkg-java/trunk/omegat/debian/patches/03-location-of-help-files.dpatch?op=file&rev=0&sc=0)

* Wed Nov 26 2008 Ismael Olea <ismael@olea.org> 2.0.0_Beta-1
- First 2.0 beta version


* Fri Nov 21 2008 Ismael Olea <ismael@olea.org> 1.7.3_04-2
- stupid new release caused by my fault

* Fri Nov 21 2008 Ismael Olea <ismael@olea.org> 1.7.3_04-1
- updating to 1.7.3_04

* Wed Nov 18 2008 Ismael Olea <ismael@olea.org> 1.7.3_03-6
- Fixing htmlparser non-present dependency (bug #471573)

* Thu Sep 18 2008 Ismael Olea <ismael@olea.org> 1.7.3_03-5
- QA changes

* Wed Sep 17 2008 Ismael Olea <ismael@olea.org> 1.7.3_03-4
- minor and cosmetic changes

* Wed Aug 27 2008 Ismael Olea <ismael@olea.org> 1.7.3_03-3olea
- new build.xml for removing org-netbeans-modules-java-j2seproject-copylibstask.jar dependency
- not javadoc support now
- OmegaT-ant.properties not needed by this build.xml

* Wed Aug 27 2008 Ismael Olea <ismael@olea.org> 1.7.3_03-2olea
- cleaning dependencies, apparently running, lack paths configs

* Tue Aug 26 2008 Ismael Olea <ismael@olea.org> 1.7.3_03-1olea
- updating to 1.7.3_03 version

* Fri Jul 4 2008 Ismael Olea <ismael@olea.org> 1.7.3_02-1olea
- updating to 1.7.3_02 version

* Mon Feb 11 2008 Ismael Olea <ismael@olea.org> 1.7.3-5olea
- fixing according to https://bugzilla.redhat.com/show_bug.cgi?id=428798#c3
- comments on https://bugzilla.redhat.com/show_bug.cgi?id=428798#c4

* Sun Feb 10 2008 Ismael Olea <ismael@olea.org> 1.7.3-4olea
- fixing according to https://bugzilla.redhat.com/show_bug.cgi?id=428798#c1

* Mon Jan 21 2008 Ismael Olea <ismael@olea.org> 1.7.3-3olea
- rpmlinting

* Wed Jan 9 2008 Ismael Olea <ismael@olea.org> 1.7.3-2olea
- Compiling from sources

* Wed Jan 9 2008 Ismael Olea <ismael@olea.org> 1.7.3-1olea
- updating to 1.7.3

* Wed Jan 9 2008 Ismael Olea <ismael@olea.org> 1.7.2-1olea
- compiling on Fedora

* Fri Nov 12 2007 Patred Theknight <edupclos@gmail.com>1.7.2-1pclos_edulos
- Initial Build