#2 Release 2.40
Closed 4 years ago by ngompa. Opened 4 years ago by eclipseo.
rpms/ eclipseo/snapd master  into  master

file modified
+2
@@ -38,3 +38,5 @@ 

  /snapd_2.39.1.only-vendor.tar.xz

  /snapd_2.39.2.no-vendor.tar.xz

  /snapd_2.39.2.only-vendor.tar.xz

+ /snapd_2.40.no-vendor.tar.xz

+ /snapd_2.40.only-vendor.tar.xz

@@ -1,53 +0,0 @@ 

- From 9a3286edb0b0a6391f7329d64be1e3f7d1e886ce Mon Sep 17 00:00:00 2001

- Message-Id: <9a3286edb0b0a6391f7329d64be1e3f7d1e886ce.1560237385.git.maciej.zenon.borzecki@canonical.com>

- From: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>

- Date: Fri, 7 Jun 2019 16:02:58 +0200

- Subject: [PATCH] data/selinux: allow running hooks and services from classic

-  snaps

- 

- When a classic snap with service or hooks is installed on SELinux system, the

- policy will prevent snapd from running the hooks or, should the snap have a

- service, it will fail to be started by systemd -> snap-confine chain.

- 

- The reason is that for classic snaps, snap-confine executes snap-exec from the

- host (labeled as snappy_exec_t) instead of the one from a mounted snap (labeled

- as snappy_snap_t). The policy does not allow that.

- 

- Allow snappy_exec_t to be an entrypoint to unconfined_service_t.

- 

- Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>

- ---

-  data/selinux/snappy.te | 9 +++++++++

-  1 file changed, 9 insertions(+)

- 

- diff --git a/data/selinux/snappy.te b/data/selinux/snappy.te

- index de3e948886212f5c733d531e0388d69246750757..a63b88e0a42370e323704590bc0966d969ec6971 100644

- --- a/data/selinux/snappy.te

- +++ b/data/selinux/snappy.te

- @@ -29,7 +29,9 @@ attribute_role snappy_roles;

-  # snapd

-  type snappy_t;

-  type snappy_exec_t;

- +# allow init domain to transition to snappy_t by executing snappy_exec_t

-  init_daemon_domain(snappy_t, snappy_exec_t)

- +

-  role snappy_roles types snappy_t;

-  

-  type snappy_config_t;

