diff --git a/.gitignore b/.gitignore index 99cf2d8..2eb0fdc 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,5 @@ /yggdrasil-0.3.2.tar.gz /yggdrasil-0.3.2.tar.xz /yggdrasil-0.4.1.tar.xz +/yggdrasil-0.4.2.tar.xz +/yggdrasil-0.4.4.tar.xz diff --git a/config.toml b/config.toml new file mode 100644 index 0000000..ef438af --- /dev/null +++ b/config.toml @@ -0,0 +1,5 @@ +protocol = "mqtt" +server = ["wss://connect.cloud.redhat.com:443"] +cert-file = "/etc/pki/consumer/cert.pem" +key-file = "/etc/pki/consumer/key.pem" +facts-file = "/var/lib/yggdrasil/canonical-facts.json" diff --git a/sources b/sources index 8c2451b..38dbd7b 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (yggdrasil-0.4.1.tar.xz) = 0329b969b7441363cf376cd8b9adf163e0d7f9ecf89db54128a3d8062c887676ac9903e911397bb6eef84238423705352138e0ff1d1ceec0d088c0514222a2f0 +SHA512 (yggdrasil-0.4.4.tar.xz) = 138df3b4eeb4815fda5d7c60001d75a29596508c9c7de5a0e29aa4b54f4df73024e42cf26f8afcd19671a552199452c81d920873d839044ed1a7f509e6671875 diff --git a/yggdrasil.spec b/yggdrasil.spec index bc85ba7..cf573a0 100644 --- a/yggdrasil.spec +++ b/yggdrasil.spec @@ -2,8 +2,8 @@ # https://github.com/redhatinsights/yggdrasil %global goipath github.com/redhatinsights/yggdrasil -Version: 0.4.1 -%global tag %{version} +Version: 0.4.4 +%global tag v%{version} %gometa -f @@ -21,7 +21,8 @@ Summary: Remote data transmission and processing client License: GPL-3.0-only URL: %{gourl} -Source: %{url}/releases/download/%{version}/yggdrasil-%{version}.tar.xz +Source: %{url}/releases/download/%{tag}/yggdrasil-%{version}.tar.xz +Source1: config.toml BuildRequires: systemd-rpm-macros BuildRequires: meson @@ -31,6 +32,16 @@ BuildRequires: pkgconfig(bash-completion) %description %{common_description} +%package devel +Summary: %{name} development files + +%description devel +%{common_description} + +Contains files needed for yggdrasil worker development. + +%gopkg + %prep %goprep %{?rhel:-k} %autopatch -p1 @@ -44,18 +55,31 @@ BuildRequires: pkgconfig(bash-completion) %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 -Dvendor=True -Ddefault_data_host=cert.cloud.redhat.com -Ddefault_path_prefix=redhat/insights "-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 %meson_install +%__install -m644 %{SOURCE1} %{buildroot}%{_sysconfdir}/%{name}/config.toml %if %{with check} %check %gocheck %endif +%post +%systemd_post %{name}.service +%systemd_user_post %{name}.service + +%preun +%systemd_preun %{name}.service +%systemd_user_preun %{name}.service + +%postun +%systemd_postun_with_restart %{name}.service +%systemd_user_postun_with_restart %{name}.service + %files %license LICENSE %if %{defined rhel} @@ -66,10 +90,14 @@ export %gomodulesmode %config(noreplace) %{_sysconfdir}/%{name} %{_unitdir}/* %{_userunitdir}/* +%{_sysusersdir}/* %{_datadir}/bash-completion/completions/* %{_datadir}/dbus-1/{interfaces,system-services,system.d}/* %{_datadir}/doc/%{name}/* %{_mandir}/man1/* +%files devel +%{_libdir}/pkgconfig/*.pc + %changelog %autochangelog