Skip to content

Commit

Permalink
Bump yggdrasil to 0.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
adamruzicka committed Oct 30, 2024
1 parent 955d6c2 commit d89862d
Show file tree
Hide file tree
Showing 6 changed files with 65 additions and 148 deletions.

This file was deleted.

25 changes: 0 additions & 25 deletions packages/client/yggdrasil/Use-gzip-c-instead-of-k.patch

This file was deleted.

27 changes: 0 additions & 27 deletions packages/client/yggdrasil/build-Remove-the-Makefile-preamble.patch

This file was deleted.

1 change: 0 additions & 1 deletion packages/client/yggdrasil/yggdrasil-0.2.3.tar.gz

This file was deleted.

1 change: 1 addition & 0 deletions packages/client/yggdrasil/yggdrasil-0.4.1.tar.xz
132 changes: 64 additions & 68 deletions packages/client/yggdrasil/yggdrasil.spec
Original file line number Diff line number Diff line change
@@ -1,91 +1,87 @@
%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/[email protected]/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: 2%{?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 <[email protected]> - 0.2.3-3
- Exclude pkgconf definition file
* Thu Sep 5 2024 Link Dupont <[email protected]> - 0.4.1-2
- Rebuild for RHEL-47192

* Mon Apr 15 2024 Link Dupont <[email protected]> - 0.4.1-1
- Initial package (RHEL-29800)

* Mon Mar 11 2024 Markus Bucher <[email protected]> - 0.2.3-2
- Fixes for opensuse build service
Expand Down

0 comments on commit d89862d

Please sign in to comment.