%define __cmake_in_source_build 1
%bcond_with clang

Name:       pavucontrol-qt
Version:    1.4.0
Release:    1%{?dist}
License:    GPLv2+
URL:        http://lxqt.org/
Group:  	LXQt
Source0:    https://github.com/lxqt/%{name}/archive/%{version}/%{name}-%{version}.tar.xz

Summary:    Qt port of volume control pavucontrol

BuildRequires:  cmake
%if %{with clang}
BuildRequires: clang >= 5.0
%else
BuildRequires: gcc-c++
%endif
BuildRequires:  desktop-file-utils
BuildRequires:  pkgconfig(Qt5Gui) >= 5.15
BuildRequires:  kf5-kwindowsystem-devel
BuildRequires:  qt5-linguist
BuildRequires:  pkgconfig(lxqt) >= %{version}
BuildRequires:  pkgconfig(Qt5Xdg) >= 3.12.0
BuildRequires:  pkgconfig(libpulse) >= 5.0
BuildRequires:  pkgconfig(glib-2.0) >= 2.0

%description
%{summary}

%package l10n
Summary:        Translations for pavucontrol-qt
Requires:       pavucontrol-qt
%description l10n
This package provides translations for the pavucontrol-qt package.

%prep
%setup -q


%build
%{__mkdir} -p %{_target_platform}

%if %{with clang}
export CC=clang
export CXX=clang++
%endif

pushd %{_target_platform}
%{cmake_lxqt} \
    -DPULL_TRANSLATIONS=NO \
    ..

%cmake_build
popd

%install
pushd %{_target_platform}
  %cmake_install
popd

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


%find_lang pavucontrol-qt --with-qt

%files
%license LICENSE
%doc AUTHORS
%{_bindir}/%{name}
%{_datadir}/applications/%{name}.desktop
%{_datadir}/%{name}

%files l10n -f pavucontrol-qt.lang
%license LICENSE
%doc AUTHORS
%dir %{_datadir}/%{name}/translations

%changelog
* Mon Nov  6 2023 Raven <raven@sysadmins.ws> - 1.4.0-1
- update to 1.4.0
- clang support

* Thu May 18 2023 Raven <raven@sysadmins.ws> - 1.3.0-1
- update to 1.3.0

* Fri Nov 11 2022 Raven <raven@sysadmins.ws> - 1.2.0-1
- upgrade to 1.2.0

* Mon Nov 08 2021 Raven <raven@sysadmins.ws> - 1.0.0-1
- update to 1.0.0
- drop RHEL7 support

* Tue Jan 26 2021 Raven <raven@sysadmins.ws> - 0.16.0-1
- version update

* Tue Jun 16 2020 Raven <raven@sysadmins.ws> - 0.15.0-1
- version update

* Wed Jan 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.14.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_32_Mass_Rebuild

* Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.14.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild

* Mon Apr 15 2019 Zamir SUN <sztsian@gmail.com> - 0.14.1-1
- Update to version 0.14.1

* Wed Feb 13 2019 Zamir SUN <sztsian@gmail.com> - 0.14.0-2
- Add l10n sub package

* Wed Feb 13 2019 Zamir SUN <sztsian@gmail.com>  - 0.14.0-1
- Prepare for LXQt 0.14.0

* Fri Feb 01 2019 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild

* Sat Aug 04 2018 Zamir SUN <zsun@fedoraproject.org> - 0.4.0-1
- Update to version 0.4.0

* Fri Jul 13 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.0-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_29_Mass_Rebuild

* Wed Mar 07 2018 Rex Dieter <rdieter@fedoraproject.org> - 0.2.0-7
- BR: gcc-c++, use %%make_build

* Thu Feb 08 2018 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.0-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild

* Thu Aug 03 2017 Fedora Release Engineering <releng@fedoraproject.org> - 0.2.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_27_Binutils_Mass_Rebuild

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

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

* Thu Jan 19 2017 Christian Dersch <lupinix@mailbox.org> - 0.2.0-3
- rebuilt

* Wed Jan 18 2017 Christian Dersch <lupinix@mailbox.org> - 0.2.0-2
- moved translations to lxqt-l10n

* Wed Jan 11 2017 Christian Dersch <lupinix@mailbox.org> - 0.2.0-1
- new version

* Tue Sep 27 2016 Helio Chissini de Castro <helio@kde.org> - 0.1.0-2
- Change a bit the naming patch to use similar one upstreamed

* Mon Sep 26 2016 Helio Chissini de Castro <helio@kde.org> - 0.1.0-1
- New package. Distributed tied to lxqt 0.11.0 release
