From e95bf8c2a57e9f49610abd87fe1200f65f7bf9fb Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Fri, 5 Jan 2024 17:54:27 +0100 Subject: [PATCH] add patch to support alternate SNAP_MOUNT_DIR in openmamba [release 2.57.4-3mamba;Tue Oct 04 2022] --- ...d-2.57.4-alternate-dir-add-openmamba.patch | 10 ++++ snapd.spec | 53 ++++++++++--------- 2 files changed, 39 insertions(+), 24 deletions(-) create mode 100644 snapd-2.57.4-alternate-dir-add-openmamba.patch diff --git a/snapd-2.57.4-alternate-dir-add-openmamba.patch b/snapd-2.57.4-alternate-dir-add-openmamba.patch new file mode 100644 index 0000000..8c257cb --- /dev/null +++ b/snapd-2.57.4-alternate-dir-add-openmamba.patch @@ -0,0 +1,10 @@ +--- snapd-2.57.4/dirs/dirs.go.orig 2022-10-04 16:46:26.164783002 +0200 ++++ snapd-2.57.4/dirs/dirs.go 2022-10-04 16:46:35.722735835 +0200 +@@ -347,6 +347,7 @@ + "gentoo", + "manjaro", + "manjaro-arm", ++ "openmamba", + } + + isInsideBase, _ := isInsideBaseSnap() diff --git a/snapd.spec b/snapd.spec index a281bb6..d9a4561 100644 --- a/snapd.spec +++ b/snapd.spec @@ -1,7 +1,7 @@ %define _gourl github.com/snapcore/snapd Name: snapd Version: 2.57.4 -Release: 2mamba +Release: 3mamba Summary: Background service that manages and maintains installed snaps Group: System/Management Vendor: openmamba @@ -9,6 +9,7 @@ Distribution: openmamba Packager: Silvan Calarco URL: https://github.com/snapcore/snapd Source: https://github.com/snapcore/snapd/releases/download/%{version}/%{name}_%{version}.vendor.tar.xz +Patch0: snapd-2.57.4-alternate-dir-add-openmamba.patch License: GPL ## AUTOBUILDREQ-BEGIN BuildRequires: glibc-devel @@ -29,6 +30,8 @@ Snaps are app packages for desktop, cloud and IoT that update automatically, are %setup -q #-D -T #:<< _EOF +%patch0 -p1 + export GOPATH=${PWD}/go mkdir -p ${GOPATH} @@ -38,10 +41,6 @@ mkdir -p ${GOPATH} mkdir -p ${GOPATH}/src/github.com/snapcore ln --no-target-directory -fs ${PWD} ${GOPATH}/src/github.com/snapcore/snapd -cd cmd -./autogen.sh -cd .. - # Fix source dir cleanup chmod -R +w go @@ -63,6 +62,28 @@ export CGO_LDFLAGS="${LDFLAGS}" ./mkversion.sh %{version}-%{release} +# Generate data files such as real systemd units, dbus service, environment +# setup helpers out of the available templates +make -C data \ + BINDIR=%{_bindir} \ + LIBEXECDIR=%{_prefix}/lib \ + SYSTEMDSYSTEMUNITDIR=%{_unitdir} \ + SNAP_MOUNT_DIR=/var/lib/snapd/snap \ + SNAPD_ENVIRONMENT_FILE=%{_sysconfdir}/default/snapd + +cd cmd +# Don't move autoreconf in prepare +autoreconf -f -i +%configure \ + --libexecdir=%{_prefix}/lib/snapd \ + --with-snap-mount-dir=/var/lib/snapd/snap \ + --enable-apparmor \ + --enable-nvidia-biarch \ + --enable-merged-usr + +%make +cd .. + # because argument expansion with quoting in bash is hard, and -ldflags=-extldflags='-foo' # is not exactly the same as -ldflags "-extldflags '-foo'" use the array trick # to pass exactly what we want @@ -80,25 +101,6 @@ go build "${staticflags[@]}" -o ${GOPATH}/bin/snap-update-ns $GOFLAGS %{_gourl}/ go build "${staticflags[@]}" -o ${GOPATH}/bin/snap-exec $GOFLAGS %{_gourl}/cmd/snap-exec go build "${staticflags[@]}" -o ${GOPATH}/bin/snapctl $GOFLAGS %{_gourl}/cmd/snapctl -# Generate data files such as real systemd units, dbus service, environment -# setup helpers out of the available templates -make -C data \ - BINDIR=%{_bindir} \ - LIBEXECDIR=%{_prefix}/lib \ - SYSTEMDSYSTEMUNITDIR=%{_unitdir} \ - SNAP_MOUNT_DIR=/var/lib/snapd/snap \ - SNAPD_ENVIRONMENT_FILE=%{_sysconfdir}/default/snapd - -cd cmd -%configure \ - --libexecdir=%{_prefix}/lib/snapd \ - --with-snap-mount-dir=/var/lib/snapd/snap \ - --enable-apparmor \ - --enable-nvidia-biarch \ - --enable-merged-usr - -%make - %install [ "%{buildroot}" != / ] && rm -rf "%{buildroot}" @@ -242,6 +244,9 @@ rm -fv %{buildroot}%{_prefix}/lib/snapd/system-shutdown %doc COPYING %changelog +* Tue Oct 04 2022 Silvan Calarco 2.57.4-3mamba +- add patch to support alternate SNAP_MOUNT_DIR in openmamba + * Sat Oct 01 2022 Silvan Calarco 2.57.4-2mamba - fix libexec dir