Blob Blame Raw
Name: 		txt2tags
Summary: 	Summary: Converts text files to HTML, XHTML, LaTeX, and other formats
Version: 	2.5
Release:	21%{?dist}
License: 	GPLv2
URL: 		http://txt2tags.sourceforge.net/

Source0: http://txt2tags.googlecode.com/files/txt2tags-%{version}.tgz

BuildArch: noarch

BuildRequires: python2
BuildRequires: gettext

Requires: python2

%description
Txt2tags is a document generator. It reads a text file with minimal markup as 
**bold** and //italic// and converts it to the following formats:

    * HTML
    * XHTML
    * SGML
    * LaTeX
    * Lout
    * Man page
    * Wikipedia (NEW)
    * Google Code Wiki (NEW)
    * DokuWiki (NEW)
    * MoinMoin
    * MagicPoint
    * PageMaker
    * Plain text 

%prep
#NONE

%setup -q
#Remove executable flag
chmod 0644 extras/*

#Create locale files
for file in $(ls -1 po/*.po); do
	msgfmt -o ${file//.po/.mo} $file
done

%build
#NONE

%install
#For sanity protection, nuke buildroot
rm -rf %{buildroot}

#Install the executable
install -Dp -m0755 txt2tags %{buildroot}%{_bindir}/txt2tags

#Install manpages
install -Dp -m0644 doc/manpage.man %{buildroot}%{_mandir}/man1/txt2tags.1
for file in $(ls -1 doc/manpage-*.man); do
	lang="${file##doc/manpage-}"
	lang="${lang%%.man}"
	install -Dp -m0644 $file %{buildroot}%{_mandir}/$lang/man1/txt2tags.1
done

#Install locale(s)
for file in $(ls -1 po/*.mo); do
	basename="${file##po/}"
	lang="${basename%%.mo}"
	install -Dp -m0644 $file %{buildroot}%{_datadir}/locale/$lang/LC_MESSAGES/txt2tags.mo
done

# Install extras without Mac OS files - Thanks to Kairo Araujo <kairo@kairo.eti.br>
for extras in $(ls -1 extras/ | grep -v .__); do
   install -Dp -m0644 extras/$extras $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/extras/$extras
   iconv -f iso8859-1 -t UTF-8 $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/extras/$extras > $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/extras/$extras.tmp
   mv -f $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/extras/$extras.tmp $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/extras/$extras
done

#get rid of the .mgp files as they are not applicable anymore
rm -f samples/*.mgp
 
# Install samples without Mac OS files - Thanks to Kairo Araujo <kairo@kairo.eti.br>
for samples in $(ls -1 samples/sample*); do
         install -Dp -m0644 $samples $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/$samples
         iconv -f iso8859-1 -t UTF-8 $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/$samples > $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/$samples.tmp
         mv -f $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/$samples.tmp $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/$samples
done

for samples_css in $(ls -1 samples/css/*); do
   install -Dp -m0644 $samples_css $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/$samples_css
done
for sample_img in $(ls -1 samples/img/*); do
   install -Dp -m0644 $sample_img $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/$sample_img
done
for sample_module in $(ls -1 samples/module/*); do
   install -Dp -m0644 $sample_module $RPM_BUILD_ROOT%{_datadir}/doc/%{name}/$sample_module
done


%find_lang %{name}

%files -f %{name}.lang
%doc ChangeLog COPYING README TODO doc/*.pdf extras/ samples/
%doc %{_mandir}/man1/txt2tags.1*
%doc %{_mandir}/*/man1/txt2tags.1*
%{_bindir}/txt2tags
%dir %{_docdir}/%{name}
%dir %{_docdir}/%{name}/extras
%dir %{_docdir}/%{name}/samples
%{_docdir}/%{name}/extras/*
%{_docdir}/%{name}/samples/*


%changelog
* Sun Feb 03 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.5-21
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

* Sat Jul 14 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.5-20
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.5-19
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Mon Feb 05 2018 Iryna Shcherbina <ishcherb@redhat.com> - 2.5-18
- Update Python 2 dependency declarations to new packaging standards
  (See https://fedoraproject.org/wiki/FinalizingFedoraSwitchtoPython3)

* Thu Jul 27 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.5-17
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild

* Sat Feb 11 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.5-16
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild

* Fri Feb 05 2016 Fedora Release Engineering <releng@fedoraproject.org> - 2.5-15
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild

* Fri Jun 19 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5-14
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild

* Sun Aug 04 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5-13
- Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild

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

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

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

* Wed Feb 09 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild

* Wed Aug 11 2010 David Malcolm <dmalcolm@redhat.com> - 2.5-8
- recompiling .py files against Python 2.7 (rhbz#623415)

* Sun Jul 26 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.5-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild

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

* Thu Dec 04 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 2.5-5
- Rebuild for Python 2.6

* Tue Dec 02 2008 Adam Miller <maxamillion [AT] gmail.com - 2.5-4
- Fixed directory ownership as per bug #473991
- https://bugzilla.redhat.com/show_bug.cgi?id=473991
* Mon Dec 01 2008 Ignacio Vazquez-Abrams <ivazqueznet+rpm@gmail.com> - 2.5-3
- Rebuild for Python 2.6

* Mon Aug 11 2008 Adam Miller <maxamillion [AT] gmail.com> - 2.5-2
- Fourth attempt, issues resolved:
- Increased release number
- Added BuildRequires entry for gettext (for msgfmt)
* Fri Aug 1 2008 Adam Miller <maxamillion [AT] gmail.com> - 2.5-1
- Third attempt, got rid of the Mac files (Thanks again to Kairo)
- Took care of the .mgp files
* Thu Jul 31 2008 Adam Miller <maxamillion [AT] gmail.com> - 2.5-1
- Second attempt at packaging txt2tags
* Mon Jul 28 2008 Adam Miller <maxamillion [AT] gmail.com> - 2.5-1
- First attempt at packaging txt2tags