Blob Blame History Raw
# https://codereview.qt-project.org/#/c/107725/
%bcond_with     qt5

%global gitdate 20140202
%global commit0 6ada849baca7918078e53f7dece4d96b2a0e6210

Name:           lxqt-config-randr
Version:        0.1.2
%if 0%{?gitdate}
Release:        1.%{gitdate}git%(c=%{commit0}; echo ${c:0:7} )%{?dist}
%else
Release:        1%{?dist}
%endif
Summary:        GUI interface to RandR extension

License:        GPLv2+
URL:            https://github.com/zballina/%{name}
%if 0%{?gitdate}
Source0:        %{url}/archive/%{commit0}.tar.gz#/%{name}-%{commit0}.tar.gz
%else
Source0:        %{url}/archive/%{version}.tar.gz#/%{name}-%{version}.tar.gz
%endif
Patch0:         %{name}-qt5.patch

BuildRequires:  pkgconfig(lxqt)
BuildRequires:  desktop-file-utils

%if %with qt5
BuildRequires:  pkgconfig(Qt5Core)
BuildRequires:  pkgconfig(Qt5Gui)
BuildRequires:  pkgconfig(Qt5Widgets)
BuildRequires:  pkgconfig(Qt5X11Extras)
%else
BuildRequires:  qt4-devel
%endif

%description
Qt-based tool to configure the X output using the RandR 1.3/1.2 extension,
based in KDE parts, intended to be a viable option for the LXQt desktop.


%prep
%if 0%{?gitdate}
%setup -qn%{name}-%{commit0}
# revert Virtual Modes: Fixing bug in Brightness setting (PR#6)
# commit/3aa7fa26fb61a7a521443ff3ef1d3abc574f609e
# prevents gcc error: 'sleep' was not declared in this scope
sed -i /sleep/d src/randrcrtc.cpp
%else
%setup -q
%endif
%if %with qt5
%patch0 -p1
%endif

%build
mkdir -p %{_target_platform}
pushd %{_target_platform}
%cmake_lxqt ..
popd
%make_build -C %{_target_platform}

%install
%make_install -C %{_target_platform}
# Exclude category as been Service 
desktop-file-edit --remove-category=LXQt --remove-only-show-in=LXQt \
 --add-only-show-in=X-LXQt %{buildroot}%{_datadir}/applications/%{name}.desktop

%check
desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}.desktop


%files
%license COPYING*
%doc AUTHORS README.md
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop


%changelog
* Fri May 13 2016 Raphael Groner <projects.rg@smart.ms> - 0.1.2-1.20140202git6ada849
- initial