[packages/snapd] put inline scripts separately under vcs control

glen glen at pld-linux.org
Sun Jun 25 11:32:40 CEST 2017


commit 98f266a54fd465d01a9c6db265701ed1232f9649
Author: Elan Ruusamäe <glen at pld-linux.org>
Date:   Sun Jun 25 12:32:03 2017 +0300

    put inline scripts separately under vcs control

 profile.d.sh    | 11 +++++++++++
 snapd.spec      | 20 +++++---------------
 snapd.sysconfig |  2 ++
 3 files changed, 18 insertions(+), 15 deletions(-)
---
diff --git a/snapd.spec b/snapd.spec
index 1d14c51..f397f2a 100644
--- a/snapd.spec
+++ b/snapd.spec
@@ -13,6 +13,8 @@ Source0:	https://github.com/snapcore/snapd/releases/download/%{version}/%{name}_
 # Source0-md5:	8152560d2af809ad84185d3b341b2f13
 # Script to implement certain package management actions
 Source1:	snap-mgmt.sh
+Source2:	profile.d.sh
+Source3:	%{name}.sysconfig
 URL:		https://github.com/snapcore/snapd
 Patch0001:	0001-cmd-use-libtool-for-the-internal-library.patch
 Patch0100:	%{name}-2.26.1-interfaces-seccomp-allow-bind-for-Fedora.patch
@@ -158,7 +160,7 @@ install -d -p $RPM_BUILD_ROOT%{_bindir}
 install -d -p $RPM_BUILD_ROOT%{_libexecdir}/snapd
 install -d -p $RPM_BUILD_ROOT%{_mandir}/man1
 install -d -p $RPM_BUILD_ROOT%{systemdunitdir}
-install -d -p $RPM_BUILD_ROOT%{_sysconfdir}/profile.d
+install -d -p $RPM_BUILD_ROOT/etc/profile.d
 install -d -p $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig
 install -d -p $RPM_BUILD_ROOT%{_sharedstatedir}/snapd/assertions
 install -d -p $RPM_BUILD_ROOT%{_sharedstatedir}/snapd/desktop/applications
@@ -213,20 +215,8 @@ cd data/systemd
 rm -fv $RPM_BUILD_ROOT%{systemdunitdir}/snapd.system-shutdown.service
 cd -
 
-# Put /var/lib/snapd/snap/bin on PATH
-# Put /var/lib/snapd/desktop on XDG_DATA_DIRS
-cat << __SNAPD_SH__ > $RPM_BUILD_ROOT%{_sysconfdir}/profile.d/snapd.sh
-PATH=\$PATH:/var/lib/snapd/snap/bin
-if [ -z "\$XDG_DATA_DIRS" ]; then
-XDG_DATA_DIRS=%{_datadir}/:%{_prefix}/local/share/:/var/lib/snapd/desktop
-else
-    XDG_DATA_DIRS="\$XDG_DATA_DIRS":/var/lib/snapd/desktop
-fi
-export XDG_DATA_DIRS
-__SNAPD_SH__
-
-# Disable re-exec by default
-echo 'SNAP_REEXEC=0' > $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/snapd
+cp -p %{SOURCE2} $RPM_BUILD_ROOT/etc/profile.d/snapd.sh
+cp -p %{SOURCE3} $RPM_BUILD_ROOT%{_sysconfdir}/sysconfig/snapd
 
 # Install snap management script
 install -pm 0755 %{SOURCE1} $RPM_BUILD_ROOT%{_libexecdir}/snapd/snap-mgmt
diff --git a/profile.d.sh b/profile.d.sh
new file mode 100644
index 0000000..eaf2525
--- /dev/null
+++ b/profile.d.sh
@@ -0,0 +1,11 @@
+
+# Put /var/lib/snapd/snap/bin on PATH
+# Put /var/lib/snapd/desktop on XDG_DATA_DIRS
+
+PATH=$PATH:/var/lib/snapd/snap/bin
+if [ -z "$XDG_DATA_DIRS" ]; then
+	XDG_DATA_DIRS=/usr/share:/usr/local/share:/var/lib/snapd/desktop
+else
+    XDG_DATA_DIRS="$XDG_DATA_DIRS":/var/lib/snapd/desktop
+fi
+export XDG_DATA_DIRS
diff --git a/snapd.sysconfig b/snapd.sysconfig
new file mode 100644
index 0000000..80fda74
--- /dev/null
+++ b/snapd.sysconfig
@@ -0,0 +1,2 @@
+# Disable re-exec by default
+SNAP_REEXEC=0
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/snapd.git/commitdiff/98f266a54fd465d01a9c6db265701ed1232f9649



More information about the pld-cvs-commit mailing list