Compare commits

..

1 commit

Author SHA1 Message Date
Radovan Sroka
4a78cd9c9c
Rebuild with usbguard 1.0.0
Signed-off-by: Radovan Sroka <rsroka@redhat.com>
2021-01-15 12:33:17 +01:00
5 changed files with 11 additions and 437 deletions

2
.gitignore vendored
View file

@ -1,4 +1,2 @@
/usbguard-notifier-0.0.5.tar.gz
/usbguard-notifier-0.0.6.tar.gz
/usbguard-notifier-0.1.0.tar.gz
/usbguard-notifier-0.1.1.tar.gz

View file

@ -1,12 +0,0 @@
diff --git a/src/Serializer.hpp b/src/Serializer.hpp
index c90a57e..d38991a 100644
--- a/src/Serializer.hpp
+++ b/src/Serializer.hpp
@@ -20,6 +20,7 @@
#ifndef SERIALIZER_HPP
#define SERIALIZER_HPP
+#include <cstdint>
#include <fstream>
#include <map>
#include <string>

View file

@ -1,366 +0,0 @@
diff --git a/Makefile.am b/Makefile.am
index 64f899e..3625717 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -20,7 +20,6 @@
ACLOCAL_AMFLAGS = -I m4
CLEANFILES =
-SUBDIRS = src/Tests/
bin_PROGRAMS = usbguard-notifier
if NOTIFIER_CLI_ENABLED
bin_PROGRAMS += \
@@ -31,8 +30,7 @@ EXTRA_DIST = \
src/BuildConfig.h.in \
README.md \
LICENSE \
- CHANGELOG.md \
- src/ThirdParty/Catch2/single_include/catch2
+ CHANGELOG.md
usbguard_notifier_SOURCES = \
src/usbguard-icon.hpp \
diff --git a/configure.ac b/configure.ac
index 3728e4c..a867ee6 100644
--- a/configure.ac
+++ b/configure.ac
@@ -127,31 +127,6 @@ AC_SUBST(SYSTEMD_UNIT_DIR, $systemd_unit_dir)
AC_DEFINE([SYSTEMD_SUPPORT_ENABLED], [1], [Enable systemd support int the project])
AM_CONDITIONAL([SYSTEMD_SUPPORT_ENABLED], [test "x$systemd" = xyes ])
-# Catch C++ library
-AC_ARG_WITH([bundled-catch], AS_HELP_STRING([--with-bundled-catch],
- [Build using the bundled Catch library]),
- [with_bundled_catch=$withval], [with_bundled_catch=no])
-if test "x$with_bundled_catch" = xyes; then
- catch_CFLAGS="-I\$(top_srcdir)/src/ThirdParty/Catch2/single_include/catch2"
- catch_LIBS=""
- AC_MSG_NOTICE([Using bundled Catch library])
- catch_summary="bundled; $catch_CFLAGS $catch_LIBS"
-else
- SAVE_CPPFLAGS=$CPPFLAGS
- CPPFLAGS="-std=c++11 $CPPFLAGS -I/usr/include/catch"
- AC_LANG_PUSH([C++])
- AC_CHECK_HEADER([catch.hpp], [], [AC_MSG_FAILURE(catch.hpp not found or not
- usable. Re-run with --with-bundled-catch to use the bundled library.)])
- AC_LANG_POP
- catch_CFLAGS="-I/usr/include/catch"
- catch_LIBS=""
- CPPFLAGS=$SAVE_CPPFLAGS
- catch_summary="system-wide;
- $catch_CFLAGS $catch_LIBS"
-fi
-AC_SUBST([catch_CFLAGS])
-AC_SUBST([catch_LIBS])
-
CXXFLAGS_DEBUG="-g -O2"
AC_ARG_ENABLE(
[debug-build],
@@ -184,7 +159,6 @@ AM_CONDITIONAL([CUSTOM_USBGUARD_DEVEL_ENABLED], [test "x$custom_usbguard_devel_e
AC_CONFIG_FILES([
Makefile
- src/Tests/Makefile
])
AC_OUTPUT
@@ -194,7 +168,6 @@ echo "============== MACROS ================="
echo " systemd: $systemd_unit_dir"
echo ""
echo "========== LINKER OPTIONS ============="
-echo " Catch: $catch_summary"
echo " libnotify: $libnotify_summary"
echo " libusbguard: $libusbguard_summary"
echo " librsvg: $librsvg_summary"
diff --git a/src/Tests/Makefile.am b/src/Tests/Makefile.am
deleted file mode 100644
index 54c1765..0000000
--- a/src/Tests/Makefile.am
+++ /dev/null
@@ -1,45 +0,0 @@
-##
-## Copyright (C) 2019 Red Hat, Inc.
-##
-## This program is free software: you can redistribute it and/or modify
-## it under the terms of the GNU General Public License as published by
-## the Free Software Foundation, either version 2 of the License, or
-## (at your option) any later version.
-##
-## This program is distributed in the hope that it will be useful,
-## but WITHOUT ANY WARRANTY; without even the implied warranty of
-## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-## GNU General Public License for more details.
-##
-## You should have received a copy of the GNU General Public License
-## along with this program. If not, see <https://www.gnu.org/licenses/>.
-##
-## Author(s): Zoltán Fridrich <zfridric@redhat.com>
-##
-
-AM_CPPFLAGS = \
- -I$(top_srcdir)/src \
- @catch_CFLAGS@ \
- -fPIC
-
-EXTRA_DIST = \
- $(top_srcdir)/src/ThirdParty/Catch2
-
-TESTS_ENVIRONMENT = \
- builddir=$(top_builddir) \
- srcdir=$(top_srcdir) \
- abs_top_srcdir=$(abs_top_srcdir)
-
-TESTS = \
- test-unit
-
-check_PROGRAMS = \
- test-unit
-
-test_unit_SOURCES=\
- main.cpp \
- Unit/test_notifier_cli.cpp \
- ../NotifierCLI.hpp \
- ../NotifierCLI.cpp \
- ../Serializer.hpp \
- ../Serializer.cpp
diff --git a/src/Tests/Unit/test_notifier_cli.cpp b/src/Tests/Unit/test_notifier_cli.cpp
deleted file mode 100644
index d77cd71..0000000
--- a/src/Tests/Unit/test_notifier_cli.cpp
+++ /dev/null
@@ -1,227 +0,0 @@
-#include "NotifierCLI.hpp"
-
-#include <catch.hpp>
-
-using namespace usbguardNotifier;
-
-TEST_CASE("Notifier CLI", "[CLI]")
-{
- SECTION("Construct empty") {
- CLI::map e;
- CLI cli(e);
- REQUIRE(cli.getDb().empty());
- REQUIRE(cli.getIterator() == cli.getDb().cend());
- }
- CLI::map db = {
- { 1, {}},
- { 2, {}},
- { 3, {}},
- { 4, {}},
- { 5, {}},
- { 6, {}},
- { 7, {}},
- { 8, {}},
- { 9, {}}
- };
- CLI cli(db);
-
- SECTION("Construct non-empty") {
- REQUIRE(cli.getDb() == db);
- REQUIRE(cli.getIterator() == cli.getDb().cbegin());
- }
-
- SECTION("Jump") {
- cli.jump("2");
- REQUIRE(cli.getIterator() == db.find(2));
- cli.jump("0");
- REQUIRE(cli.getIterator() == db.find(2));
- cli.jump("-1");
- REQUIRE(cli.getIterator() == db.find(2));
- cli.jump("10");
- REQUIRE(cli.getIterator() == db.find(2));
- cli.jump("9");
- REQUIRE(cli.getIterator() == db.find(9));
- cli.jump("9");
- REQUIRE(cli.getIterator() == db.find(9));
- cli.jump("1");
- REQUIRE(cli.getIterator() == db.find(1));
- }
-
- SECTION("Next") {
- cli.jump("1");
- REQUIRE(cli.getIterator() == cli.getDb().cbegin());
-
- cli.next("");
- REQUIRE(cli.getIterator() == db.find(2));
- cli.next("");
- REQUIRE(cli.getIterator() == db.find(3));
- cli.next("");
- REQUIRE(cli.getIterator() == db.find(4));
- cli.next("");
- REQUIRE(cli.getIterator() == db.find(5));
- cli.next("");
- REQUIRE(cli.getIterator() == db.find(6));
- cli.next("");
- REQUIRE(cli.getIterator() == db.find(7));
- cli.next("");
- REQUIRE(cli.getIterator() == db.find(8));
- cli.next("");
- REQUIRE(cli.getIterator() == db.find(9));
- cli.next("");
- REQUIRE(cli.getIterator() == db.find(9));
- }
-
- SECTION("Previous") {
- cli.jump("9");
- REQUIRE(cli.getIterator() == cli.getDb().find(9));
-
- cli.previous("");
- REQUIRE(cli.getIterator() == db.find(8));
- cli.previous("");
- REQUIRE(cli.getIterator() == db.find(7));
- cli.previous("");
- REQUIRE(cli.getIterator() == db.find(6));
- cli.previous("");
- REQUIRE(cli.getIterator() == db.find(5));
- cli.previous("");
- REQUIRE(cli.getIterator() == db.find(4));
- cli.previous("");
- REQUIRE(cli.getIterator() == db.find(3));
- cli.previous("");
- REQUIRE(cli.getIterator() == db.find(2));
- cli.previous("");
- REQUIRE(cli.getIterator() == db.find(1));
- cli.previous("");
- REQUIRE(cli.getIterator() == db.find(1));
- }
-
- SECTION("Execute - jump") {
- cli.execute("jump", "2");
- REQUIRE(cli.getIterator() == db.find(2));
- cli.execute("jump", "0");
- REQUIRE(cli.getIterator() == db.find(2));
- cli.execute("jump", "-1");
- REQUIRE(cli.getIterator() == db.find(2));
- cli.execute("jump", "10");
- REQUIRE(cli.getIterator() == db.find(2));
- cli.execute("jump", "9");
- REQUIRE(cli.getIterator() == db.find(9));
- cli.execute("jump", "9");
- REQUIRE(cli.getIterator() == db.find(9));
- cli.execute("jump", "1");
- REQUIRE(cli.getIterator() == db.find(1));
- }
-
- SECTION("Execute - next") {
- cli.execute("jump", "1");
- REQUIRE(cli.getIterator() == cli.getDb().cbegin());
-
- cli.execute("next", "");
- REQUIRE(cli.getIterator() == db.find(2));
- cli.execute("next", "");
- REQUIRE(cli.getIterator() == db.find(3));
- cli.execute("next", "");
- REQUIRE(cli.getIterator() == db.find(4));
- cli.execute("next", "");
- REQUIRE(cli.getIterator() == db.find(5));
- cli.execute("next", "");
- REQUIRE(cli.getIterator() == db.find(6));
- cli.execute("next", "");
- REQUIRE(cli.getIterator() == db.find(7));
- cli.execute("next", "");
- REQUIRE(cli.getIterator() == db.find(8));
- cli.execute("next", "");
- REQUIRE(cli.getIterator() == db.find(9));
- cli.execute("next", "");
- REQUIRE(cli.getIterator() == db.find(9));
- }
-
- SECTION("Execute - previous") {
- cli.execute("jump", "9");
- REQUIRE(cli.getIterator() == cli.getDb().find(9));
-
- cli.execute("previous", "");
- REQUIRE(cli.getIterator() == db.find(8));
- cli.execute("previous", "");
- REQUIRE(cli.getIterator() == db.find(7));
- cli.execute("previous", "");
- REQUIRE(cli.getIterator() == db.find(6));
- cli.execute("previous", "");
- REQUIRE(cli.getIterator() == db.find(5));
- cli.execute("previous", "");
- REQUIRE(cli.getIterator() == db.find(4));
- cli.execute("previous", "");
- REQUIRE(cli.getIterator() == db.find(3));
- cli.execute("previous", "");
- REQUIRE(cli.getIterator() == db.find(2));
- cli.execute("previous", "");
- REQUIRE(cli.getIterator() == db.find(1));
- cli.execute("previous", "");
- REQUIRE(cli.getIterator() == db.find(1));
- }
-
- SECTION("Execute short - j") {
- cli.execute("j", "2");
- REQUIRE(cli.getIterator() == db.find(2));
- cli.execute("j", "0");
- REQUIRE(cli.getIterator() == db.find(2));
- cli.execute("j", "-1");
- REQUIRE(cli.getIterator() == db.find(2));
- cli.execute("j", "10");
- REQUIRE(cli.getIterator() == db.find(2));
- cli.execute("j", "9");
- REQUIRE(cli.getIterator() == db.find(9));
- cli.execute("j", "9");
- REQUIRE(cli.getIterator() == db.find(9));
- cli.execute("j", "1");
- REQUIRE(cli.getIterator() == db.find(1));
- }
-
- SECTION("Execute short - n") {
- cli.execute("j", "1");
- REQUIRE(cli.getIterator() == cli.getDb().cbegin());
-
- cli.execute("n", "");
- REQUIRE(cli.getIterator() == db.find(2));
- cli.execute("n", "");
- REQUIRE(cli.getIterator() == db.find(3));
- cli.execute("n", "");
- REQUIRE(cli.getIterator() == db.find(4));
- cli.execute("n", "");
- REQUIRE(cli.getIterator() == db.find(5));
- cli.execute("n", "");
- REQUIRE(cli.getIterator() == db.find(6));
- cli.execute("n", "");
- REQUIRE(cli.getIterator() == db.find(7));
- cli.execute("n", "");
- REQUIRE(cli.getIterator() == db.find(8));
- cli.execute("n", "");
- REQUIRE(cli.getIterator() == db.find(9));
- cli.execute("n", "");
- REQUIRE(cli.getIterator() == db.find(9));
- }
-
- SECTION("Execute short - p") {
- cli.execute("j", "9");
- REQUIRE(cli.getIterator() == cli.getDb().find(9));
-
- cli.execute("p", "");
- REQUIRE(cli.getIterator() == db.find(8));
- cli.execute("p", "");
- REQUIRE(cli.getIterator() == db.find(7));
- cli.execute("p", "");
- REQUIRE(cli.getIterator() == db.find(6));
- cli.execute("p", "");
- REQUIRE(cli.getIterator() == db.find(5));
- cli.execute("p", "");
- REQUIRE(cli.getIterator() == db.find(4));
- cli.execute("p", "");
- REQUIRE(cli.getIterator() == db.find(3));
- cli.execute("p", "");
- REQUIRE(cli.getIterator() == db.find(2));
- cli.execute("p", "");
- REQUIRE(cli.getIterator() == db.find(1));
- cli.execute("p", "");
- REQUIRE(cli.getIterator() == db.find(1));
- }
-}
diff --git a/src/Tests/main.cpp b/src/Tests/main.cpp
deleted file mode 100644
index b3143fb..0000000
--- a/src/Tests/main.cpp
+++ /dev/null
@@ -1,2 +0,0 @@
-#define CATCH_CONFIG_MAIN
-#include <catch.hpp>

View file

@ -1 +1 @@
SHA512 (usbguard-notifier-0.1.1.tar.gz) = 5540739301f4f4c83f7443b740cf7345be7928f3ed697878094dee1752eac7dedfab9eb652856bfa555be9bfa24687c4b74194afa022973848af13328f0ca1ba
SHA512 (usbguard-notifier-0.0.6.tar.gz) = 25402ff336ed89c92a2c7824e97a25c59570f6240e2e9c97fd37dabc25ed49ebe7dc051982f4aaff181eb835677ec29cd4e4dfe9efc11f07583ff5cfb92630b0

View file

@ -1,12 +1,11 @@
Name: usbguard-notifier
Version: 0.1.1
Release: 4%{?dist}
Version: 0.0.6
Release: 3%{?dist}
Summary: A tool for detecting usbguard policy and device presence changes
License: GPL-2.0-or-later
License: GPLv2+
URL: https://github.com/Cropi/%{name}
Source0: https://github.com/Cropi/usbguard-notifier/releases/download/%{name}-%{version}/%{name}-%{version}.tar.gz
Patch0: remove-catch.patch
Requires: systemd
@ -17,6 +16,8 @@ BuildRequires: usbguard-devel
BuildRequires: librsvg2-devel
BuildRequires: libnotify-devel
BuildRequires: asciidoc
BuildRequires: catch1-devel
BuildRequires: execstack
BuildRequires: systemd-rpm-macros
%description
@ -25,7 +26,6 @@ as well as device presence changes and displays them as pop-up notifications.
%prep
%setup -q
%patch -P 0 -p1
%build
mkdir -p ./m4
@ -35,14 +35,19 @@ export CXXFLAGS="$RPM_OPT_FLAGS"
%configure \
--disable-silent-rules \
--without-bundled-catch \
--enable-debug-build
%set_build_flags
make %{?_smp_mflags}
%check
make check
%install
make install INSTALL='install -p' DESTDIR=%{buildroot}
execstack -c %{buildroot}%{_bindir}/usbguard-notifier
execstack -c %{buildroot}%{_bindir}/usbguard-notifier-cli
%post
%systemd_user_post %{name}.service
@ -64,60 +69,9 @@ make install INSTALL='install -p' DESTDIR=%{buildroot}
%changelog
* Fri Jul 17 2026 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.1-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_45_Mass_Rebuild
* Sat Jan 17 2026 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.1-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_44_Mass_Rebuild
* Fri Jul 25 2025 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.1-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild
* Thu Apr 24 2025 Attila Lakatos <alakatos@redhat.com> - 0.1.1-1
- Rebase to 0.1.1
- Remove catch dependency
resolves: rhbz#2270438
* Sun Jan 19 2025 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.0-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild
* Sat Jul 20 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.0-5
- Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild
* Sat Jan 27 2024 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.0-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild
* Sat Jul 22 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.0-3
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild
* Sat Jan 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 0.1.0-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
* Tue Dec 20 2022 Attila Lakatos <alakatos@redhat.com> - 0.1.0-1
- Rebase to 0.1.0
* Sat Jul 23 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.6-8
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild
* Sat Jan 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.6-7
- Rebuilt for https://fedoraproject.org/wiki/Fedora_36_Mass_Rebuild
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.6-6
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
* Wed Jun 16 2021 Attila Lakatos <alakatos@redhat.com> - 0.0.6-5
- Merge notifications when inserting a usb device
resolves: rhbz#1972505
* Wed Jan 27 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.6-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_34_Mass_Rebuild
* Fri Jan 15 2021 Radovan Sroka <rsroka@redhat.com> - 0.0.6-3
- Rebuild with the usbguard 1.0.0 - soname bump
* Wed Jul 29 2020 Fedora Release Engineering <releng@fedoraproject.org> - 0.0.6-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_33_Mass_Rebuild
* Wed Apr 29 2020 Attila Lakatos <alakatos@redhat.com> 0.0.6-1
- Rebase to 0.0.6