File usbguard-notifier.spec of Package usbguard-notifier
#
# spec file for package usbguard-notifier
#
# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: usbguard-notifier
Version: 0.1.1
Release: 0
Summary: GUI for USBguard notifications
License: GPL-2.0-only
Group: System/Management
URL: https://github.com/Cropi/usbguard-notifier
Source0: https://github.com/Cropi/usbguard-notifier/archive/%{name}-%{version}.tar.gz
Source1: README_openSUSE
Patch1: notifier_delay.patch
Requires: usbguard
Requires: usbguard-tools
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: pkgconfig(libnotify)
BuildRequires: pkgconfig(catch2)
BuildRequires: libqb-devel
BuildRequires: usbguard-devel
BuildRequires: librsvg-devel
BuildRequires: asciidoc
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: c++_compiler
BuildRequires: libtool
BuildRequires: systemd-rpm-macros
%{?systemd_requires}
%if 0%{?sle_version} == 150400 || 0%{?sle_version} == 150500 || 0%{?sle_version} == 150600
BuildRequires: gcc11
BuildRequires: gcc11-c++
%else
%if 0%{?suse_version} == 1500
BuildRequires: gcc15
BuildRequires: gcc15-c++
%else
%if 0%{?suse_version} > 1600
BuildRequires: gcc15
BuildRequires: gcc15-c++
%endif
%endif
%endif
%description
USBGuard Notifier is a software framework mainly for detecting usbguard policy modifications
as well as device presence changes. In a nutshell, the purpose of this project is to create
user-friendly notifications in form of quick pop-up messages.
%prep
%setup -q -n %{name}-%{version}
%patch -P 1 -p0
%build
cp %{S:1} .
mkdir -p m4
autoreconf --install
# use modern compiler on suse
%if 0%{?sle_version} == 150400 || 0%{?sle_version} == 150500 || 0%{?sle_version} == 150600
CC=gcc-11 ; export CC
CXX=g++-11 ; export CXX
%else
%if 0%{?suse_version} == 1500
CC=gcc-15 ; export CC
CXX=g++-15 ; export CXX
%else
%if 0%{?suse_version} > 1600
CC=gcc-15 ; export CC
CXX=g++-15 ; export CXX
%endif
%endif
%endif
echo "####"
echo "suse_version = %{suse_version}"
echo "is_opensuse = %{is_opensuse}"
echo "sle_version = %{sle_version}"
export CPPFLAGS='-fPIE'
export LDFLAGS='-pie'
%configure --with-bundled-catch
make %{?_smp_mflags}
%install
%make_install
%files
%defattr(-,root,root)
%doc CHANGELOG.md README.md LICENSE README_openSUSE
%{_bindir}/usbguard-notifier
%{_bindir}/usbguard-notifier-cli
%{_userunitdir}/usbguard-notifier.service
%{_mandir}/man1/usbguard-notifier-cli.1.gz
%{_mandir}/man1/usbguard-notifier.1.gz
%preun
%service_del_preun usbguard-notifier.service
%post
%service_add_post usbguard-notifier.service
%postun
%service_del_postun usbguard-notifier.service
%pre
%service_add_pre usbguard-notifier.service
%changelog