diff --git a/packages/client/yggdrasil/Propagate-FOREMAN_REX_WORKDIR-to-workers.patch b/packages/client/yggdrasil/Propagate-FOREMAN_REX_WORKDIR-to-workers.patch deleted file mode 100644 index f2108065a9..0000000000 --- a/packages/client/yggdrasil/Propagate-FOREMAN_REX_WORKDIR-to-workers.patch +++ /dev/null @@ -1,27 +0,0 @@ -From b8e4bbd37ef3ab902adfca3f0b9fbc8059f4b0fa Mon Sep 17 00:00:00 2001 -From: Adam Ruzicka -Date: Tue, 19 Sep 2023 16:17:07 +0200 -Subject: [PATCH] Propagate FOREMAN_REX_WORKDIR to workers - ---- - cmd/yggd/main.go | 4 ++++ - 1 file changed, 4 insertions(+) - -diff --git a/cmd/yggd/main.go b/cmd/yggd/main.go -index 5c8aebc..721ed16 100644 ---- a/cmd/yggd/main.go -+++ b/cmd/yggd/main.go -@@ -377,6 +377,10 @@ func main() { - "YGG_SOCKET_ADDR=unix:" + c.String("socket-addr"), - "PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin", - } -+ foremanYggWorkerDir, foremanYggWorkerDirP := os.LookupEnv("FOREMAN_YGG_WORKER_WORKDIR") -+ if foremanYggWorkerDirP { -+ env = append(env, "FOREMAN_YGG_WORKER_WORKDIR="+foremanYggWorkerDir) -+ } - for _, info := range fileInfos { - if strings.HasSuffix(info.Name(), "worker") { - if ExcludeWorkers[info.Name()] { --- -2.39.3 - diff --git a/packages/client/yggdrasil/Use-gzip-c-instead-of-k.patch b/packages/client/yggdrasil/Use-gzip-c-instead-of-k.patch deleted file mode 100644 index 812f152c13..0000000000 --- a/packages/client/yggdrasil/Use-gzip-c-instead-of-k.patch +++ /dev/null @@ -1,25 +0,0 @@ -From 975b142e53608f3b218ee964bd28e1f4dfdde335 Mon Sep 17 00:00:00 2001 -From: Link Dupont -Date: Fri, 14 May 2021 14:54:44 -0400 -Subject: [PATCH] build: Use gzip -c instead of -k - -The '-k' option was added in a later version of gzip. - -Signed-off-by: Link Dupont ---- - Makefile | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/Makefile b/Makefile -index 2cf6b88..0bc0efc 100644 ---- a/Makefile -+++ b/Makefile -@@ -95,7 +95,7 @@ data: $(DATA) - go run $(BUILDFLAGS) -ldflags "$(LDFLAGS)" ./cmd/$(patsubst %.1,%,$@) --generate-man-page > $@ - - %.1.gz: %.1 -- gzip -k $^ -+ gzip -c $^ > $@.tmp && mv $@.tmp $@ - - %-USAGE.md: $(GOSRC) - go run $(BUILDFLAGS) -ldflags "$(LDFLAGS)" ./cmd/$(patsubst %-USAGE.md,%,$@) --generate-markdown > $@ diff --git a/packages/client/yggdrasil/build-Remove-the-Makefile-preamble.patch b/packages/client/yggdrasil/build-Remove-the-Makefile-preamble.patch deleted file mode 100644 index bb503b93a0..0000000000 --- a/packages/client/yggdrasil/build-Remove-the-Makefile-preamble.patch +++ /dev/null @@ -1,27 +0,0 @@ -From 56f26e01049ddfad13ded0edbbf5c60a3246720d Mon Sep 17 00:00:00 2001 -From: Link Dupont -Date: Fri, 14 May 2021 14:55:06 -0400 -Subject: [PATCH] build: Remove the Makefile preamble - -Signed-off-by: Link Dupont ---- - Makefile | 9 --------- - 1 file changed, 9 deletions(-) - -diff --git a/Makefile b/Makefile -index 0bc0efc..f1f4380 100644 ---- a/Makefile -+++ b/Makefile -@@ -1,12 +1,3 @@ --SHELL := bash --.ONESHELL: --.SHELLFLAGS := -eu -o pipefail -c --.DELETE_ON_ERROR: --MAKEFLAGS += --warn-undefined-variables --MAKEFLAGS += --no-builtin-rules --.POSIX: --.SUFFIXES: -- - # Project variables - - # Used as a prefix to binary names. Cannot contain spaces. diff --git a/packages/client/yggdrasil/yggdrasil-0.2.3.tar.gz b/packages/client/yggdrasil/yggdrasil-0.2.3.tar.gz deleted file mode 120000 index 3d4d55405a..0000000000 --- a/packages/client/yggdrasil/yggdrasil-0.2.3.tar.gz +++ /dev/null @@ -1 +0,0 @@ -../../../.git/annex/objects/80/2G/SHA256E-s16763463--acf4edb2e85648352dcd4bf3431eba93476ba8d4b9d7847a661462e85525ef98.tar.gz/SHA256E-s16763463--acf4edb2e85648352dcd4bf3431eba93476ba8d4b9d7847a661462e85525ef98.tar.gz \ No newline at end of file diff --git a/packages/client/yggdrasil/yggdrasil-0.4.1.tar.xz b/packages/client/yggdrasil/yggdrasil-0.4.1.tar.xz new file mode 120000 index 0000000000..34d36145f5 --- /dev/null +++ b/packages/client/yggdrasil/yggdrasil-0.4.1.tar.xz @@ -0,0 +1 @@ +../../../.git/annex/objects/37/xz/SHA256E-s866960--59051fe3cc2b4e98e648095beebaab07f11ae913e045cb10f88ae79edef97e7f.tar.xz/SHA256E-s866960--59051fe3cc2b4e98e648095beebaab07f11ae913e045cb10f88ae79edef97e7f.tar.xz \ No newline at end of file diff --git a/packages/client/yggdrasil/yggdrasil.spec b/packages/client/yggdrasil/yggdrasil.spec index 8fd0fdc019..a8a07489eb 100644 --- a/packages/client/yggdrasil/yggdrasil.spec +++ b/packages/client/yggdrasil/yggdrasil.spec @@ -1,91 +1,84 @@ -%define debug_package %{nil} +%bcond_without check -Name: yggdrasil -Version: 0.2.3 -Release: 3%{?dist} -Summary: Message dispatch agent for cloud-connected systems -License: GPL-3.0-only -URL: https://github.com/redhatinsights/yggdrasil +# https://github.com/redhatinsights/yggdrasil +%global goipath github.com/redhatinsights/yggdrasil +Version: 0.4.1 +%global tag %{version} -Source0: https://github.com/redhatinsights/%{name}/releases/download/%{version}/%{name}-%{version}.tar.gz +%gometa -f -Patch0: Use-gzip-c-instead-of-k.patch -Patch1: build-Remove-the-Makefile-preamble.patch -Patch2: Propagate-FOREMAN_REX_WORKDIR-to-workers.patch +%global common_description %{expand: +yggdrasil is a system daemon that subscribes to topics on an MQTT broker and +routes any data received on the topics to an appropriate child "worker" process, +exchanging data with its worker processes through a D-Bus message broker.} -# EL7 doesn't define go_arches -%if ! 0%{?go_arches:1} -%define go_arches %{ix86} x86_64 %{arm} aarch64 ppc64le -%endif -ExclusiveArch: %{go_arches} - -BuildRequires: git -%if 0%{?suse_version} -BuildRequires: dbus-1-devel -BuildRequires: go -# see https://lists.opensuse.org/archives/list/bugs@lists.opensuse.org/message/Q5R6VVHE5ZCP75XI3MB2B7EXNWXAY2P4/ -BuildRequires: systemd -%else -BuildRequires: dbus-devel -BuildRequires: golang -%endif -BuildRequires: systemd-devel +%global golicenses LICENSE +%global godocs CONTRIBUTING.md README.md + +Name: yggdrasil +Release: 1%{?dist} +Summary: Remote data transmission and processing client + +License: GPL-3.0-only +URL: %{gourl} +Source: %{url}/releases/download/%{version}/yggdrasil-%{version}.tar.xz + +BuildRequires: systemd-rpm-macros +BuildRequires: meson +BuildRequires: pkgconfig(dbus-1) +BuildRequires: pkgconfig(systemd) +BuildRequires: pkgconfig(bash-completion) -Requires: subscription-manager +%description %{common_description} -%description -%{name} is pair of utilities that register systems with RHSM and establishes -a receiving queue for instructions to be sent to the system via a broker. +%gopkg %prep -%autosetup -p1 +%goprep %{?rhel:-k} +%autopatch -p1 -%global ldflags %{expand:-linkmode=external -compressdwarf=false -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags'} -%global buildflags %{expand:-compiler gc -buildmode pie -tags=\\"rpm_crashtraceback libtrust_openssl\\" -ldflags \\"%ldflags\\" -a -v -x %{?**}} +%if %{undefined rhel} +%generate_buildrequires +%go_generate_buildrequires +%endif %build -CGO_CPPFLAGS="-D_FORTIFY_SOURCE=2 -fstack-protector-all" \ -BUILDFLAGS="%buildflags" \ -make PREFIX=%{_prefix} \ - SYSCONFDIR=%{_sysconfdir} \ - LOCALSTATEDIR=%{_localstatedir} \ - LIBEXECDIR=%{_libexecdir} \ - SHORTNAME=%{name} \ - LONGNAME=%{name} \ - PKGNAME=%{name} \ - VERSION=%{version} +%undefine _auto_set_build_flags +export %gomodulesmode +%{?gobuilddir:export GOPATH="%{gobuilddir}:${GOPATH:+${GOPATH}:}%{?gopath}"} +%meson "-Dgobuildflags=[%(echo %{expand:%gocompilerflags} | sed -e s/"^"/"'"/ -e s/" "/"', '"/g -e s/"$"/"'"/), '-tags', '"rpm_crashtraceback\ ${BUILDTAGS:-}"', '-a', '-v', '-x']" -Dgoldflags='%{?currentgoldflags} -B 0x%(head -c20 /dev/urandom|od -An -tx1|tr -d " \n") -compressdwarf=false -linkmode=external -extldflags "%{build_ldflags} %{?__golang_extldflags}"' +%meson_build +%global gosupfiles ./ipc/com.redhat.Yggdrasil1.Dispatcher1.xml ./ipc/com.redhat.Yggdrasil1.Worker1.xml %install -CGO_CPPFLAGS="-D_FORTIFY_SOURCE=2 -fstack-protector-all" \ -BUILDFLAGS="%buildflags" \ -make PREFIX=%{_prefix} \ - SYSCONFDIR=%{_sysconfdir} \ - LOCALSTATEDIR=%{_localstatedir} \ - LIBEXECDIR=%{_libexecdir} \ - DESTDIR=%{buildroot} \ - SHORTNAME=%{name} \ - LONGNAME=%{name} \ - PKGNAME=%{name} \ - VERSION=%{version} \ - install +%meson_install +%gopkginstall + +%if %{with check} +%check +%gocheck +%endif %files -%if 0%{?suse_version} -%dir %{_sysconfdir}/%{name} +%license LICENSE +%if %{defined rhel} +%license vendor/modules.txt %endif -%doc README.md -%{_bindir}/%{name} -%{_sbindir}/%{name}d -%config(noreplace) %{_sysconfdir}/%{name}/config.toml -%{_unitdir}/%{name}d.service +%doc CONTRIBUTING.md README.md +%{_bindir}/* +%config(noreplace) %{_sysconfdir}/%{name} +%{_unitdir}/* +%{_userunitdir}/* %{_datadir}/bash-completion/completions/* +%{_datadir}/dbus-1/{interfaces,system-services,system.d}/* +%{_datadir}/doc/%{name}/* %{_mandir}/man1/* -%exclude %{_prefix}/share/pkgconfig/%{name}.pc -%{_libexecdir}/%{name} + +%gopkgfiles %changelog -* Tue Oct 15 2024 Adam Ruzicka - 0.2.3-3 -- Exclude pkgconf definition file +* Mon Apr 15 2024 Link Dupont - 0.4.1-1 +- Initial package (RHEL-29800) * Mon Mar 11 2024 Markus Bucher - 0.2.3-2 - Fixes for opensuse build service