Blob Blame Raw
%if ! (0%{?fedora} > 12 || 0%{?rhel} > 5)
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%endif

Name:		writetype
Version:	1.2.130
Release:	10%{?dist}
Summary:	Light word processor
Group:		Applications/Editors
License:	GPLv3+
URL:		http://writetype.bernsteinforpresident.com/
Source0:	http://bernsteinforpresident.com/programs/%{name}_%{version}.tar.gz
Patch0:		fixed_the_path_in_binary-executive_file_writetype.patch
Patch1:		quick_solution_for_no_sound_problem_tts-festival.patch
BuildRoot:	%{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)

BuildArch:	noarch
BuildRequires:	python2-devel
BuildRequires:	python-setuptools, desktop-file-utils

Requires:	PyQt4, pyttsx, python-enchant, festival

%description
WriteType is a free  (and open source) program that helps 
younger students experience success in writing. It is designed 
especially for schools to transform technology from a barrier 
into an opportunity for success.

%prep
%setup -q -n %{name}-%{version}
%patch0 -p1 -b .fix
%patch1 -p1 -b .fix
%build
%{__python} setup.py build

%install
rm -rf %{buildroot}
%{__python} setup.py install --skip-build --root %{buildroot}
# Handling desktop file
desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}.desktop
# Remove shebang
sed -i -e '/^#!\//, 1d' %{buildroot}%{python_sitelib}/%{name}/espeakInterface.py
sed -i -e '/^#!\//, 1d' %{buildroot}%{python_sitelib}/%{name}/listWidget.py
sed -i -e '/^#!\//, 1d' %{buildroot}%{python_sitelib}/%{name}/ttsInterface.py
sed -i -e '/^#!\//, 1d' %{buildroot}%{python_sitelib}/%{name}/festivalInterface.py
sed -i -e '/^#!\//, 1d' %{buildroot}%{python_sitelib}/%{name}/pyttsxInterface.py
sed -i -e '/^#!\//, 1d' %{buildroot}%{python_sitelib}/%{name}/main.py
# Delete zero length file
find %{buildroot}%{_datadir}/%{name} -size 0 -delete

#%%files -f %%{name}.lang
%files
%defattr(-,root,root,-)
%doc README COPYING
%{python_sitelib}/%{name}
%{python_sitelib}/WriteType-%{version}-py?.?.egg-info
%{_bindir}/%{name}
%{_datadir}/%{name}
%attr(0644,root,root) %{_datadir}/applications/%{name}.desktop


%changelog
* Fri Feb 15 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.130-10
- Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild

* Sun Jul 22 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.130-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild

* Sat Jan 14 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.2.130-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild

* Sun Jun 19 2011 Prabin Kumar Datta <prabindatta@fedoraproject.org> - 1.2.130-7
- Fixed Bug 752347

* Sun Jun 19 2011 Prabin Kumar Datta <prabindatta@fedoraproject.org> - 1.2.130-6
- removed shebangs

* Sun Jun 19 2011 Prabin Kumar Datta <prabindatta@fedoraproject.org> - 1.2.130-5
- added desktop-file-utils in build requires
- corrected License field in specfile
- patch as a quick solution for no sound in case of festival

* Mon May 09 2011 Prabin Kumar Datta <prabindatta@fedoraproject.org> - 1.2.130-4
- updated Requires packages

* Fri Apr 22 2011 Prabin Kumar Datta <prabindatta@fedoraproject.org> - 1.2.130-3
- Add COPYING file which contains Upstream License

* Wed Apr 20 2011 Prabin Kumar Datta <prabindatta@fedoraproject.org> - 1.2.130-2
- removed clean section since not required
- added desktop file handing section

* Wed Apr 20 2011 Prabin Kumar Datta <prabindatta@fedoraproject.org> - 1.2.130-1
- Initial build