aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichał Polański <michal@polanski.me>2020-10-17 20:23:28 +0200
committerLeo <thinkabit.ukim@gmail.com>2020-10-18 01:00:32 +0000
commit8ddb0394731e38327b8e6fb1c6954caa68561ed7 (patch)
tree9b12a0dc454dc0c3544c3eb97f621276e73f92d9
parent5698399a5b536869c8cd4a9a10e329ad879ba6d1 (diff)
downloadaports-8ddb0394731e38327b8e6fb1c6954caa68561ed7.tar.gz
aports-8ddb0394731e38327b8e6fb1c6954caa68561ed7.tar.bz2
aports-8ddb0394731e38327b8e6fb1c6954caa68561ed7.tar.xz
testing/usbguard-notifier: new aport
Notifies on USBGuard policy and device presence changes https://github.com/Cropi/usbguard-notifier
-rw-r--r--testing/usbguard-notifier/APKBUILD48
-rw-r--r--testing/usbguard-notifier/no-systemd.patch93
2 files changed, 141 insertions, 0 deletions
diff --git a/testing/usbguard-notifier/APKBUILD b/testing/usbguard-notifier/APKBUILD
new file mode 100644
index 0000000000..91c69fe573
--- /dev/null
+++ b/testing/usbguard-notifier/APKBUILD
@@ -0,0 +1,48 @@
+# Contributor: Michał Polański <michal@polanski.me>
+# Maintainer: Michał Polański <michal@polanski.me>
+pkgname=usbguard-notifier
+pkgver=0.0.6
+pkgrel=0
+pkgdesc="Notifies on USBGuard policy and device presence changes"
+url="https://github.com/Cropi/usbguard-notifier"
+license="GPL-2.0-or-later"
+arch="all !s390x !mips !mips64" # limited by librsvg
+makedepends="
+ autoconf
+ automake
+ libtool
+ usbguard-dev
+ librsvg-dev
+ libnotify-dev
+ catch2
+ asciidoc
+ "
+subpackages="$pkgname-doc"
+source="$pkgname-$pkgver.tar.gz::https://github.com/Cropi/usbguard-notifier/archive/usbguard-notifier-$pkgver.tar.gz
+ no-systemd.patch"
+builddir="$srcdir/$pkgname-$pkgname-$pkgver"
+
+prepare() {
+ default_prepare
+ sed -i "s#/usr/include/catch#/usr/include/catch2#g" configure.ac
+ autoreconf -fiv
+}
+
+check() {
+ make check
+}
+
+build() {
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr
+ make
+}
+
+package() {
+ make install DESTDIR="$pkgdir"
+}
+
+sha512sums="521b1cba292a5a1663bb36aad07d73ab1fae729da0a56794b34261c1b848366bac3637018c1cd371332f9d42bc73d5ba3c3b1ae0584cbc5bd9af1bb16a3a0599 usbguard-notifier-0.0.6.tar.gz
+09ca4890884d0a62d1b152c6cc5120c9856f46b778cba6f3d36a831ad6f0e5e6651e4e5532e8cefbc55583b862af4c649e6299591fed66b4c9187f7e4f363f85 no-systemd.patch"
diff --git a/testing/usbguard-notifier/no-systemd.patch b/testing/usbguard-notifier/no-systemd.patch
new file mode 100644
index 0000000000..8244796a3c
--- /dev/null
+++ b/testing/usbguard-notifier/no-systemd.patch
@@ -0,0 +1,93 @@
+Reason: Remove installation of systemd service file
+Upstream: No
+
+diff --git a/Makefile.am b/Makefile.am
+index dc4174f..e9011fe 100644
+--- a/Makefile.am
++++ b/Makefile.am
+@@ -112,33 +112,6 @@ EXTRA_DIST += \
+ .svg.o:
+ $(LD) -r -b binary -o $@ $<
+
+-#
+-# unit file
+-#
+-install-data-hook: install-systemd-service
+-uninstall-hook: uninstall-systemd-service
+-
+-CLEANFILES += $(top_builddir)/usbguard-notifier.service
+-
+-#
+-# Notifier service
+-#
+-EXTRA_DIST += \
+- $(top_srcdir)/usbguard-notifier.service.in
+-
+-usbguard-notifier.service: $(top_srcdir)/usbguard-notifier.service.in
+- $(SED) -e "s|%bindir%|${bindir}|" $^ > $@ || rm -f $@
+-
+-install-systemd-service: $(top_builddir)/usbguard-notifier.service
+- $(MKDIR_P) $(DESTDIR)$(SYSTEMD_UNIT_DIR)
+- $(INSTALL) -m 644 $(top_builddir)/usbguard-notifier.service \
+- $(DESTDIR)$(SYSTEMD_UNIT_DIR)/usbguard-notifier.service
+-
+-uninstall-systemd-service:
+- rm -f $(DESTDIR)$(SYSTEMD_UNIT_DIR)/usbguard-notifier.service
+-
+-CLEANFILES += $(top_builddir)/usbguard-notifier.service
+-
+ #
+ # Common defines
+ #
+diff --git a/configure.ac b/configure.ac
+index 42dd859..25461cf 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -81,16 +81,6 @@ AC_ARG_ENABLE([notifier-cli],
+ [notifier_cli_enabled=yes]
+ )
+
+-AC_ARG_ENABLE([systemd-systemunitdir],
+- [AC_HELP_STRING([--enable-systemd-systemunitdir], [enable systemd system unit dir(default=no)])],
+- [case "${enableval}" in
+- yes) systemd_systemunitdir=yes;;
+- no) systemd_systemunitdir=no;;
+- *) AC_MSG_ERROR([bad value ${enableval} for --enable-systemd-systemunitdir]) ;;
+- esac],
+- [systemd_systemunitdir=no]
+-)
+-
+ # librsvg2
+ PKG_CHECK_MODULES(
+ [rsvg],
+@@ -113,20 +103,6 @@ if test -z "$A2X"; then
+ AC_MSG_FAILURE([Cannot detect documentation generator (asciidoc / a2x)])
+ fi
+
+-# systemd
+-if test "x$systemd_systemunitdir" = xyes; then
+- systemd_unit_dir="`$PKG_CONFIG systemd --variable=systemdsystemunitdir`"
+-else
+- systemd_unit_dir="`$PKG_CONFIG systemd --variable=systemduserunitdir`"
+-fi
+-
+-if test "x$systemd_unit_dir" = x; then
+- AC_MSG_FAILURE([Cannot detect the systemd system unit dir])
+-fi
+-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]),
+@@ -189,9 +165,6 @@ AC_CONFIG_FILES([
+
+ AC_OUTPUT
+
+-echo ""
+-echo "============== MACROS ================="
+-echo " systemd: $systemd_unit_dir"
+ echo ""
+ echo "========== LINKER OPTIONS ============="
+ echo " Catch: $catch_summary"