e106a61
%global debug_package %{nil}
b0f8346
%bcond_without  gui
a6baf6c
a6baf6c
Name:           ansifilter
1ad6610
Version:        2.18
e294046
Release:        2%{?dist}
a6baf6c
Summary:        ANSI terminal escape code converter
a6baf6c
License:        GPLv3+
a6baf6c
URL:            http://www.andre-simon.de/doku/ansifilter/ansifilter.php
2798387
Source0:        http://www.andre-simon.de/zip/%{name}-%{version}.tar.bz2
7f1d700
BuildRequires:  gcc-c++
b0f8346
%if %{with gui}
a6baf6c
Source1:        ansifilter.desktop
a6baf6c
Source2:        http://www.andre-simon.de/img/af_icon.png
a6baf6c
%endif
a6baf6c
a6baf6c
%description
b0f8346
Ansifilter handles text files containing ANSI terminal escape codes. The
b0f8346
command sequences may be stripped or be interpreted to generate formatted
a6baf6c
output (HTML, RTF, TeX, LaTeX, BBCode).
a6baf6c
b0f8346
%if %{with gui}
a6baf6c
%package        gui
5c8cbe4
Summary:        GUI for %{name} based on Qt5
a6baf6c
BuildRequires:  desktop-file-utils
29915d4
BuildRequires:  qt5-qtbase-devel
4633d27
BuildRequires: make
a6baf6c
a6baf6c
%description    gui
b0f8346
Ansifilter handles text files containing ANSI terminal escape codes. The
b0f8346
command sequences may be stripped or be interpreted to generate formatted
a6baf6c
output (HTML, RTF, TeX, LaTeX, BBCode).
a6baf6c
5c8cbe4
This is a GUI of %{name} based on Qt5.
a6baf6c
%endif
a6baf6c
a6baf6c
%prep
4ad249a
%autosetup
b0f8346
b0f8346
# Preserve timestamps.
b0f8346
sed -i 's|install -m|install -pm|g' makefile
b0f8346
b0f8346
%if %{with gui}
b0f8346
# Remove pre-configured files which may cause errors during building.
a6baf6c
rm -frv src/qt-gui/moc_*.cpp
b0f8346
rm -frv src/qt-gui/Makefile*
b0f8346
%endif
b0f8346
d29ace7
# CRLF quickfix
a6baf6c
find . -type f -exec sed -i 's/\r$//' {} + -print
a6baf6c
a6baf6c
%build
d29ace7
# Upstream embeds the cli code in gui so no need to require cli to use GUI
a6baf6c
# program, in order to achieve this we need to preserve the objects with -c.
b0f8346
%make_build CFLAGS+="%{optflags} -c" LDFLAGS="%{?__global_ldflags}"
b0f8346
b0f8346
%if %{with gui}
29915d4
# %%_qt5_qmake will respect the redhat-rpm-config
29915d4
%make_build all-gui QMAKE="%{_qt5_qmake}"
a6baf6c
%endif
a6baf6c
a6baf6c
%install
b0f8346
%make_install
a6baf6c
b0f8346
%if %{with gui}
b0f8346
make install-gui DESTDIR=%{buildroot}
a6baf6c
desktop-file-install --dir=%{buildroot}%{_datadir}/applications %{S:1}
a6baf6c
install -pDm644 %{S:2} %{buildroot}%{_datadir}/pixmaps/%{name}.png
a6baf6c
%endif
a6baf6c
b0f8346
# Use %%doc and %%license to handle docs.
0a89ff6
rm -frv %{buildroot}%{_docdir}
a6baf6c
a6baf6c
%files
f503eeb
%doc ChangeLog* README*
b0f8346
%license COPYING
a6baf6c
%{_bindir}/ansifilter
a6baf6c
%{_mandir}/man1/ansifilter.1*
a6baf6c
b0f8346
%if %{with gui}
a6baf6c
%files gui
f503eeb
%doc ChangeLog* README*
b0f8346
%license COPYING
a6baf6c
%{_bindir}/ansifilter-gui
a6baf6c
%{_datadir}/applications/%{name}.desktop
4ad249a
%{_datadir}/pixmaps/ansifilter.*
a6baf6c
%endif
a6baf6c
a6baf6c
%changelog
e294046
* Wed Jul 21 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.18-2
e294046
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
e294046
1ad6610
* Fri Feb 05 2021 Filipe Rosset <rosset.filipe@gmail.com> - 2.18-1
1ad6610
- Update to 2.18 fixes rhbz#1925318
1ad6610
d3f0723
* Tue Jan 26 2021 Fedora Release Engineering <releng@fedoraproject.org> - 2.17-2
d3f0723
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
d3f0723
9596533
* Wed Dec 30 2020 Filipe Rosset <rosset.filipe@gmail.com> - 2.17-1
9596533
- Update to 2.17 fixes rhbz#1884414
9596533
fa3b1ed
* Fri Jul 31 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.16-3
fa3b1ed
- Second attempt - Rebuilt for
fa3b1ed
  https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
