highlight: allow dropping qt5 build dep

Building with '--without=qt' removes qt build deps, and also
results in not building the -gui package
This commit is contained in:
Amit Shah 2022-06-07 15:51:06 +00:00 committed by Amit Shah
parent c85aa9fb97
commit 7ffd7a5fa1

View File

@ -1,12 +1,17 @@
Name: highlight
Summary: Universal source code to formatted text converter
Version: 4.2
Release: 1%{?dist}
Release: 2%{?dist}
License: GPLv3
URL: http://www.andre-simon.de/
Source0: http://www.andre-simon.de/zip/%{name}-%{version}.tar.bz2
%bcond qt 1
BuildRequires: gcc-c++
%if %{with qt}
BuildRequires: qt5-qtbase-devel
%endif
BuildRequires: lua-devel, boost-devel
BuildRequires: desktop-file-utils
BuildRequires: make
@ -26,12 +31,14 @@ Language descriptions are configurable and support regular expressions.
The utility offers indentation and reformatting capabilities.
It is easily possible to create new language definitions and colour themes.
%if %{with qt}
%package gui
Summary: GUI for the highlight source code formatter
Requires: %{name} = %{version}-%{release}
%description gui
A Qt-based GUI for the highlight source code formatter source.
%endif
%prep
%autosetup
@ -43,7 +50,15 @@ LDFLAGS="$LDFLAGS %{?__global_ldflags}"; export LDFLAGS
# disabled paralell builds to fix FTBFS on rawhide & highlight 3.52+
#make_build all gui CFLAGS="${CFLAGS}" \
%{__make} all gui CFLAGS="${CFLAGS}" \
%{__make} all CFLAGS="${CFLAGS}" \
CXXFLAGS="${CXXFLAGS}" \
LDFLAGS="${LDFLAGS}" \
LFLAGS="-Wl,-O1 ${LDFLAGS}" \
PREFIX="%{_prefix}" \
conf_dir="%{_sysconfdir}/highlight/"
%if %{with qt}
%{__make} gui CFLAGS="${CFLAGS}" \
CXXFLAGS="${CXXFLAGS}" \
LDFLAGS="${LDFLAGS}" \
LFLAGS="-Wl,-O1 ${LDFLAGS}" \
@ -51,13 +66,16 @@ LDFLAGS="$LDFLAGS %{?__global_ldflags}"; export LDFLAGS
conf_dir="%{_sysconfdir}/highlight/" \
QMAKE="%{_qt5_qmake}" \
QMAKE_STRIP=
%endif
%install
%make_install PREFIX="%{_prefix}" conf_dir="%{_sysconfdir}/highlight/"
mkdir -p $RPM_BUILD_ROOT%{_datadir}/applications
mkdir -p $RPM_BUILD_ROOT%{_datadir}/pixmaps
%if %{with qt}
make install-gui DESTDIR=$RPM_BUILD_ROOT PREFIX="%{_prefix}" conf_dir="%{_sysconfdir}/highlight/"
%endif
rm -rf $RPM_BUILD_ROOT%{_docdir}/%{name}/
@ -75,13 +93,20 @@ desktop-file-install \
%doc ChangeLog* AUTHORS README* extras/
%license COPYING
%if %{with qt}
%files gui
%{_bindir}/highlight-gui
%{_datadir}/applications/highlight.desktop
%{_datadir}/icons/hicolor/256x256/apps/highlight.png
%else
%exclude %{_datadir}/applications/highlight.desktop
%endif
%changelog
* Tue Sep 6 2022 Amit Shah <amitshah@fedoraproject.org> - 4.2-2
- Allow disabling Qt deps
* Thu Aug 25 2022 Filipe Rosset <rosset.filipe@gmail.com> - 4.2-1
- Update to 4.2