2014-03-03 20:50:36 +04:00
|
|
|
%define name moses
|
|
|
|
%define version ___RPM_VERSION__
|
|
|
|
%define release ___RPM_RELEASE__
|
|
|
|
|
|
|
|
Name: %{name}
|
2013-03-06 18:53:45 +04:00
|
|
|
Summary: Moses is a statistical machine translation system that allows you to automatically train translation models for any language pair.
|
2014-03-03 20:50:36 +04:00
|
|
|
Version: %{version}
|
|
|
|
Release: %{release}
|
|
|
|
URL: http://www.statmt.org/%{name}-%{version}/
|
2013-03-06 18:53:45 +04:00
|
|
|
Source0: %{name}-%{version}.tar.gz
|
|
|
|
License: LGPL
|
|
|
|
Group: Development/Tools
|
|
|
|
Vendor: Capita Translation and Interpreting
|
|
|
|
Packager: Ian Johnson <ian.johnson@capita-ti.com>
|
2014-02-03 18:05:40 +04:00
|
|
|
Requires: python >= 2.6, perl >= 5
|
2014-03-03 20:50:36 +04:00
|
|
|
Prefix: /opt
|
|
|
|
BuildRoot: %{_builddir}/%{name}-%{version}-%{release}
|
2013-03-06 18:53:45 +04:00
|
|
|
%description
|
|
|
|
Moses is a statistical machine translation system that allows you to automatically train translation models for any language pair. All you need is a collection of translated texts (parallel corpus). An efficient search algorithm finds quickly the highest probability translation among the exponential number of choices.
|
|
|
|
%prep
|
|
|
|
%setup -q
|
|
|
|
|
2014-03-03 20:50:36 +04:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/opt/%{name}-%{version}/giza++-v1.0.7
|
2013-03-06 18:53:45 +04:00
|
|
|
|
|
|
|
wget -O $RPM_BUILD_DIR/irstlm-5.70.04.tgz http://moses-suite.googlecode.com/files/irstlm-5.70.04.tgz
|
|
|
|
wget -O $RPM_BUILD_DIR/giza-pp-v1.0.7.tgz http://moses-suite.googlecode.com/files/giza-pp-v1.0.7.tar.gz
|
|
|
|
|
|
|
|
cd $RPM_BUILD_DIR
|
|
|
|
|
|
|
|
tar -zxf irstlm-5.70.04.tgz
|
|
|
|
tar -zxf giza-pp-v1.0.7.tgz
|
|
|
|
|
|
|
|
cd irstlm-5.70.04
|
|
|
|
bash regenerate-makefiles.sh --force
|
2014-03-03 20:50:36 +04:00
|
|
|
./configure --prefix $RPM_BUILD_ROOT/opt/%{name}-%{version}/irstlm-5.70.04
|
2013-03-06 18:53:45 +04:00
|
|
|
make
|
|
|
|
make install
|
|
|
|
|
|
|
|
cd ../giza-pp
|
|
|
|
make
|
2014-03-03 20:50:36 +04:00
|
|
|
cp $RPM_BUILD_DIR/giza-pp/GIZA++-v2/GIZA++ $RPM_BUILD_DIR/giza-pp/GIZA++-v2/snt2cooc.out $RPM_BUILD_DIR/giza-pp/mkcls-v2/mkcls $RPM_BUILD_ROOT/opt/%{name}-%{version}/giza++-v1.0.7
|
2013-03-06 18:53:45 +04:00
|
|
|
%build
|
2014-03-03 20:50:36 +04:00
|
|
|
./bjam --with-boost=___BOOST_LOCATION__ --with-irstlm=$RPM_BUILD_ROOT/opt/%{name}-%{version}/irstlm-5.70.04 --with-giza=$RPM_BUILD_ROOT/opt/%{name}-%{version}/giza++-v1.0.7 -j2
|
2013-03-06 18:53:45 +04:00
|
|
|
%install
|
2014-03-03 20:50:36 +04:00
|
|
|
mkdir -p $RPM_BUILD_ROOT/opt/%{name}-%{version}/scripts
|
|
|
|
cp -R bin $RPM_BUILD_ROOT/opt/%{name}-%{version}
|
|
|
|
cp -R scripts/OSM $RPM_BUILD_ROOT/opt/%{name}-%{version}/scripts
|
|
|
|
cp -R scripts/Transliteration $RPM_BUILD_ROOT/opt/%{name}-%{version}/scripts
|
|
|
|
cp -R scripts/analysis $RPM_BUILD_ROOT/opt/%{name}-%{version}/scripts
|
|
|
|
cp -R scripts/ems $RPM_BUILD_ROOT/opt/%{name}-%{version}/scripts
|
|
|
|
cp -R scripts/generic $RPM_BUILD_ROOT/opt/%{name}-%{version}/scripts
|
|
|
|
cp -R scripts/other $RPM_BUILD_ROOT/opt/%{name}-%{version}/scripts
|
|
|
|
cp -R scripts/recaser $RPM_BUILD_ROOT/opt/%{name}-%{version}/scripts
|
|
|
|
cp -R scripts/share $RPM_BUILD_ROOT/opt/%{name}-%{version}/scripts
|
|
|
|
cp -R scripts/tokenizer $RPM_BUILD_ROOT/opt/%{name}-%{version}/scripts
|
|
|
|
cp -R scripts/training $RPM_BUILD_ROOT/opt/%{name}-%{version}/scripts
|
2013-03-06 18:53:45 +04:00
|
|
|
%clean
|
|
|
|
%files
|
|
|
|
%defattr(-,root,root)
|
2014-03-03 20:50:36 +04:00
|
|
|
/opt/%{name}-%{version}/bin/*
|
|
|
|
/opt/%{name}-%{version}/scripts/OSM/*
|
|
|
|
/opt/%{name}-%{version}/scripts/Transliteration/*
|
|
|
|
/opt/%{name}-%{version}/scripts/analysis/*
|
|
|
|
/opt/%{name}-%{version}/scripts/ems/*
|
|
|
|
/opt/%{name}-%{version}/scripts/generic/*
|
|
|
|
/opt/%{name}-%{version}/scripts/other/*
|
|
|
|
/opt/%{name}-%{version}/scripts/recaser/*
|
|
|
|
/opt/%{name}-%{version}/scripts/share/*
|
|
|
|
/opt/%{name}-%{version}/scripts/tokenizer/*
|
|
|
|
/opt/%{name}-%{version}/scripts/training/*
|
|
|
|
/opt/%{name}-%{version}/irstlm-5.70.04/*
|
|
|
|
/opt/%{name}-%{version}/giza++-v1.0.7/*
|
|
|
|
%pre
|
|
|
|
if [ "$1" = "1" ]; then
|
|
|
|
elif [ "$1" = "2" ]; then
|
|
|
|
rm $RPM_INSTALL_PREFIX/%{name} 2>/dev/null
|
|
|
|
fi
|
|
|
|
%post
|
|
|
|
ln -s $RPM_INSTALL_PREFIX/%{name}-%{version} $RPM_INSTALL_PREFIX/%{name}
|
|
|
|
%postun
|
|
|
|
rm -Rf $RPM_INSTALL_PREFIX/%{name}-%{version} 2>/dev/null
|
|
|
|
rm $RPM_INSTALL_PREFIX/%{name} 2>/dev/null
|