fa3b1ed
11bc442
* Mon Jul 27 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.16-2
11bc442
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
11bc442
11ee5ec
* Mon Feb 03 2020 Filipe Rosset <rosset.filipe@gmail.com> - 2.15-3
11ee5ec
- Update to 2.16 fixes rhbz#1796175
11ee5ec
c1c2bd3
* Tue Jan 28 2020 Fedora Release Engineering <releng@fedoraproject.org> - 2.15-2
c1c2bd3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild
c1c2bd3
9686219
* Mon Jan 20 2020 Filipe Rosset <rosset.filipe@gmail.com> - 2.15-1
9686219
- Update to 2.15 fixes rhbz#1771191
9686219
acea6e6
* Wed Jul 24 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.14-2
acea6e6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild
acea6e6
95a9abe
* Wed Apr 24 2019 Filipe Rosset <rosset.filipe@gmail.com> - 2.14-1
95a9abe
- Updated to new 2.14 upstream version, fixes rhbz #1702469
95a9abe
38f181d
* Thu Jan 31 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.13-2
38f181d
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild
38f181d
a305325
* Tue Jan 01 2019 Filipe Rosset <rosset.filipe@gmail.com> - 2.13-1
a305325
- Updated to new 2.13 upstream version
a305325
c13340e
* Thu Nov 15 2018 Filipe Rosset <rosset.filipe@gmail.com> - 2.12-1
c13340e
- Updated to new 2.12 upstream version
c13340e
f503eeb
* Sat Oct 27 2018 Filipe Rosset <rosset.filipe@gmail.com> - 2.11-1
f503eeb
- Updated to new 2.11 upstream version
f503eeb
- upstream changelog http://www.andre-simon.de/doku/ansifilter/en/changelog.php
f503eeb
4f82b0c
* Thu Jul 12 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.10-3
4f82b0c
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild
4f82b0c
7f1d700
* Sun Apr 08 2018 Filipe Rosset <rosset.filipe@gmail.com> - 2.10-2
7f1d700
- added gcc-c++ as BR
7f1d700
4ad249a
* Fri Mar 30 2018 Filipe Rosset <rosset.filipe@gmail.com> - 2.10-1
4ad249a
- Updated to new 2.10 upstream version, fixes rhbz #1552957
4ad249a
62a0f93
* Wed Feb 07 2018 Fedora Release Engineering <releng@fedoraproject.org> - 2.8-2
62a0f93
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild
62a0f93
9da7a5f
* Mon Aug 07 2017 Filipe Rosset <rosset.filipe@gmail.com> - 2.8-1
9da7a5f
- Updated to new 2.8 upstream version, fixes rhbz #1463860
9da7a5f
- Remove upstreamed patch
9da7a5f
1d708a8
* Wed Aug 02 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.6-2
1d708a8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild
1d708a8
e106a61
* Thu Jul 27 2017 Filipe Rosset <rosset.filipe@gmail.com> - 2.6-1
e106a61
- Updated to new 2.6 upstream version, fixes rhbz #1463860
e106a61
- Added patch to fix build issues with fpic and disable debug info packages
e106a61
e711875
* Wed Jul 26 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.4-3
e711875
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Mass_Rebuild
e711875
bc3651a
* Fri Feb 10 2017 Fedora Release Engineering <releng@fedoraproject.org> - 2.4-2
bc3651a
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild
bc3651a
0571383
* Thu Jan 05 2017 Filipe Rosset <rosset.filipe@gmail.com> - 2.4-1
0571383
- Updated to new 2.4 upstream version, fixes rhbz #1409270
0571383
42d7ca7
* Thu Nov 03 2016 Filipe Rosset <rosset.filipe@gmail.com> - 2.3-1
0571383
- Updated to new 2.3 upstream version, fixes rhbz #1380049
42d7ca7
fb342ea
* Fri Sep 16 2016 Filipe Rosset <rosset.filipe@gmail.com> - 2.2-1
fb342ea
- Updated to new 2.2 upstream version, fixes rhbz #1376619
fb342ea
69fed21
* Tue Sep 13 2016 Filipe Rosset <rosset.filipe@gmail.com> - 2.1-1
69fed21
- Updated to new 2.1 upstream version, fixes rhbz #1352252 #1359434
69fed21
c1935bf
* Mon Jul 04 2016 Filipe Rosset <rosset.filipe@gmail.com> - 1.18-1
c1935bf
- Updated to new 1.18 upstream version, fixes rhbz #1352252
c1935bf
3c203a5
* Tue May 24 2016 Filipe Rosset <rosset.filipe@gmail.com> - 1.17-1
3c203a5
- Updated to new 1.17 upstream version, fixes rhbz #1339022
3c203a5
29915d4
* Wed May 18 2016 Filipe Rosset <rosset.filipe@gmail.com> - 1.16-1
29915d4
- Updated to new 1.16 upstream version, build against qt5 instead of qt4
29915d4
e98d68f
* Wed Feb 03 2016 Fedora Release Engineering <releng@fedoraproject.org> - 1.12-4
e98d68f
- Rebuilt for https://fedoraproject.org/wiki/Fedora_24_Mass_Rebuild
e98d68f
5573e44
* Tue Jun 16 2015 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.12-3
5573e44
- Rebuilt for https://fedoraproject.org/wiki/Fedora_23_Mass_Rebuild
5573e44
93ee35a
* Sat May 02 2015 Kalev Lember <kalevlember@gmail.com> - 1.12-2
93ee35a
- Rebuilt for GCC 5 C++11 ABI change
93ee35a
4e561c5
* Tue Mar 31 2015 Christopher Meng <rpm@cicku.me> - 1.12-1
4e561c5
- Update to 1.12
4e561c5
b0f8346
* Mon Feb 16 2015 Christopher Meng <rpm@cicku.me> - 1.11-1
b0f8346
- Update to 1.11
b0f8346
2938365
* Fri Aug 15 2014 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.8-3
2938365
- Rebuilt for https://fedoraproject.org/wiki/Fedora_21_22_Mass_Rebuild
2938365
a6baf6c
* Thu Jun 26 2014 Christopher Meng <rpm@cicku.me> - 1.8-2
a6baf6c
- Correct the license.
a6baf6c
- desktop file added for gui program.
a6baf6c
a6baf6c
* Mon Apr 21 2014 Christopher Meng <rpm@cicku.me> - 1.8-1
a6baf6c
- Update to 1.8
a6baf6c
a6baf6c
* Tue Dec 31 2013 Christopher Meng <rpm@cicku.me> - 1.7-1
a6baf6c
- Initial Package.