add patch to support alternate SNAP_MOUNT_DIR in openmamba [release 2.57.4-3mamba;Tue Oct 04 2022]

This commit is contained in:
Silvan Calarco 2024-01-05 17:54:27 +01:00
parent 3ad86df38f
commit e95bf8c2a5
2 changed files with 39 additions and 24 deletions

View File

@ -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()

View File

@ -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 <silvan.calarco@mambasoft.it>
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 <silvan.calarco@mambasoft.it> 2.57.4-3mamba
- add patch to support alternate SNAP_MOUNT_DIR in openmamba
* Sat Oct 01 2022 Silvan Calarco <silvan.calarco@mambasoft.it> 2.57.4-2mamba
- fix libexec dir