- @@ -502,6 +504,13 @@ allow snappy_confine_t snappy_unconfined_snap_t:process { noatsecure rlimitinh s

-  gen_require(` type unconfined_service_t; ')

-  allow snappy_confine_t unconfined_service_t:process { noatsecure rlimitinh siginh transition dyntransition };

-  

- +# for classic snaps, snap-confine executes snap-exec from the host (labeled as

- +# snappy_exec_t)

- +can_exec(snappy_confine_t, snappy_exec_t)

- +# allow snappy_exec_t to be an entrypoint to unconfined_service_t, only

- +# snap-confine is allowed to transition this way

- +domain_entry_file(unconfined_service_t, snappy_exec_t)

- +

-  ########################################

-  #

-  # snap, snapctl local policy

- -- 

- 2.22.0

- 

@@ -1,27 +0,0 @@ 

- From e690755f23dd4ac17df7160a20819a3194cbdd34 Mon Sep 17 00:00:00 2001

- Message-Id: <e690755f23dd4ac17df7160a20819a3194cbdd34.1560237392.git.maciej.zenon.borzecki@canonical.com>

- From: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>

- Date: Mon, 10 Jun 2019 13:37:44 +0200

- Subject: [PATCH] data/selinux: bump SELinux policy module version

- 

- Signed-off-by: Maciej Borzecki <maciej.zenon.borzecki@canonical.com>

- ---

-  data/selinux/snappy.te | 2 +-

-  1 file changed, 1 insertion(+), 1 deletion(-)

- 

- diff --git a/data/selinux/snappy.te b/data/selinux/snappy.te

- index a63b88e0a42370e323704590bc0966d969ec6971..8b7834e048802f801d13ca213e0344803876488c 100644

- --- a/data/selinux/snappy.te

- +++ b/data/selinux/snappy.te

- @@ -17,7 +17,7 @@

-  # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.

-  

-  

- -policy_module(snappy,0.0.14)

- +policy_module(snappy,0.1.0)

-  

-  ########################################

-  #

- -- 

- 2.22.0

- 

file modified
+182 -524
@@ -1,3 +1,6 @@ 

+ # Generated by go2rpm 1

+ %bcond_without check

+ 

  # With Fedora, nothing is bundled. For everything else, bundling is used.

  # To use bundled stuff, use "--with vendorized" on rpmbuild

  %if 0%{?fedora}
@@ -10,91 +13,48 @@ 

  # are used for the spread test suite of snapd.

  %bcond_with testkeys

  

- %global with_devel 1

- %global with_debug 1

- %global with_check 0

- %global with_unit_test 0

- %global with_test_keys 0

- 

  # For the moment, we don't support all golang arches...

- %global with_goarches 0

+ %bcond_with goarches

  

  # Set if multilib is enabled for supported arches

  %ifarch x86_64 aarch64 %{power64} s390x

- %global with_multilib 1

+ %bcond_without multilib

  %endif

  

- %if ! %{with vendorized}

- %global with_bundled 0

- %else

- %global with_bundled 1

- %endif

- 

- %if ! %{with testkeys}

- %global with_test_keys 0

- %else

- %global with_test_keys 1

- %endif

+ %global snappy_svcs     snapd.service snapd.socket snapd.autoimport.service snapd.seeded.service

  

- %if 0%{?with_debug}

- %global _dwz_low_mem_die_limit 0

- %else

- %global debug_package   %{nil}

- %endif

+ # Avoid causing incompatibilities among base snaps

+ %global __brp_mangle_shebangs_exclude ^/bin/(bash|sh)$

  

- %global provider        github

- %global provider_tld    com

- %global project         snapcore

- %global repo            snapd

  # https://github.com/snapcore/snapd

- %global provider_prefix %{provider}.%{provider_tld}/%{project}/%{repo}

- %global import_path     %{provider_prefix}

+ %global goipath         github.com/snapcore/snapd

+ Version:                2.40

+ %global tag             2.40

  

- %global snappy_svcs     snapd.service snapd.socket snapd.autoimport.service snapd.seeded.service

+ %gometa

  

- # Until we have a way to add more extldflags to gobuild macro...

- %if 0%{?fedora}

- %define gobuild_static(o:) go build -buildmode pie -compiler gc -tags=rpm_crashtraceback -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags -static'" -a -v -x %{?**};

- %endif

- %if 0%{?rhel} == 7

- %define gobuild_static(o:) go build -compiler gc -tags=rpm_crashtraceback -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags -static'" -a -v -x %{?**};

- %endif

- 

- # These macros are not defined in RHEL 7

- %if 0%{?rhel} == 7

- %define gobuild(o:) go build -compiler gc -tags=rpm_crashtraceback -ldflags "${LDFLAGS:-} -B 0x$(head -c20 /dev/urandom|od -An -tx1|tr -d ' \\n') -extldflags '%__global_ldflags'" -a -v -x %{?**};

- %define gotest() go test -compiler gc -ldflags "${LDFLAGS:-}" %{?**};

- %endif

+ %global goname         snapd

  

- # Avoid causing incompatibilities among base snaps

- %global __brp_mangle_shebangs_exclude ^/bin/(bash|sh)$

+ %global common_description %{expand:

+ Snappy is a modern, cross-distribution, transactional package manager

+ designed for working with self-contained, immutable packages.}

  

- # Compat path macros

- %{!?_environmentdir: %global _environmentdir %{_prefix}/lib/environment.d}

- %{!?_systemdgeneratordir: %global _systemdgeneratordir %{_prefix}/lib/systemd/system-generators}

- %{!?_systemd_system_env_generator_dir: %global _systemd_system_env_generator_dir %{_prefix}/lib/systemd/system-environment-generators}

+ %global golicenses      COPYING

+ %global godocs          docs CONTRIBUTING.md PULL_REQUEST_TEMPLATE.md\\\

+                         README.md HACKING.m

  

- Name:           snapd

- Version:        2.39.2

- Release:        2%{?dist}

+ Name:           %{goname}

+ Release:        1%{?dist}

  Summary:        A transactional software package manager

- License:        GPLv3

- URL:            https://%{provider_prefix}

- Source0:        https://%{provider_prefix}/releases/download/%{version}/%{name}_%{version}.no-vendor.tar.xz

- Source1:        https://%{provider_prefix}/releases/download/%{version}/%{name}_%{version}.only-vendor.tar.xz

  

+ License:        GPLv2+

+ URL:            %{gourl}

+ Source0:        %{gourl}/releases/download/%{version}/%{name}_%{version}.no-vendor.tar.xz

+ Source1:        %{gourl}/releases/download/%{version}/%{name}_%{version}.only-vendor.tar.xz

  # Upstream proposed PR: https://github.com/snapcore/snapd/pull/3162

  Patch0001:      0001-cmd-use-libtool-for-the-internal-library.patch

  

- # Backports from upstream

- ## Fix issues running hooks and services from snaps with bases and classic snaps

- ## From: https://github.com/snapcore/snapd/commit/9a3286edb0b0a6391f7329d64be1e3f7d1e886ce

- Patch0102:      0001-data-selinux-allow-running-hooks-and-services-from-c.patch

- ## Bump SELinux policy version

- ## From: https://github.com/snapcore/snapd/commit/e690755f23dd4ac17df7160a20819a3194cbdd34

- Patch0103:      0001-data-selinux-bump-SELinux-policy-module-version.patch

- 

- %if 0%{?with_goarches}

+ %if %{with goarches}

  # e.g. el6 has ppc64 arch without gcc-go, so EA tag is required

  ExclusiveArch:  %{?go_arches:%{go_arches}}%{!?go_arches:%{ix86} x86_64 %{arm}}

  %else
@@ -102,27 +62,38 @@ 

  ExclusiveArch:  %{ix86} x86_64 %{arm} aarch64 ppc64le s390x

  %endif

  

- # If go_compiler is not set to 1, there is no virtual provide. Use golang instead.

- BuildRequires:  %{?go_compiler:compiler(go-compiler)}%{!?go_compiler:golang >= 1.9}

+ BuildRequires:  golang(github.com/boltdb/bolt)

+ BuildRequires:  golang(github.com/coreos/go-systemd/activation)

+ BuildRequires:  golang(github.com/godbus/dbus)

+ BuildRequires:  golang(github.com/godbus/dbus/introspect)

+ BuildRequires:  golang(github.com/gorilla/mux)

+ BuildRequires:  golang(github.com/jessevdk/go-flags)

+ BuildRequires:  golang(github.com/juju/ratelimit)

+ BuildRequires:  golang(github.com/mvo5/goconfigparser)

+ BuildRequires:  golang(github.com/ojii/gettext.go)

+ BuildRequires:  golang(github.com/seccomp/libseccomp-golang)

+ BuildRequires:  golang(golang.org/x/crypto/openpgp/armor)

+ BuildRequires:  golang(golang.org/x/crypto/openpgp/packet)

+ BuildRequires:  golang(golang.org/x/crypto/sha3)

+ BuildRequires:  golang(golang.org/x/crypto/ssh/terminal)

+ BuildRequires:  golang(gopkg.in/check.v1)

+ BuildRequires:  golang(gopkg.in/macaroon.v1)

+ BuildRequires:  golang(gopkg.in/mgo.v2/bson)

+ BuildRequires:  golang(gopkg.in/retry.v1)

+ BuildRequires:  golang(gopkg.in/tomb.v2)

+ BuildRequires:  golang(gopkg.in/tylerb/graceful.v1)

+ BuildRequires:  golang(gopkg.in/yaml.v2)

+ BuildRequires:  squashfs-tools

+ BuildRequires:  openssh

  BuildRequires:  systemd

  %{?systemd_requires}

  

  Requires:       snap-confine%{?_isa} = %{version}-%{release}

  Requires:       squashfs-tools

- 

- %if 0%{?rhel} && 0%{?rhel} < 8

- # Rich dependencies not available, always pull in squashfuse

- # snapd will use squashfs.ko instead of squashfuse if it's on the system

- Requires:       squashfuse

- Requires:       fuse

- %else

  # snapd will use squashfuse in the event that squashfs.ko isn't available (cloud instances, containers, etc.)

  Requires:       ((squashfuse and fuse) or kmod(squashfs.ko))

- %endif

- 

  # bash-completion owns /usr/share/bash-completion/completions

  Requires:       bash-completion

- 

  # Force the SELinux module to be installed

  Requires:       %{name}-selinux = %{version}-%{release}

  
@@ -134,39 +105,12 @@ 

  Provides:       %{name}-login-service%{?_isa} = 1.33

  %endif

  

- %if ! 0%{?with_bundled}

- BuildRequires: golang(github.com/boltdb/bolt)

- BuildRequires: golang(github.com/cheggaaa/pb)

- BuildRequires: golang(github.com/coreos/go-systemd/activation)

- BuildRequires: golang(github.com/godbus/dbus)

- BuildRequires: golang(github.com/godbus/dbus/introspect)

- BuildRequires: golang(github.com/gorilla/mux)

- BuildRequires: golang(github.com/jessevdk/go-flags)

- BuildRequires: golang(github.com/juju/ratelimit)

- BuildRequires: golang(github.com/kr/pretty)

- BuildRequires: golang(github.com/kr/text)

- BuildRequires: golang(github.com/mvo5/goconfigparser)

- BuildRequires: golang(github.com/ojii/gettext.go)

- BuildRequires: golang(github.com/seccomp/libseccomp-golang)

- BuildRequires: golang(golang.org/x/crypto/openpgp/armor)

- BuildRequires: golang(golang.org/x/crypto/openpgp/packet)

- BuildRequires: golang(golang.org/x/crypto/sha3)

- BuildRequires: golang(golang.org/x/crypto/ssh/terminal)

- BuildRequires: golang(gopkg.in/check.v1)

- BuildRequires: golang(gopkg.in/macaroon.v1)

- BuildRequires: golang(gopkg.in/mgo.v2/bson)

- BuildRequires: golang(gopkg.in/retry.v1)

- BuildRequires: golang(gopkg.in/tomb.v2)

- BuildRequires: golang(gopkg.in/yaml.v2)

- %endif

- 

  %description

- Snappy is a modern, cross-distribution, transactional package manager

- designed for working with self-contained, immutable packages.

+ %{common_description}

  

  %package -n snap-confine

  Summary:        Confinement system for snap applications

- License:        GPLv3

+ License:        GPLv2+

  BuildRequires:  autoconf

  BuildRequires:  automake

  BuildRequires:  libtool
@@ -183,15 +127,9 @@ 

  BuildRequires:  pkgconfig(udev)

  BuildRequires:  xfsprogs-devel

  BuildRequires:  glibc-static

- %if ! 0%{?rhel}

- BuildRequires:  libseccomp-static

- %endif

  BuildRequires:  valgrind

  BuildRequires:  %{_bindir}/rst2man

- %if 0%{?fedora}

- # ShellCheck in EPEL is too old...

  BuildRequires:  %{_bindir}/shellcheck

- %endif

  

  # Ensures older version from split packaging is replaced

  Obsoletes:      snap-confine < 2.19
@@ -207,11 +145,7 @@ 

  BuildRequires:  selinux-policy, selinux-policy-devel

  Requires(post): selinux-policy-base >= %{_selinux_policy_version}

  Requires(post): policycoreutils

- %if 0%{?rhel} == 7

- Requires(post): policycoreutils-python

- %else

  Requires(post): policycoreutils-python-utils

- %endif

  Requires(pre):  libselinux-utils

  Requires(post): libselinux-utils

  
@@ -219,214 +153,20 @@ 

  This package provides the SELinux policy module to ensure snapd

  runs properly under an environment with SELinux enabled.

  

- 

- %if 0%{?with_devel}

- %package devel

- Summary:       Development files for %{name}

- BuildArch:     noarch

- 

- %if 0%{?with_check} && ! 0%{?with_bundled}

- %endif

- 

- %if ! 0%{?with_bundled}

- Requires:      golang(github.com/boltdb/bolt)

- Requires:      golang(github.com/cheggaaa/pb)

- Requires:      golang(github.com/coreos/go-systemd/activation)

- Requires:      golang(github.com/godbus/dbus)

- Requires:      golang(github.com/godbus/dbus/introspect)

- Requires:      golang(github.com/gorilla/mux)

- Requires:      golang(github.com/jessevdk/go-flags)

- Requires:      golang(github.com/juju/ratelimit)

- Requires:      golang(github.com/kr/pretty)

- Requires:      golang(github.com/kr/text)

- Requires:      golang(github.com/mvo5/goconfigparser)

- Requires:      golang(github.com/ojii/gettext.go)

- Requires:      golang(github.com/seccomp/libseccomp-golang)

- Requires:      golang(golang.org/x/crypto/openpgp/armor)

- Requires:      golang(golang.org/x/crypto/openpgp/packet)

- Requires:      golang(golang.org/x/crypto/sha3)

- Requires:      golang(golang.org/x/crypto/ssh/terminal)

- Requires:      golang(gopkg.in/check.v1)

- Requires:      golang(gopkg.in/macaroon.v1)

- Requires:      golang(gopkg.in/mgo.v2/bson)

- Requires:      golang(gopkg.in/retry.v1)

- Requires:      golang(gopkg.in/tomb.v2)

- Requires:      golang(gopkg.in/yaml.v2)

- %else

- # These Provides are unversioned because the sources in

- # the bundled tarball are unversioned (they go by git commit)

- # *sigh*... I hate golang...

- Provides:      bundled(golang(github.com/snapcore/bolt))

- Provides:      bundled(golang(github.com/cheggaaa/pb))

- Provides:      bundled(golang(github.com/coreos/go-systemd/activation))

- Provides:      bundled(golang(github.com/godbus/dbus))

- Provides:      bundled(golang(github.com/godbus/dbus/introspect))

- Provides:      bundled(golang(github.com/gorilla/mux))

- Provides:      bundled(golang(github.com/jessevdk/go-flags))

- Provides:      bundled(golang(github.com/juju/ratelimit))

- Provides:      bundled(golang(github.com/kr/pretty))

- Provides:      bundled(golang(github.com/kr/text))

- Provides:      bundled(golang(github.com/mvo5/goconfigparser))

- Provides:      bundled(golang(github.com/mvo5/libseccomp-golang))

- Provides:      bundled(golang(github.com/ojii/gettext.go))

- Provides:      bundled(golang(golang.org/x/crypto/openpgp/armor))

- Provides:      bundled(golang(golang.org/x/crypto/openpgp/packet))

- Provides:      bundled(golang(golang.org/x/crypto/sha3))

- Provides:      bundled(golang(golang.org/x/crypto/ssh/terminal))

- Provides:      bundled(golang(gopkg.in/check.v1))

- Provides:      bundled(golang(gopkg.in/macaroon.v1))

- Provides:      bundled(golang(gopkg.in/mgo.v2/bson))

- Provides:      bundled(golang(gopkg.in/retry.v1))

- Provides:      bundled(golang(gopkg.in/tomb.v2))

- Provides:      bundled(golang(gopkg.in/yaml.v2))

- %endif

- 

- # Generated by gofed

- Provides:      golang(%{import_path}/advisor) = %{version}-%{release}

- Provides:      golang(%{import_path}/arch) = %{version}-%{release}

- Provides:      golang(%{import_path}/asserts) = %{version}-%{release}

- Provides:      golang(%{import_path}/asserts/assertstest) = %{version}-%{release}

- Provides:      golang(%{import_path}/asserts/signtool) = %{version}-%{release}

- Provides:      golang(%{import_path}/asserts/snapasserts) = %{version}-%{release}

- Provides:      golang(%{import_path}/asserts/sysdb) = %{version}-%{release}

- Provides:      golang(%{import_path}/asserts/systestkeys) = %{version}-%{release}

- Provides:      golang(%{import_path}/boot) = %{version}-%{release}

- Provides:      golang(%{import_path}/boot/boottest) = %{version}-%{release}

- Provides:      golang(%{import_path}/bootloader) = %{version}-%{release}

- Provides:      golang(%{import_path}/bootloader/androidbootenv) = %{version}-%{release}

- Provides:      golang(%{import_path}/bootloader/grubenv) = %{version}-%{release}

- Provides:      golang(%{import_path}/bootloader/ubootenv) = %{version}-%{release}

- Provides:      golang(%{import_path}/client) = %{version}-%{release}

- Provides:      golang(%{import_path}/cmd) = %{version}-%{release}

- Provides:      golang(%{import_path}/cmd/cmdutil) = %{version}-%{release}

- Provides:      golang(%{import_path}/cmd/snap-seccomp/syscalls) = %{version}-%{release}

- Provides:      golang(%{import_path}/cmd/snaplock) = %{version}-%{release}

- Provides:      golang(%{import_path}/daemon) = %{version}-%{release}

- Provides:      golang(%{import_path}/dirs) = %{version}-%{release}

- Provides:      golang(%{import_path}/errtracker) = %{version}-%{release}

- Provides:      golang(%{import_path}/features) = %{version}-%{release}

- Provides:      golang(%{import_path}/gadget) = %{version}-%{release}

- Provides:      golang(%{import_path}/httputil) = %{version}-%{release}

- Provides:      golang(%{import_path}/i18n) = %{version}-%{release}

- Provides:      golang(%{import_path}/image) = %{version}-%{release}

- Provides:      golang(%{import_path}/interfaces) = %{version}-%{release}

- Provides:      golang(%{import_path}/interfaces/apparmor) = %{version}-%{release}

- Provides:      golang(%{import_path}/interfaces/backends) = %{version}-%{release}

- Provides:      golang(%{import_path}/interfaces/builtin) = %{version}-%{release}

- Provides:      golang(%{import_path}/interfaces/dbus) = %{version}-%{release}

- Provides:      golang(%{import_path}/interfaces/hotplug) = %{version}-%{release}

- Provides:      golang(%{import_path}/interfaces/ifacetest) = %{version}-%{release}

- Provides:      golang(%{import_path}/interfaces/kmod) = %{version}-%{release}

- Provides:      golang(%{import_path}/interfaces/mount) = %{version}-%{release}

- Provides:      golang(%{import_path}/interfaces/policy) = %{version}-%{release}

- Provides:      golang(%{import_path}/interfaces/seccomp) = %{version}-%{release}

- Provides:      golang(%{import_path}/interfaces/systemd) = %{version}-%{release}

- Provides:      golang(%{import_path}/interfaces/udev) = %{version}-%{release}

- Provides:      golang(%{import_path}/interfaces/utils) = %{version}-%{release}

- Provides:      golang(%{import_path}/jsonutil) = %{version}-%{release}

- Provides:      golang(%{import_path}/jsonutil/safejson) = %{version}-%{release}

- Provides:      golang(%{import_path}/logger) = %{version}-%{release}

- Provides:      golang(%{import_path}/metautil) = %{version}-%{release}

- Provides:      golang(%{import_path}/netutil) = %{version}-%{release}

- Provides:      golang(%{import_path}/osutil) = %{version}-%{release}

- Provides:      golang(%{import_path}/osutil/squashfs) = %{version}-%{release}

- Provides:      golang(%{import_path}/osutil/strace) = %{version}-%{release}

- Provides:      golang(%{import_path}/osutil/sys) = %{version}-%{release}

- Provides:      golang(%{import_path}/osutil/udev/crawler) = %{version}-%{release}

- Provides:      golang(%{import_path}/osutil/udev/netlink) = %{version}-%{release}

- Provides:      golang(%{import_path}/overlord) = %{version}-%{release}

- Provides:      golang(%{import_path}/overlord/assertstate) = %{version}-%{release}

- Provides:      golang(%{import_path}/overlord/auth) = %{version}-%{release}

- Provides:      golang(%{import_path}/overlord/cmdstate) = %{version}-%{release}

- Provides:      golang(%{import_path}/overlord/configstate) = %{version}-%{release}

- Provides:      golang(%{import_path}/overlord/configstate/config) = %{version}-%{release}

- Provides:      golang(%{import_path}/overlord/configstate/configcore) = %{version}-%{release}

- Provides:      golang(%{import_path}/overlord/configstate/proxyconf) = %{version}-%{release}

- Provides:      golang(%{import_path}/overlord/configstate/settings) = %{version}-%{release}

- Provides:      golang(%{import_path}/overlord/devicestate) = %{version}-%{release}

- Provides:      golang(%{import_path}/overlord/devicestate/devicestatetest) = %{version}-%{release}

- Provides:      golang(%{import_path}/overlord/hookstate) = %{version}-%{release}

- Provides:      golang(%{import_path}/overlord/hookstate/ctlcmd) = %{version}-%{release}

- Provides:      golang(%{import_path}/overlord/hookstate/hooktest) = %{version}-%{release}

- Provides:      golang(%{import_path}/overlord/ifacestate) = %{version}-%{release}

- Provides:      golang(%{import_path}/overlord/ifacestate/ifacerepo) = %{version}-%{release}

- Provides:      golang(%{import_path}/overlord/ifacestate/udevmonitor) = %{version}-%{release}

- Provides:      golang(%{import_path}/overlord/patch) = %{version}-%{release}

- Provides:      golang(%{import_path}/overlord/servicestate) = %{version}-%{release}

- Provides:      golang(%{import_path}/overlord/snapshotstate) = %{version}-%{release}

- Provides:      golang(%{import_path}/overlord/snapshotstate/backend) = %{version}-%{release}

- Provides:      golang(%{import_path}/overlord/snapstate) = %{version}-%{release}

- Provides:      golang(%{import_path}/overlord/snapstate/backend) = %{version}-%{release}

- Provides:      golang(%{import_path}/overlord/standby) = %{version}-%{release}

- Provides:      golang(%{import_path}/overlord/state) = %{version}-%{release}

- Provides:      golang(%{import_path}/overlord/storecontext) = %{version}-%{release}

- Provides:      golang(%{import_path}/polkit) = %{version}-%{release}

- Provides:      golang(%{import_path}/progress) = %{version}-%{release}

- Provides:      golang(%{import_path}/progress/progresstest) = %{version}-%{release}

- Provides:      golang(%{import_path}/release) = %{version}-%{release}

- Provides:      golang(%{import_path}/sandbox/seccomp) = %{version}-%{release}

- Provides:      golang(%{import_path}/sanity) = %{version}-%{release}

- Provides:      golang(%{import_path}/selinux) = %{version}-%{release}

- Provides:      golang(%{import_path}/snap) = %{version}-%{release}

- Provides:      golang(%{import_path}/snap/naming) = %{version}-%{release}

- Provides:      golang(%{import_path}/snap/pack) = %{version}-%{release}

- Provides:      golang(%{import_path}/snap/snapdir) = %{version}-%{release}

- Provides:      golang(%{import_path}/snap/snapenv) = %{version}-%{release}

- Provides:      golang(%{import_path}/snap/snaptest) = %{version}-%{release}

- Provides:      golang(%{import_path}/snap/squashfs) = %{version}-%{release}

- Provides:      golang(%{import_path}/spdx) = %{version}-%{release}

- Provides:      golang(%{import_path}/store) = %{version}-%{release}

- Provides:      golang(%{import_path}/store/storetest) = %{version}-%{release}

- Provides:      golang(%{import_path}/strutil) = %{version}-%{release}

- Provides:      golang(%{import_path}/strutil/quantity) = %{version}-%{release}

- Provides:      golang(%{import_path}/strutil/shlex) = %{version}-%{release}

- Provides:      golang(%{import_path}/systemd) = %{version}-%{release}

- Provides:      golang(%{import_path}/tests/lib/fakestore/refresh) = %{version}-%{release}

- Provides:      golang(%{import_path}/tests/lib/fakestore/store) = %{version}-%{release}

- Provides:      golang(%{import_path}/testutil) = %{version}-%{release}

- Provides:      golang(%{import_path}/timeout) = %{version}-%{release}

- Provides:      golang(%{import_path}/timeutil) = %{version}-%{release}

- Provides:      golang(%{import_path}/timings) = %{version}-%{release}

- Provides:      golang(%{import_path}/userd) = %{version}-%{release}

- Provides:      golang(%{import_path}/userd/ui) = %{version}-%{release}

- Provides:      golang(%{import_path}/wrappers) = %{version}-%{release}

- Provides:      golang(%{import_path}/x11) = %{version}-%{release}

- Provides:      golang(%{import_path}/xdgopenproxy) = %{version}-%{release}

- 

- %description devel

- This package contains library source intended for

- building other packages which use import path with

- %{import_path} prefix.

- %endif

- 

- %if 0%{?with_unit_test} && 0%{?with_devel}

- %package unit-test-devel

- Summary:         Unit tests for %{name} package

- 

- %if 0%{?with_check}

- #Here comes all BuildRequires: PACKAGE the unit tests

- #in %%check section need for running

- %endif

- 

- # test subpackage tests code from devel subpackage

- Requires:        %{name}-devel = %{version}-%{release}

- 

- %description unit-test-devel

- This package contains unit tests for project

- providing packages with %{import_path} prefix.

- %endif

+ %gopkg

  

  %prep

- %if ! 0%{?with_bundled}

- %setup -q

+ %if %{without vendorized}

+ %autosetup -N

+ %goprep -e

  %else

  # Extract each tarball properly

- %setup -q -D -b 1

+ %autosetup -N -D -b 1

+ %goprep -e -k

  %endif

  # Apply patches

  %autopatch -p1

  

- 

  %build

  # Generate version files

  ./mkversion.sh "%{version}-%{release}"
@@ -434,46 +174,27 @@ 

  # We don't want/need squashfuse in the rpm, as it's available in Fedora and EPEL

  sed -e 's:_ "github.com/snapcore/squashfuse"::g' -i systemd/systemd.go

  

- # Build snapd

- mkdir -p src/github.com/snapcore

- ln -s ../../../ src/github.com/snapcore/snapd

- 

- %if ! 0%{?with_bundled}

- export GOPATH=$(pwd):%{gopath}

- %else

- export GOPATH=$(pwd):$(pwd)/Godeps/_workspace:%{gopath}

- %endif

- 

- GOFLAGS=

- %if 0%{?with_test_keys}

- GOFLAGS="$GOFLAGS -tags withtestkeys"

- %endif

- 

- %if ! 0%{?with_bundled}

+ %if %{without vendorized}

  # We don't need mvo5 fork for seccomp, as we have seccomp 2.3.x

  sed -e "s:github.com/mvo5/libseccomp-golang:github.com/seccomp/libseccomp-golang:g" -i cmd/snap-seccomp/*.go

  # We don't need the snapcore fork for bolt - it is just a fix on ppc

  sed -e "s:github.com/snapcore/bolt:github.com/boltdb/bolt:g" -i advisor/*.go errtracker/*.go

  %endif

  

- # We have to build snapd first to prevent the build from

- # building various things from the tree without additional

- # set tags.

- %gobuild -o bin/snapd $GOFLAGS %{import_path}/cmd/snapd

- %gobuild -o bin/snap $GOFLAGS %{import_path}/cmd/snap

- %gobuild -o bin/snap-failure $GOFLAGS %{import_path}/cmd/snap-failure

+ %if %{with testkeys}

+ export BUILDTAGS="withtestkeys"

+ %endif

+ 

+ for cmd in cmd/snapd cmd/snap cmd/snap-failure  cmd/snap-seccomp; do

+   %gobuild -o %{gobuilddir}/bin/$(basename $cmd) %{goipath}/$cmd

+ done

  

  # To ensure things work correctly with base snaps,

  # snap-exec, snap-update-ns, and snapctl need to be built statically

- %gobuild_static -o bin/snap-exec $GOFLAGS %{import_path}/cmd/snap-exec

- %gobuild_static -o bin/snap-update-ns $GOFLAGS %{import_path}/cmd/snap-update-ns

- %gobuild_static -o bin/snapctl $GOFLAGS %{import_path}/cmd/snapctl

- 

- %if 0%{?rhel}

- # There's no static link library for libseccomp in RHEL/CentOS...

- sed -e "s/-Bstatic -lseccomp/-Bstatic/g" -i cmd/snap-seccomp/*.go

- %endif

- %gobuild -o bin/snap-seccomp $GOFLAGS %{import_path}/cmd/snap-seccomp

+ for cmd in cmd/snap-exec cmd/snap-update-ns cmd/snapctl; do

+   export __golang_extldflags="-static"

+   %gobuild -o %{gobuilddir}/bin/$(basename $cmd) %{goipath}/$cmd

+ done

  

  # Build SELinux module

  pushd ./data/selinux
@@ -505,59 +226,60 @@ 

  popd

  

  %install

- install -d -p %{buildroot}%{_bindir}

- install -d -p %{buildroot}%{_libexecdir}/snapd

- install -d -p %{buildroot}%{_mandir}/man8

- install -d -p %{buildroot}%{_environmentdir}

- install -d -p %{buildroot}%{_systemdgeneratordir}

- install -d -p %{buildroot}%{_systemd_system_env_generator_dir}

- install -d -p %{buildroot}%{_unitdir}

- install -d -p %{buildroot}%{_sysconfdir}/profile.d

- install -d -p %{buildroot}%{_sysconfdir}/sysconfig

- install -d -p %{buildroot}%{_sharedstatedir}/snapd/assertions

- install -d -p %{buildroot}%{_sharedstatedir}/snapd/cookie

- install -d -p %{buildroot}%{_sharedstatedir}/snapd/desktop/applications

- install -d -p %{buildroot}%{_sharedstatedir}/snapd/device

- install -d -p %{buildroot}%{_sharedstatedir}/snapd/hostfs

- install -d -p %{buildroot}%{_sharedstatedir}/snapd/lib/gl

- install -d -p %{buildroot}%{_sharedstatedir}/snapd/lib/gl32

- install -d -p %{buildroot}%{_sharedstatedir}/snapd/lib/glvnd

- install -d -p %{buildroot}%{_sharedstatedir}/snapd/lib/vulkan

- install -d -p %{buildroot}%{_sharedstatedir}/snapd/mount

- install -d -p %{buildroot}%{_sharedstatedir}/snapd/seccomp/bpf

- install -d -p %{buildroot}%{_sharedstatedir}/snapd/snaps

- install -d -p %{buildroot}%{_sharedstatedir}/snapd/snap/bin

- install -d -p %{buildroot}%{_localstatedir}/snap

- install -d -p %{buildroot}%{_localstatedir}/cache/snapd

- install -d -p %{buildroot}%{_datadir}/polkit-1/actions

- install -d -p %{buildroot}%{_datadir}/selinux/devel/include/contrib

- install -d -p %{buildroot}%{_datadir}/selinux/packages

+ %gopkginstall

+ install -m 0755 -vd                     %{buildroot}%{_bindir}

+ install -m 0755 -vd                     %{buildroot}%{_libexecdir}/snapd

+ install -m 0755 -vd                     %{buildroot}%{_mandir}/man8

+ install -m 0755 -vd                     %{buildroot}%{_environmentdir}

+ install -m 0755 -vd                     %{buildroot}%{_systemdgeneratordir}

+ install -m 0755 -vd                     %{buildroot}%{_systemd_system_env_generator_dir}

+ install -m 0755 -vd                     %{buildroot}%{_unitdir}

+ install -m 0755 -vd                     %{buildroot}%{_sysconfdir}/profile.d

+ install -m 0755 -vd                     %{buildroot}%{_sysconfdir}/sysconfig

+ install -m 0755 -vd                     %{buildroot}%{_sharedstatedir}/snapd/assertions

+ install -m 0755 -vd                     %{buildroot}%{_sharedstatedir}/snapd/cookie

+ install -m 0755 -vd                     %{buildroot}%{_sharedstatedir}/snapd/desktop/applications

+ install -m 0755 -vd                     %{buildroot}%{_sharedstatedir}/snapd/device

+ install -m 0755 -vd                     %{buildroot}%{_sharedstatedir}/snapd/hostfs

+ install -m 0755 -vd                     %{buildroot}%{_sharedstatedir}/snapd/lib/gl

+ install -m 0755 -vd                     %{buildroot}%{_sharedstatedir}/snapd/lib/gl32

+ install -m 0755 -vd                     %{buildroot}%{_sharedstatedir}/snapd/lib/glvnd

+ install -m 0755 -vd                     %{buildroot}%{_sharedstatedir}/snapd/lib/vulkan

+ install -m 0755 -vd                     %{buildroot}%{_sharedstatedir}/snapd/mount

+ install -m 0755 -vd                     %{buildroot}%{_sharedstatedir}/snapd/seccomp/bpf

+ install -m 0755 -vd                     %{buildroot}%{_sharedstatedir}/snapd/snaps

+ install -m 0755 -vd                     %{buildroot}%{_sharedstatedir}/snapd/snap/bin

+ install -m 0755 -vd                     %{buildroot}%{_localstatedir}/snap

+ install -m 0755 -vd                     %{buildroot}%{_localstatedir}/cache/snapd

+ install -m 0755 -vd                     %{buildroot}%{_datadir}/polkit-1/actions

+ install -m 0755 -vd                     %{buildroot}%{_datadir}/selinux/devel/include/contrib

+ install -m 0755 -vd                     %{buildroot}%{_datadir}/selinux/packages

  

  # Install snap and snapd

- install -p -m 0755 bin/snap %{buildroot}%{_bindir}

- install -p -m 0755 bin/snap-exec %{buildroot}%{_libexecdir}/snapd

- install -p -m 0755 bin/snap-failure %{buildroot}%{_libexecdir}/snapd

- install -p -m 0755 bin/snapd %{buildroot}%{_libexecdir}/snapd

- install -p -m 0755 bin/snap-update-ns %{buildroot}%{_libexecdir}/snapd

- install -p -m 0755 bin/snap-seccomp %{buildroot}%{_libexecdir}/snapd

+ install -m 0755 -vp %{gobuilddir}/bin/snap            %{buildroot}%{_bindir}

+ install -m 0755 -vp %{gobuilddir}/bin/snap-exec       %{buildroot}%{_libexecdir}/snapd

+ install -m 0755 -vp %{gobuilddir}/bin/snap-failure    %{buildroot}%{_libexecdir}/snapd

+ install -m 0755 -vp %{gobuilddir}/bin/snapd           %{buildroot}%{_libexecdir}/snapd

+ install -m 0755 -vp %{gobuilddir}/bin/snap-update-ns  %{buildroot}%{_libexecdir}/snapd

+ install -m 0755 -vp %{gobuilddir}/bin/snap-seccomp    %{buildroot}%{_libexecdir}/snapd

  # Ensure /usr/bin/snapctl is a symlink to /usr/libexec/snapd/snapctl

- install -p -m 0755 bin/snapctl %{buildroot}%{_libexecdir}/snapd/snapctl

+ install -m 0755 -vp %{gobuilddir}/bin/snapctl         %{buildroot}%{_libexecdir}/snapd

  ln -sf %{_libexecdir}/snapd/snapctl %{buildroot}%{_bindir}/snapctl

  

  # Install SELinux module

- install -p -m 0644 data/selinux/snappy.if %{buildroot}%{_datadir}/selinux/devel/include/contrib

- install -p -m 0644 data/selinux/snappy.pp.bz2 %{buildroot}%{_datadir}/selinux/packages

+ install -m 0644 -vp data/selinux/snappy.if            %{buildroot}%{_datadir}/selinux/devel/include/contrib

+ install -m 0644 -vp data/selinux/snappy.pp.bz2        %{buildroot}%{_datadir}/selinux/packages

  

  # Install snap(8) man page

- bin/snap help --man > %{buildroot}%{_mandir}/man8/snap.8

+ %{gobuilddir}/bin/snap help --man > %{buildroot}%{_mandir}/man8/snap.8

  

  # Install the "info" data file with snapd version

- install -m 644 -D data/info %{buildroot}%{_libexecdir}/snapd/info

+ install -m 644 -vp -D data/info %{buildroot}%{_libexecdir}/snapd/info

  

  # Install bash completion for "snap"

- install -m 644 -D data/completion/snap %{buildroot}%{_datadir}/bash-completion/completions/snap

- install -m 644 -D data/completion/complete.sh %{buildroot}%{_libexecdir}/snapd

- install -m 644 -D data/completion/etelpmoc.sh %{buildroot}%{_libexecdir}/snapd

+ install -m 0644 -vp -D data/completion/snap           %{buildroot}%{_datadir}/bash-completion/completions/snap

+ install -m 0644 -vp -D data/completion/complete.sh    %{buildroot}%{_libexecdir}/snapd

+ install -m 0644 -vp -D data/completion/etelpmoc.sh    %{buildroot}%{_libexecdir}/snapd

  

  # Install snap-confine

  pushd ./cmd
@@ -578,13 +300,6 @@ 

                SNAPD_ENVIRONMENT_FILE="%{_sysconfdir}/sysconfig/snapd"

  popd

  

- 

- %if 0%{?rhel} == 7

- # Install kernel tweaks

- # See: https://access.redhat.com/articles/3128691

- install -m 644 -D data/sysctl/rhel7-snap.conf %{buildroot}%{_sysctldir}/99-snap.conf

- %endif

- 

  # Remove snappy core specific units

  rm -fv %{buildroot}%{_unitdir}/snapd.system-shutdown.service

  rm -fv %{buildroot}%{_unitdir}/snapd.snap-repair.*
@@ -598,7 +313,7 @@ 

  rm -f %{buildroot}%{_libexecdir}/snapd/snapd-apparmor

  

  # Install Polkit configuration

- install -m 644 -D data/polkit/io.snapcraft.snapd.policy %{buildroot}%{_datadir}/polkit-1/actions

+ install -m 0644 -vp -D data/polkit/io.snapcraft.snapd.policy %{buildroot}%{_datadir}/polkit-1/actions

  

  # Disable re-exec by default

  echo 'SNAP_REEXEC=0' > %{buildroot}%{_sysconfdir}/sysconfig/snapd
@@ -607,49 +322,10 @@ 

  touch %{buildroot}%{_sharedstatedir}/snapd/state.json

  touch %{buildroot}%{_sharedstatedir}/snapd/snap/README

  

- # source codes for building projects

- %if 0%{?with_devel}

- install -d -p %{buildroot}/%{gopath}/src/%{import_path}/

- echo "%%dir %%{gopath}/src/%%{import_path}/." >> devel.file-list

- # find all *.go but no *_test.go files and generate devel.file-list

- for file in $(find . -iname "*.go" -o -iname "*.s" \! -iname "*_test.go") ; do

-     echo "%%dir %%{gopath}/src/%%{import_path}/$(dirname $file)" >> devel.file-list

-     install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file)

-     cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file

-     echo "%%{gopath}/src/%%{import_path}/$file" >> devel.file-list

- done

- %endif

- 

- # testing files for this project

- %if 0%{?with_unit_test} && 0%{?with_devel}

- install -d -p %{buildroot}/%{gopath}/src/%{import_path}/

- # find all *_test.go files and generate unit-test.file-list

- for file in $(find . -iname "*_test.go"); do

-     echo "%%dir %%{gopath}/src/%%{import_path}/$(dirname $file)" >> devel.file-list

-     install -d -p %{buildroot}/%{gopath}/src/%{import_path}/$(dirname $file)

-     cp -pav $file %{buildroot}/%{gopath}/src/%{import_path}/$file

-     echo "%%{gopath}/src/%%{import_path}/$file" >> unit-test-devel.file-list

- done

- 

- # Install additional testdata

- install -d %{buildroot}/%{gopath}/src/%{import_path}/cmd/snap/test-data/

- cp -pav cmd/snap/test-data/* %{buildroot}/%{gopath}/src/%{import_path}/cmd/snap/test-data/

- echo "%%{gopath}/src/%%{import_path}/cmd/snap/test-data" >> unit-test-devel.file-list

- %endif

- 

- %if 0%{?with_devel}

- sort -u -o devel.file-list devel.file-list

- %endif

- 

+ %if %{with check}

  %check

- # snapd tests

- %if 0%{?with_check} && 0%{?with_unit_test} && 0%{?with_devel}

- %if ! 0%{?with_bundled}

- export GOPATH=%{buildroot}/%{gopath}:%{gopath}

- %else

- export GOPATH=%{buildroot}/%{gopath}:$(pwd)/Godeps/_workspace:%{gopath}

- %endif

- %gotest %{import_path}/...

+ # xdgopenproxy: mismatched API, https://bugs.launchpad.net/snappy/+bug/1839498

+ %gocheck -t cmd -d interfaces/builtin -d xdgopenproxy

  %endif

  

  # snap-confine tests (these always run!)
@@ -657,17 +333,73 @@ 

  make check

  popd

  

+ %post

+ %systemd_post %{snappy_svcs}

+ # If install, test if snapd socket and timer are enabled.

+ # If enabled, then attempt to start them. This will silently fail

+ # in chroots or other environments where services aren't expected

+ # to be started.

+ if [ $1 -eq 1 ] ; then

+    if systemctl -q is-enabled snapd.socket > /dev/null 2>&1 ; then

+       systemctl start snapd.socket > /dev/null 2>&1 || :

+    fi

+ fi

+ 

+ %preun

+ %systemd_preun %{snappy_svcs}

+ 

+ # Remove all Snappy content if snapd is being fully uninstalled

+ if [ $1 -eq 0 ]; then

+    %{_libexecdir}/snapd/snap-mgmt --purge || :

+ fi

+ 

+ %postun

+ %systemd_postun_with_restart %{snappy_svcs}

+ 

+ %triggerun -- snapd < 2.39

+ # TODO: the trigger relies on a very specific snapd version that introduced SELinux

+ # mount context, figure out how to update the trigger condition to run when needed

+ 

+ # Trigger on uninstall, with one version of the package being pre 2.38 see

+ # https://rpm-packaging-guide.github.io/#triggers-and-scriptlets for details

+ # when triggers are run

+ if [ "$1" -eq 2 -a "$2" -eq 1 ]; then

+    # Upgrade from pre 2.38 version

+    %{_libexecdir}/snapd/snap-mgmt-selinux --patch-selinux-mount-context=system_u:object_r:snappy_snap_t:s0 || :

+ 

+    # snapd might have created fontconfig cache directory earlier, but with

+    # incorrect context due to bugs in the policy, make sure it gets the right one

+    # on upgrade when the new policy was introduced

+    if [ -d "%{_localstatedir}/cache/fontconfig" ]; then

+       restorecon -R %{_localstatedir}/cache/fontconfig || :

+    fi

+ elif [ "$1" -eq 1 -a "$2" -eq 2 ]; then

+    # Downgrade to a pre 2.38 version

+    %{_libexecdir}/snapd/snap-mgmt-selinux --remove-selinux-mount-context=system_u:object_r:snappy_snap_t:s0 || :

+ fi

+ 

+ %pre selinux

+ %selinux_relabel_pre

+ 

+ %post selinux

+ %selinux_modules_install %{_datadir}/selinux/packages/snappy.pp.bz2

+ %selinux_relabel_post

+ 

+ %posttrans selinux

+ %selinux_relabel_post

+ 

+ %postun selinux

+ %selinux_modules_uninstall snappy

+ if [ $1 -eq 0 ]; then

+     %selinux_relabel_post

+ fi

+ 

  %files

- #define license tag if not already defined

- %{!?_licensedir:%global license %doc}

  %license COPYING

- %doc README.md docs/*

+ %doc docs CONTRIBUTING.md PULL_REQUEST_TEMPLATE.md README.md HACKING.md

  %{_bindir}/snap

  %{_bindir}/snapctl

  %{_environmentdir}/990-snapd.conf

- %if 0%{?rhel} == 7

- %{_sysctldir}/99-snap.conf

- %endif

  %dir %{_libexecdir}/snapd

  %{_libexecdir}/snapd/snapctl

  %{_libexecdir}/snapd/snapd
@@ -736,93 +468,19 @@ 

  %{_systemdgeneratordir}/snapd-generator

  %attr(0111,root,root) %{_sharedstatedir}/snapd/void

  

- 

  %files selinux

  %license data/selinux/COPYING

  %doc data/selinux/README.md

  %{_datadir}/selinux/packages/snappy.pp.bz2

  %{_datadir}/selinux/devel/include/contrib/snappy.if

  

- %if 0%{?with_devel}

- %files devel -f devel.file-list

- %license COPYING

- %doc README.md

- %dir %{gopath}/src/%{provider}.%{provider_tld}/%{project}

- %endif

- 

- %if 0%{?with_unit_test} && 0%{?with_devel}

- %files unit-test-devel -f unit-test-devel.file-list

- %license COPYING

- %doc README.md

- %endif

- 

- %post

- %if 0%{?rhel} == 7

- %sysctl_apply 99-snap.conf

- %endif

- %systemd_post %{snappy_svcs}

- # If install, test if snapd socket and timer are enabled.

- # If enabled, then attempt to start them. This will silently fail

- # in chroots or other environments where services aren't expected

- # to be started.

- if [ $1 -eq 1 ] ; then

-    if systemctl -q is-enabled snapd.socket > /dev/null 2>&1 ; then

-       systemctl start snapd.socket > /dev/null 2>&1 || :

-    fi

- fi

- 

- %preun

- %systemd_preun %{snappy_svcs}

- 

- # Remove all Snappy content if snapd is being fully uninstalled

- if [ $1 -eq 0 ]; then

-    %{_libexecdir}/snapd/snap-mgmt --purge || :

- fi

- 

- 

- %postun

- %systemd_postun_with_restart %{snappy_svcs}

- 

- %triggerun -- snapd < 2.39

- # TODO: the trigger relies on a very specific snapd version that introduced SELinux

- # mount context, figure out how to update the trigger condition to run when needed

- 

- # Trigger on uninstall, with one version of the package being pre 2.38 see

- # https://rpm-packaging-guide.github.io/#triggers-and-scriptlets for details

- # when triggers are run

- if [ "$1" -eq 2 -a "$2" -eq 1 ]; then

-    # Upgrade from pre 2.38 version

-    %{_libexecdir}/snapd/snap-mgmt-selinux --patch-selinux-mount-context=system_u:object_r:snappy_snap_t:s0 || :

- 

-    # snapd might have created fontconfig cache directory earlier, but with

-    # incorrect context due to bugs in the policy, make sure it gets the right one

-    # on upgrade when the new policy was introduced

-    if [ -d "%{_localstatedir}/cache/fontconfig" ]; then

-       restorecon -R %{_localstatedir}/cache/fontconfig || :

-    fi

- elif [ "$1" -eq 1 -a "$2" -eq 2 ]; then

-    # Downgrade to a pre 2.38 version

-    %{_libexecdir}/snapd/snap-mgmt-selinux --remove-selinux-mount-context=system_u:object_r:snappy_snap_t:s0 || :

- fi

- 

- %pre selinux

- %selinux_relabel_pre

- 

- %post selinux

- %selinux_modules_install %{_datadir}/selinux/packages/snappy.pp.bz2

- %selinux_relabel_post

- 

- %posttrans selinux

- %selinux_relabel_post

- 

- %postun selinux

- %selinux_modules_uninstall snappy

- if [ $1 -eq 0 ]; then

-     %selinux_relabel_post

- fi

- 

+ %gopkgfiles

  

  %changelog

+ * Wed Aug 07 23:56:08 CEST 2019 Robert-André Mauchin <zebob.m@gmail.com> - 2.40-1

+ - Release 2.40

+ - Drop patches included in this release

+ 

  * Fri Jul 26 2019 Fedora Release Engineering <releng@fedoraproject.org> - 2.39.2-2

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_31_Mass_Rebuild

  

file modified
+2 -2
@@ -1,2 +1,2 @@ 

- SHA512 (snapd_2.39.2.no-vendor.tar.xz) = 5e29ce3dfe3d9b95328643bce28014bf49f1201f823be97a0715be4ad921385b3d3f67c4c1346bf06f716ac10ce6ee365671aad0bcd4c04000df4012209f3a7a

- SHA512 (snapd_2.39.2.only-vendor.tar.xz) = be527b64dd18c6ca68a78300a6d4bd3a2bbf55184fe19ee596b218a02d343944338820d532baf1069220b5f356d01c50ed5dbde979b852c3d83ce2665652e2c2

+ SHA512 (snapd_2.40.no-vendor.tar.xz) = 2c41493c44cae49256cc58941c24f5cea6bdb28e8da1ae6e253ac9e213d9cc3697c9fd836a68cd7fd686157b3d937845037903c33a7aff4ff0cf5fff76048c17

+ SHA512 (snapd_2.40.only-vendor.tar.xz) = ed74c072623f16dd0d1402806b40f498b4e0ae770c903e102081de2a20a8505b2cd0a510bdc4ae11fe28f623c9ed6abeb9d41487f388629e9323e6ded9300d64

Drop patches included in this release

Signed-off-by: Robert-André Mauchin zebob.m@gmail.com

This PR rewrites the SPEC using the new Go macros. This implies this SPEC is only compatible with F31 and above, not EPEL7 or F30.

rebased onto 2b43fdc

4 years ago

Sorry, I can't do this right now because I need to maintain compatibility across all supported Fedora releases and EPEL7.

Pull-Request has been closed by ngompa

4 years ago