Blob Blame History Raw
Name:    cool-retro-term
Version: 1.0.1
Release: 4%{?dist}
Summary: Terminal emulator mimicking a CRT display
License: GPLv3+

URL: https://github.com/Swordfish90/%{name}
Source0: %{URL}/archive/%{version}/%{name}-%{version}.tar.gz

BuildRequires: qt5-devel
BuildRequires: desktop-file-utils
BuildRequires: libappstream-glib
BuildRequires: qmltermwidget

Requires: hicolor-icon-theme
Requires: qmltermwidget
Requires: qt5-qtgraphicaleffects
Requires: qt5-qtdeclarative


%description
%{name} is a terminal emulator which tries to mimic the look and feel
of the old cathode tube screens. It has been designed to be eye-candy,
customizable, and reasonably lightweight.


%prep
%setup -q

# qmltermwidget is included in the project via a git submodule.
# Since we serve it as a separate package, we modify
# the project file so it doesn't try to compile the bundled library.
rm -rf ./qmltermwidget
sed -e "s/SUBDIRS += qmltermwidget//" -i %{name}.pro

# Screenshot sizes specified in the appdata file
# do not match the sizes of the actual images.
sed -e 's/ width="[0-9]*"//' -i packaging/appdata/%{name}.appdata.xml
sed -e 's/ height="[0-9]*"//' -i packaging/appdata/%{name}.appdata.xml


%build
%_qt5_qmake CONFIG+=force_debug_info
make %{?_smp_mflags}


%install
make INSTALL_ROOT=%{buildroot} install

desktop-file-install                         \
  --dir=%{buildroot}%{_datadir}/applications \
  %{name}.desktop

install -m 755 -d %{buildroot}%{_datadir}/metainfo/
install -m 644 packaging/appdata/%{name}.appdata.xml %{buildroot}%{_datadir}/metainfo/

install -m 755 -d %{buildroot}%{_mandir}/man1/
install -m 644 packaging/debian/%{name}.1 %{buildroot}%{_mandir}/man1/


%check
appstream-util validate-relax --nonet %{buildroot}%{_datadir}/metainfo/%{name}.appdata.xml


# Needed for the icon cache to work correctly
%post
/bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null || :

%postun
if [ $1 -eq 0 ] ; then
    /bin/touch --no-create %{_datadir}/icons/hicolor &>/dev/null
    /usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
fi

%posttrans
/usr/bin/gtk-update-icon-cache %{_datadir}/icons/hicolor &>/dev/null || :
# End of icon cache related stuff


%files
%doc README.md
%license gpl-3.0.txt
%{_bindir}/%{name}
%{_mandir}/man1/*
%{_datadir}/applications/%{name}.desktop
%{_datadir}/icons/hicolor/*/*/*
%{_datadir}/metainfo/%{name}.appdata.xml


%changelog
* Sun Nov 26 2017 Artur Iwicki <fedora@svgames.pl> 1.0.1-4
- Use the %%_qt5_qmake macro during build
- Add runtime dependency on qmltermwidget
- Fix manpage permissions during install (-ax)

* Fri Nov 10 2017 Artur Iwicki <fedora@svgames.pl> 1.0.1-3
- Request tarball using %%{version} instead of %%{commit}
- Unbundle qmltermwidget
- Include manpage in package

* Sun Nov 05 2017 Artur Iwicki <fedora@svgames.pl> 1.0.1-2
- Add missing "Requires:"
- Invoke gtk-update-icon-cache after install/removal
- Remove ownership of libdir/qt5/qml/

* Sat Nov 04 2017 Artur Iwicki <fedora@svgames.pl> 1.0.1-1
- Initial packaging