aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNoel Kuntze <noel.kuntze@thermi.consulting>2022-10-20 20:20:45 +0200
committerpsykose <alice@ayaya.dev>2022-10-22 10:36:35 +0200
commit5c4472aa0f553261f8b124350f4d68e39c386566 (patch)
tree5170f32a92990a9bf88b90a6fa2d35fc1ad01de3
parent0b9edfc85c9193b2320a6b7c3b5a21bb8916f012 (diff)
downloadaports-5c4472aa0f553261f8b124350f4d68e39c386566.tar.gz
aports-5c4472aa0f553261f8b124350f4d68e39c386566.tar.bz2
aports-5c4472aa0f553261f8b124350f4d68e39c386566.tar.xz
testing/certmonger: new aport
Certificate status monitor and PKI enrollment client https://pagure.io/certmonger"
-rw-r--r--testing/certmonger/0001-ns-name-ntop-fix.patch20
-rw-r--r--testing/certmonger/0002-fix-unistd-for-musl.patch12
-rw-r--r--testing/certmonger/0003-tests-fix-addition-of-test-40.patch25
-rw-r--r--testing/certmonger/0004-tests-use-better-Makefile-integration-of-test-runnin.patch41
-rw-r--r--testing/certmonger/APKBUILD102
-rw-r--r--testing/certmonger/certmonger.confd7
-rw-r--r--testing/certmonger/certmonger.initd11
7 files changed, 218 insertions, 0 deletions
diff --git a/testing/certmonger/0001-ns-name-ntop-fix.patch b/testing/certmonger/0001-ns-name-ntop-fix.patch
new file mode 100644
index 00000000000..cf0621efa14
--- /dev/null
+++ b/testing/certmonger/0001-ns-name-ntop-fix.patch
@@ -0,0 +1,20 @@
+diff -ruN a/src/srvloc.c b/src/srvloc.c
+--- a/src/srvloc.c 2022-09-08 21:53:25.455053569 +0200
++++ b/src/srvloc.c 2022-09-08 22:07:54.489137678 +0200
+@@ -229,9 +229,14 @@
+ res[j].weight = ntohs(*(uint16_t *)(rr.rdata + 2));
+ res[j].port = ntohs(*(uint16_t *)(rr.rdata + 4));
+ memcpy(res[j].host, rr.rdata + 6, rr.rdlength - 6);
+- if (ns_name_ntop(rr.rdata + 6, res[j].host, answer_len) == -1) {
+- continue;
++ //if (ns_name_ntop(rr.rdata + 6, res[j].host, answer_len) == -1) {
++ // continue;
++ //}
++ if (ns_name_uncompress(ns_msg_base(msg), ns_msg_end(msg),
++ rr.rdata + 6, res[j].host, sizeof(res[j].host))) {
++ continue;
+ }
++
+ res[j].host[answer_len] = '\0';
+ j++;
+ }
diff --git a/testing/certmonger/0002-fix-unistd-for-musl.patch b/testing/certmonger/0002-fix-unistd-for-musl.patch
new file mode 100644
index 00000000000..0919096b8fc
--- /dev/null
+++ b/testing/certmonger/0002-fix-unistd-for-musl.patch
@@ -0,0 +1,12 @@
+diff -ruN a/tests/tools/addcinfo.c b/tests/tools/addcinfo.c
+--- a/tests/tools/addcinfo.c 2022-09-08 22:19:15.740092743 +0200
++++ b/tests/tools/addcinfo.c 2022-09-08 22:20:13.451034134 +0200
+@@ -18,7 +18,7 @@
+ #include "../../src/config.h"
+
+ #include <sys/types.h>
+-#include <sys/unistd.h>
++/* #include <sys/unistd.h> */
+ #include <stdio.h>
+ #include <string.h>
+ #include <unistd.h>
diff --git a/testing/certmonger/0003-tests-fix-addition-of-test-40.patch b/testing/certmonger/0003-tests-fix-addition-of-test-40.patch
new file mode 100644
index 00000000000..8cfca960c6c
--- /dev/null
+++ b/testing/certmonger/0003-tests-fix-addition-of-test-40.patch
@@ -0,0 +1,25 @@
+From 9f210db331a0627bad8efc86a922fd2a0b982156 Mon Sep 17 00:00:00 2001
+From: Noel Kuntze <noel.kuntze@thermi.consulting>
+Date: Wed, 19 Oct 2022 22:10:59 +0200
+Subject: [PATCH 3/4] tests: fix addition of test 40
+
+---
+ tests/Makefile.am | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index e20b6d8f..a85c81a6 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -131,7 +131,7 @@ CLEANFILES = \
+ 038-ms-v2-template/actual.out \
+ 038-ms-v2-template/actual.err \
+ 039-fromfile/actual.out \
+- 039-fromfile/actual.err
++ 039-fromfile/actual.err \
+ 040-pem/actual.out \
+ 040-pem/actual.err
+ EXTRA_DIST = \
+--
+2.38.1
+
diff --git a/testing/certmonger/0004-tests-use-better-Makefile-integration-of-test-runnin.patch b/testing/certmonger/0004-tests-use-better-Makefile-integration-of-test-runnin.patch
new file mode 100644
index 00000000000..242641ec532
--- /dev/null
+++ b/testing/certmonger/0004-tests-use-better-Makefile-integration-of-test-runnin.patch
@@ -0,0 +1,41 @@
+From 74551e7970b463aeda2deebe3777e31be78150b1 Mon Sep 17 00:00:00 2001
+From: Noel Kuntze <noel.kuntze@thermi.consulting>
+Date: Wed, 19 Oct 2022 22:26:08 +0200
+Subject: [PATCH 4/4] tests: use better Makefile integration of test running
+
+---
+ tests/Makefile.am | 19 +++++++++++--------
+ 1 file changed, 11 insertions(+), 8 deletions(-)
+
+diff --git a/tests/Makefile.am b/tests/Makefile.am
+index a85c81a6..32eb363e 100644
+--- a/tests/Makefile.am
++++ b/tests/Makefile.am
+@@ -434,13 +434,16 @@ subdirs += \
+ endif
+
+ check: all
+- if [ ! -e $$HOME/.rnd ] ; then \
+- openssl rand -writerand $$HOME/.rnd; \
++ RANDFILE=$(top_builddir)/.rnd
++ if [ ! -e $(top_builddir)/.rnd ] ; then \
++ openssl rand -writerand $(top_builddir)/.rnd; \
+ fi
+ for required in certutil cmsutil pk12util openssl diff cmp mktemp \
+- dos2unix unix2dos dbus-launch ; do \
+- which $$required || exit 1; \
+- done
+- env srcdir=$(srcdir) \
+- builddir=$(top_builddir)/tests \
+- $(srcdir)/run-tests.sh $(subdirs)
++ dos2unix unix2dos dbus-launch; do \
++ if ! command -v $$required >/dev/null; then \
++ echo $$required required but not available;\
++ exit 1; \
++ fi \
++ done;\
++ env;\
++ RANDFILE=$(top_builddir)/.rnd srcdir=$(srcdir) builddir=$(top_builddir)/tests ./run-tests.sh $(subdirs)
+--
+2.38.1
+
diff --git a/testing/certmonger/APKBUILD b/testing/certmonger/APKBUILD
new file mode 100644
index 00000000000..700c8cd0401
--- /dev/null
+++ b/testing/certmonger/APKBUILD
@@ -0,0 +1,102 @@
+# Contributor: Noel Kuntze <noel.kuntze@thermi.consulting>
+# Maintainer: Noel Kuntze <noel.kuntze@thermi.consulting>
+pkgname=certmonger
+pkgver=0.79.16
+pkgrel=0
+pkgdesc="Certificate status monitor and PKI enrollment client"
+url="https://pagure.io/certmonger"
+arch="all"
+license="GPL-3.0-or-later"
+depends="
+ gettext
+ "
+makedepends="
+ autoconf
+ automake
+ curl-dev
+ dbus-dev
+ gettext-dev
+ gmp-dev
+ krb5-dev
+ jansson-dev
+ libidn2-dev
+ libtool
+ libxml2-dev
+ nspr-dev
+ nss-dev
+ openldap-dev
+ popt-dev
+ rpm
+ talloc-dev
+ tevent-dev
+ "
+checkdepends="
+ bash
+ dbus-x11
+ diffutils
+ dos2unix
+ expect
+ nss-tools
+ openssl
+ py3-dbus
+ "
+subpackages="$pkgname-openrc $pkgname-doc"
+source="$pkgname-$pkgver.tar.gz::https://pagure.io/certmonger/archive/certmonger-$pkgver/certmonger-certmonger-$pkgver.tar.gz
+ 0001-ns-name-ntop-fix.patch
+ 0002-fix-unistd-for-musl.patch
+ 0003-tests-fix-addition-of-test-40.patch
+ 0004-tests-use-better-Makefile-integration-of-test-runnin.patch
+ certmonger.initd
+ certmonger.confd
+ "
+
+builddir="$srcdir/certmonger-certmonger-$pkgver"
+prepare() {
+ default_prepare
+ autoreconf -vif
+}
+
+build() {
+ #LDFLAGS="$LDFLAGS -lintl" \
+ ./configure \
+ --build=$CBUILD \
+ --host=$CHOST \
+ --prefix=/usr \
+ --sysconfdir=/etc \
+ --sbindir=/usr/bin \
+ --localstatedir=/var \
+ --disable-nls \
+ --disable-systemd \
+ --disable-sysvinit \
+ --disable-tmpfiles \
+ --with-uuid \
+ --with-gmp \
+ --disable-dependency-tracking
+ make
+}
+
+check() {
+ # Disable failing checks for now - possibly they fail due to musl libc
+ mv tests/008-certread/run.sh tests/008-certread/norun.sh
+ mv tests/027-hooks/run.sh tests/027-hooks/norun.sh
+ mv tests/030-rekey/run.sh tests/030-rekey/norun.sh
+ mv tests/031-pkcs7/run.sh tests/031-pkcs7/norun.sh
+ make check
+}
+
+package() {
+ make -j1 DESTDIR="$pkgdir" install
+ #install -D -m644 $pkgname.8 -t "$pkgdir"/usr/share/man/man8
+ install -Dm755 "$srcdir/$pkgname.initd" "$pkgdir/etc/init.d/$pkgname"
+ install -Dm644 "$srcdir/$pkgname.confd" "$pkgdir/etc/conf.d/$pkgname"
+}
+
+sha512sums="
+39523ef6d29b6a5efcaeefde68f207d1a7241cfec5d5ee0bf1d4ec99c815fe4d7e8c87c96f33375b6f6c8c0f3aabfb999dd370fdb63d5b401200b86e7c089ce1 certmonger-0.79.16.tar.gz
+d14e2bb583869687f3a107df9cd58071a98567267a3726b4082061c7b988bcf831090aeb8d087488048a7201c3aeaca6e1a7dc63a0c30dc01c73745b8c5c5563 0001-ns-name-ntop-fix.patch
+a603e056f91604943f55da577f8991ea33e6a890c75913a66dfcf4d64447ebc65715e7b0f9eac45246af3827dd2cd658ed9e291f20c5fa0182bb00e1a7919e9e 0002-fix-unistd-for-musl.patch
+5294cedd25ae607e9ccc941db1a080bc2e19484c98a72c3a8570aa2e35731a48fba60c3cfb652c0ad2c929ae85e187a017dbbf59d4e9f28a5b132c03698f3ba8 0003-tests-fix-addition-of-test-40.patch
+e2338f5c3505b54d1c1d2e42ca269688fac4c0b62bd40fadf262d942bb134e722897b7d2767db5fd5c266a512a7c93ad00a2dd74fff619ae941ee1b9b5c0261b 0004-tests-use-better-Makefile-integration-of-test-runnin.patch
+2c0cee6b5bcd5a34eb9580c84881a58b48bd0fb21ea94b57f1936b1c7fae9f943edc69561e9df4c8b3c71347914a130ffb9a9cb8e71ccbdf970f55186c17e9e1 certmonger.initd
+c6c819f5d153c24606ce4b888fde68afe8791e4fbadb08217a58ef6def680b6d44d6ff120da7279817f79d44372d0bec80dce6c68cd5abbbef164239bb6eb37f certmonger.confd
+"
diff --git a/testing/certmonger/certmonger.confd b/testing/certmonger/certmonger.confd
new file mode 100644
index 00000000000..8de9e437706
--- /dev/null
+++ b/testing/certmonger/certmonger.confd
@@ -0,0 +1,7 @@
+# /etc/conf.d/certmonger
+
+# Options to pass to the certmonger process
+# Most people should leave this line alone ...
+# however, if you know what you're doing, feel free to tweak
+CM_OPTS=""
+
diff --git a/testing/certmonger/certmonger.initd b/testing/certmonger/certmonger.initd
new file mode 100644
index 00000000000..a65823bba52
--- /dev/null
+++ b/testing/certmonger/certmonger.initd
@@ -0,0 +1,11 @@
+#!/sbin/openrc-run
+description="Certificate monitor and PKI enrollment client"
+pidfile=/run/certmonger.pid
+command="/usr/bin/certmonger"
+command_args="-S -p $pidfile $CM_OPTS"
+
+depend() {
+ need dbus
+ use net
+}
+