commit aws-efs-utils for openSUSE:Factory

2020-11-04 Thread root
Hello community,

here is the log from the commit of package aws-efs-utils for openSUSE:Factory 
checked in at 2020-11-04 18:27:04

Comparing /work/SRC/openSUSE:Factory/aws-efs-utils (Old)
 and  /work/SRC/openSUSE:Factory/.aws-efs-utils.new.11331 (New)


Package is "aws-efs-utils"

Wed Nov  4 18:27:04 2020 rev:6 rq:845817 version:1.17

Changes:

--- /work/SRC/openSUSE:Factory/aws-efs-utils/aws-efs-utils.changes  
2020-02-07 15:57:15.411600020 +0100
+++ /work/SRC/openSUSE:Factory/.aws-efs-utils.new.11331/aws-efs-utils.changes   
2020-11-04 18:32:07.864182457 +0100
@@ -1,0 +2,12 @@
+Tue Nov  3 15:03:24 UTC 2020 - Franck Bui 
+
+- Drop '-f' option with %service_del_preun/%service_del_postun
+
+  With %service_del_preun, the option is already ignored with as
+  support for DISABLE_STOP_ON_REMOVAL has been dropped.
+
+  With %service_del_postun, this option shouldn't be needed besides
+  very few special cases. But this package doesn't seem to belong to
+  this category.
+
+---



Other differences:
--
++ aws-efs-utils.spec ++
--- /var/tmp/diff_new_pack.EkC744/_old  2020-11-04 18:32:08.284181526 +0100
+++ /var/tmp/diff_new_pack.EkC744/_new  2020-11-04 18:32:08.288181517 +0100
@@ -88,10 +88,10 @@
 %service_add_post amazon-efs-mount-watchdog.service
 
 %preun
-%service_del_preun -f amazon-efs-mount-watchdog.service
+%service_del_preun amazon-efs-mount-watchdog.service
 
 %postun
-%service_del_postun -f amazon-efs-mount-watchdog.service
+%service_del_postun amazon-efs-mount-watchdog.service
 
 %files
 %defattr(-,root,root,-)




commit aws-efs-utils for openSUSE:Factory

2020-02-07 Thread root
Hello community,

here is the log from the commit of package aws-efs-utils for openSUSE:Factory 
checked in at 2020-02-07 15:55:56

Comparing /work/SRC/openSUSE:Factory/aws-efs-utils (Old)
 and  /work/SRC/openSUSE:Factory/.aws-efs-utils.new.26092 (New)


Package is "aws-efs-utils"

Fri Feb  7 15:55:56 2020 rev:5 rq:770797 version:1.17

Changes:

--- /work/SRC/openSUSE:Factory/aws-efs-utils/aws-efs-utils.changes  
2019-12-18 14:48:19.621938854 +0100
+++ /work/SRC/openSUSE:Factory/.aws-efs-utils.new.26092/aws-efs-utils.changes   
2020-02-07 15:57:15.411600020 +0100
@@ -1,0 +2,6 @@
+Mon Feb  3 12:03:13 UTC 2020 - Dominique Leuenberger 
+
+- BuildRequire pkgconfig(systemd) instead of systemd: allow OBS to
+  shortcut through the -mini flavors.
+
+---



Other differences:
--
++ aws-efs-utils.spec ++
--- /var/tmp/diff_new_pack.ukiosV/_old  2020-02-07 15:57:16.679600667 +0100
+++ /var/tmp/diff_new_pack.ukiosV/_new  2020-02-07 15:57:16.683600669 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package aws-efs-utils
 #
-# Copyright (c) 2019 SUSE LLC
+# Copyright (c) 2020 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -40,8 +40,8 @@
 BuildRequires:  python3-pytest-metadata >= 1.7.0
 BuildRequires:  python3-pytest-mock >= 1.11.2
 BuildRequires:  python3-six >= 1.11.0
-BuildRequires:  systemd
 BuildRequires:  systemd-rpm-macros
+BuildRequires:  pkgconfig(systemd)
 Requires:   nfs-utils
 Requires:   python3
 Requires:   stunnel >= 4.56




commit aws-efs-utils for openSUSE:Factory

2019-12-18 Thread root
Hello community,

here is the log from the commit of package aws-efs-utils for openSUSE:Factory 
checked in at 2019-12-18 14:45:06

Comparing /work/SRC/openSUSE:Factory/aws-efs-utils (Old)
 and  /work/SRC/openSUSE:Factory/.aws-efs-utils.new.4691 (New)


Package is "aws-efs-utils"

Wed Dec 18 14:45:06 2019 rev:4 rq:757622 version:1.17

Changes:

--- /work/SRC/openSUSE:Factory/aws-efs-utils/aws-efs-utils.changes  
2019-04-11 08:48:00.800542966 +0200
+++ /work/SRC/openSUSE:Factory/.aws-efs-utils.new.4691/aws-efs-utils.changes
2019-12-18 14:48:19.621938854 +0100
@@ -1,0 +2,38 @@
+Tue Dec 17 20:14:25 UTC 2019 - John Paul Adrian Glaubitz 

+
+- Update to version 1.17
+  + Added support for Python 3
+- Enable testsuite which now passes on Python 3
+- Update BuildRequires from requirements.txt
+
+---
+Thu Dec  5 11:42:38 UTC 2019 - John Paul Adrian Glaubitz 

+
+- Update to version 1.16
+  + Support Python 3 for tests
+- from version 1.15
+  + Properly support Python3
+- from version 1.14
+  + Tolerate EFS state directory existing during mount
+- from version 1.13
+  + Change watchdog configuration so it stops after all file systems are 
unmounted
+- from version 1.12
+  + Update stunnel idle timeout
+* The default stunnel idle timeout is many hours. By setting it to a value 
based
+  on the NFS lease length we can recover from network partitions sooner.
+- from version 1.11
+  + Add support for RHEL8
+* Fixes Python shebangs to work on systems without a default "python" 
version.
+* Fixes watchdog process not being properly started on systemd systems.
+- from version 1.10
+  + Update to default configuration that disables OCSP
+* To use OCSP, the client accessing EFS must be able to reach the Amazon 
Certificate
+  Authority (CA). To maximize file system availability in the event that 
the CA is
+  not reachable from your VPC, the EFS mount helper no longer enables OCSP 
by default.
+- Don't enable testsuite as it is currently failing
+  + https://github.com/aws/efs-utils/issues/24
+- Drop patches merged upstream
+  + efs-switchparser.patch
+- Update BuildRequires from requirements.txt
+
+---

Old:

  efs-switchparser.patch
  v1.7.tar.gz

New:

  v1.17.tar.gz



Other differences:
--
++ aws-efs-utils.spec ++
--- /var/tmp/diff_new_pack.XQu5q4/_old  2019-12-18 14:48:20.001939028 +0100
+++ /var/tmp/diff_new_pack.XQu5q4/_new  2019-12-18 14:48:20.001939028 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package aws-efs-utils
 #
-# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,14 +17,29 @@
 
 
 Name:   aws-efs-utils
-Version:1.7
+Version:1.17
 Release:0
 Summary:Utilities for using the EFS file systems
 License:MIT
 Group:  System/Management
-Url:https://github.com/aws/efs-utils
+URL:https://github.com/aws/efs-utils
 Source0:https://github.com/aws/efs-utils/archive/v%{version}.tar.gz
-Patch:  efs-switchparser.patch
+BuildRequires:  python3-attrs >= 17.4.0
+BuildRequires:  python3-coverage >= 4.5
+BuildRequires:  python3-flake8 >= 3.7.9
+BuildRequires:  python3-mccabe >= 0.6.1
+BuildRequires:  python3-mock >= 2.0.0
+BuildRequires:  python3-pbr >= 3.1.1
+BuildRequires:  python3-pluggy >= 0.13.0
+BuildRequires:  python3-py >= 1.8.0
+BuildRequires:  python3-pycodestyle >= 2.5.0
+BuildRequires:  python3-pyflakes >= 2.1.1
+BuildRequires:  python3-pytest >= 4.6.7
+BuildRequires:  python3-pytest-cov >= 2.8.1
+BuildRequires:  python3-pytest-html >= 1.19.0
+BuildRequires:  python3-pytest-metadata >= 1.7.0
+BuildRequires:  python3-pytest-mock >= 1.11.2
+BuildRequires:  python3-six >= 1.11.0
 BuildRequires:  systemd
 BuildRequires:  systemd-rpm-macros
 Requires:   nfs-utils
@@ -38,11 +53,13 @@
 %prep
 %setup -n efs-utils-%{version}
 find . -name "*.py" -exec sed -i 's/env python/python3/' {} +
-%patch  -p1
 
 %build
 # No build required
 
+%check
+make test
+
 %install
 mkdir -p %{buildroot}%{_sysconfdir}/amazon/efs
 mkdir -p %{buildroot}%{_unitdir}

++ v1.7.tar.gz -> v1.17.tar.gz ++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/efs-utils-1.7/Makefile new/efs-utils-1.17/Makefile
--- old/efs-utils-1.7/Makefile  2019-04-09 20:27:34.0 +0200
+++ new/efs-utils-1.17/Makefile 2019-12-17 19:21:01.0 +0100
@@ -45,6 +45,10 @@
 .PHONY: sources
 sources: tarball 

commit aws-efs-utils for openSUSE:Factory

2019-04-11 Thread root
Hello community,

here is the log from the commit of package aws-efs-utils for openSUSE:Factory 
checked in at 2019-04-11 08:47:58

Comparing /work/SRC/openSUSE:Factory/aws-efs-utils (Old)
 and  /work/SRC/openSUSE:Factory/.aws-efs-utils.new.27019 (New)


Package is "aws-efs-utils"

Thu Apr 11 08:47:58 2019 rev:3 rq:692718 version:1.7

Changes:

--- /work/SRC/openSUSE:Factory/aws-efs-utils/aws-efs-utils.changes  
2019-04-04 12:08:06.897400144 +0200
+++ /work/SRC/openSUSE:Factory/.aws-efs-utils.new.27019/aws-efs-utils.changes   
2019-04-11 08:48:00.800542966 +0200
@@ -1,0 +2,18 @@
+Tue Apr  9 22:29:17 UTC 2019 - John Paul Adrian Glaubitz 

+
+- Update to version 1.7
+  + subprocess usage: explicitly pass `close_fds = True`
+  + state_file_dir: choose safe default mode, make mode configurable
+  + choose_tls_port(): reuse socket and explicitly close it in all cases
+  + watchdog: be robust against unrelated localhost based nfs mounts
+- Drop hardening patches merged upstream
+  + 0001-subprocess-usage-explicitly-pass-close_fds-True.patch
+  + 0002-state_file_dir-choose-safe-default-mode-make-mode-co.patch
+  + 0003-pytest-adjust-tests-to-new-state_file_dir_mode-confi.patch
+  + 0004-choose_tls_port-reuse-socket-and-explicitly-close-it.patch
+  + 0005-watchdog-be-robust-against-unrelated-localhost-based.patch
+- from version 1.6
+  + fix for additional unexpected arguments
+  + add test for additional unexpected arguments
+
+---

Old:

  0001-subprocess-usage-explicitly-pass-close_fds-True.patch
  0002-state_file_dir-choose-safe-default-mode-make-mode-co.patch
  0003-pytest-adjust-tests-to-new-state_file_dir_mode-confi.patch
  0004-choose_tls_port-reuse-socket-and-explicitly-close-it.patch
  0005-watchdog-be-robust-against-unrelated-localhost-based.patch
  v1.5.tar.gz

New:

  v1.7.tar.gz



Other differences:
--
++ aws-efs-utils.spec ++
--- /var/tmp/diff_new_pack.3arsdj/_old  2019-04-11 08:48:01.600543791 +0200
+++ /var/tmp/diff_new_pack.3arsdj/_new  2019-04-11 08:48:01.600543791 +0200
@@ -17,7 +17,7 @@
 
 
 Name:   aws-efs-utils
-Version:1.5
+Version:1.7
 Release:0
 Summary:Utilities for using the EFS file systems
 License:MIT
@@ -25,12 +25,6 @@
 Url:https://github.com/aws/efs-utils
 Source0:https://github.com/aws/efs-utils/archive/v%{version}.tar.gz
 Patch:  efs-switchparser.patch
-# Hardening patches (see: https://github.com/aws/efs-utils/pull/26 and 
bsc#1125133)
-Patch1: 0001-subprocess-usage-explicitly-pass-close_fds-True.patch
-Patch2: 0002-state_file_dir-choose-safe-default-mode-make-mode-co.patch
-Patch3: 0003-pytest-adjust-tests-to-new-state_file_dir_mode-confi.patch
-Patch4: 0004-choose_tls_port-reuse-socket-and-explicitly-close-it.patch
-Patch5: 0005-watchdog-be-robust-against-unrelated-localhost-based.patch
 BuildRequires:  systemd
 BuildRequires:  systemd-rpm-macros
 Requires:   nfs-utils
@@ -44,12 +38,7 @@
 %prep
 %setup -n efs-utils-%{version}
 find . -name "*.py" -exec sed -i 's/env python/python3/' {} +
-%patch
-%patch1 -p1
-%patch2 -p1
-%patch3 -p1
-%patch4 -p1
-%patch5 -p1
+%patch  -p1
 
 %build
 # No build required

++ efs-switchparser.patch ++
--- /var/tmp/diff_new_pack.3arsdj/_old  2019-04-11 08:48:01.636543828 +0200
+++ /var/tmp/diff_new_pack.3arsdj/_new  2019-04-11 08:48:01.636543828 +0200
@@ -1,6 +1,7 @@
 src/mount_efs/__init__.py.orig
-+++ src/mount_efs/__init__.py
-@@ -44,9 +44,9 @@ from contextlib import contextmanager
+diff -Nru efs-utils-1.7.orig/src/mount_efs/__init__.py 
efs-utils-1.7/src/mount_efs/__init__.py
+--- efs-utils-1.7.orig/src/mount_efs/__init__.py   2019-04-09 
20:27:34.0 +0200
 efs-utils-1.7/src/mount_efs/__init__.py2019-04-09 23:59:43.477327640 
+0200
+@@ -44,9 +44,9 @@
  from logging.handlers import RotatingFileHandler
  
  try:
@@ -12,7 +13,7 @@
  
  try:
  from urllib2 import urlopen, URLError
-@@ -517,7 +517,7 @@ def assert_root():
+@@ -537,7 +537,7 @@
  
  
  def read_config(config_file=CONFIG_FILE):
@@ -21,9 +22,10 @@
  p.read(config_file)
  return p
  
 src/watchdog/__init__.py.orig
-+++ src/watchdog/__init__.py
-@@ -21,9 +21,9 @@ from logging.handlers import RotatingFil
+diff -Nru efs-utils-1.7.orig/src/watchdog/__init__.py 
efs-utils-1.7/src/watchdog/__init__.py
+--- efs-utils-1.7.orig/src/watchdog/__init__.py2019-04-09 
20:27:34.0 +0200
 efs-utils-1.7/src/watchdog/__init__.py 2019-04-09 23:59:43.477327640 
+0200
+@@ -21,9 +21,9 @@
  from signal import SIGTERM
  
  try:
@@ -33,9 +35,9 @@
 -from configparser import ConfigParser
 +import 

commit aws-efs-utils for openSUSE:Factory

2019-04-04 Thread root
Hello community,

here is the log from the commit of package aws-efs-utils for openSUSE:Factory 
checked in at 2019-04-04 12:07:59

Comparing /work/SRC/openSUSE:Factory/aws-efs-utils (Old)
 and  /work/SRC/openSUSE:Factory/.aws-efs-utils.new.3908 (New)


Package is "aws-efs-utils"

Thu Apr  4 12:07:59 2019 rev:2 rq:691287 version:1.5

Changes:

--- /work/SRC/openSUSE:Factory/aws-efs-utils/aws-efs-utils.changes  
2019-02-28 21:39:30.429619356 +0100
+++ /work/SRC/openSUSE:Factory/.aws-efs-utils.new.3908/aws-efs-utils.changes
2019-04-04 12:08:06.897400144 +0200
@@ -1,0 +2,10 @@
+Wed Apr  3 08:38:34 UTC 2019 - John Paul Adrian Glaubitz 

+
+- Include hardening and robustness fixes from security audit (bsc#1125133)
+  + 0001-subprocess-usage-explicitly-pass-close_fds-True.patch
+  + 0002-state_file_dir-choose-safe-default-mode-make-mode-co.patch
+  + 0003-pytest-adjust-tests-to-new-state_file_dir_mode-confi.patch
+  + 0004-choose_tls_port-reuse-socket-and-explicitly-close-it.patch
+  + 0005-watchdog-be-robust-against-unrelated-localhost-based.patch
+
+---

New:

  0001-subprocess-usage-explicitly-pass-close_fds-True.patch
  0002-state_file_dir-choose-safe-default-mode-make-mode-co.patch
  0003-pytest-adjust-tests-to-new-state_file_dir_mode-confi.patch
  0004-choose_tls_port-reuse-socket-and-explicitly-close-it.patch
  0005-watchdog-be-robust-against-unrelated-localhost-based.patch



Other differences:
--
++ aws-efs-utils.spec ++
--- /var/tmp/diff_new_pack.TQM2CR/_old  2019-04-04 12:08:08.481398642 +0200
+++ /var/tmp/diff_new_pack.TQM2CR/_new  2019-04-04 12:08:08.485398638 +0200
@@ -1,5 +1,5 @@
 #
-# spec file for package amazon-efs-utils
+# spec file for package aws-efs-utils
 #
 # Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
 #
@@ -12,9 +12,10 @@
 # license that conforms to the Open Source Definition (Version 1.9)
 # published by the Open Source Initiative.
 
-# Please submit bugfixes or comments via http://bugs.opensuse.org/
+# Please submit bugfixes or comments via https://bugs.opensuse.org/
 #
 
+
 Name:   aws-efs-utils
 Version:1.5
 Release:0
@@ -24,6 +25,12 @@
 Url:https://github.com/aws/efs-utils
 Source0:https://github.com/aws/efs-utils/archive/v%{version}.tar.gz
 Patch:  efs-switchparser.patch
+# Hardening patches (see: https://github.com/aws/efs-utils/pull/26 and 
bsc#1125133)
+Patch1: 0001-subprocess-usage-explicitly-pass-close_fds-True.patch
+Patch2: 0002-state_file_dir-choose-safe-default-mode-make-mode-co.patch
+Patch3: 0003-pytest-adjust-tests-to-new-state_file_dir_mode-confi.patch
+Patch4: 0004-choose_tls_port-reuse-socket-and-explicitly-close-it.patch
+Patch5: 0005-watchdog-be-robust-against-unrelated-localhost-based.patch
 BuildRequires:  systemd
 BuildRequires:  systemd-rpm-macros
 Requires:   nfs-utils
@@ -38,6 +45,11 @@
 %setup -n efs-utils-%{version}
 find . -name "*.py" -exec sed -i 's/env python/python3/' {} +
 %patch
+%patch1 -p1
+%patch2 -p1
+%patch3 -p1
+%patch4 -p1
+%patch5 -p1
 
 %build
 # No build required

++ 0001-subprocess-usage-explicitly-pass-close_fds-True.patch ++
>From fbd8d90c88ee26e6020bae0983db7214464a4c46 Mon Sep 17 00:00:00 2001
From: Matthias Gerstner 
Date: Wed, 20 Feb 2019 09:43:15 +0100
Subject: [PATCH 1/6] subprocess usage: explicitly pass `close_fds = True`

In python2 the default for `close_fds` is still False, therefore it is
possible that open file descriptors like the logfile are inherited to
child processes. This is prevented by explicitly passing this parameter
to all subprocess invocations.
---
 src/mount_efs/__init__.py | 18 ++
 src/watchdog/__init__.py  |  2 +-
 2 files changed, 11 insertions(+), 9 deletions(-)

diff --git a/src/mount_efs/__init__.py b/src/mount_efs/__init__.py
index 833158f..8b15409 100755
--- a/src/mount_efs/__init__.py
+++ b/src/mount_efs/__init__.py
@@ -235,7 +235,7 @@ def is_stunnel_option_supported(stunnel_output, 
stunnel_option_name):
 
 
 def get_version_specific_stunnel_options(config):
-proc = subprocess.Popen(['stunnel', '-help'], stdout=subprocess.PIPE, 
stderr=subprocess.PIPE)
+proc = subprocess.Popen(['stunnel', '-help'], stdout=subprocess.PIPE, 
stderr=subprocess.PIPE, close_fds=True)
 proc.wait()
 _, err = proc.communicate()
 
@@ -355,7 +355,7 @@ def check_network_status(fs_id, init_system):
 return
 
 with open(os.devnull, 'w') as devnull:
-rc = subprocess.call(['systemctl', 'status', 'network.target'], 
stdout=devnull, stderr=devnull)
+rc = subprocess.call(['systemctl', 'status', 'network.target'], 
stdout=devnull, 

commit aws-efs-utils for openSUSE:Factory

2019-02-28 Thread root
Hello community,

here is the log from the commit of package aws-efs-utils for openSUSE:Factory 
checked in at 2019-02-28 21:39:30

Comparing /work/SRC/openSUSE:Factory/aws-efs-utils (Old)
 and  /work/SRC/openSUSE:Factory/.aws-efs-utils.new.28833 (New)


Package is "aws-efs-utils"

Thu Feb 28 21:39:30 2019 rev:1 rq:676163 version:1.5

Changes:

New Changes file:

--- /dev/null   2018-10-29 14:05:42.522318975 +0100
+++ /work/SRC/openSUSE:Factory/.aws-efs-utils.new.28833/aws-efs-utils.changes   
2019-02-28 21:39:30.429619356 +0100
@@ -0,0 +1,22 @@
+---
+Thu Feb 14 14:54:30 UTC 2019 - Robert Schweikert 
+
+- Rename from amazon-efs-utils to aws-efs-utils
+
+---
+Thu Feb 14 00:56:12 UTC 2019 - Robert Schweikert 
+
+- Support Python 3.2 and later
+  + Add efs-switchparser.patch
+  + SafeConfigParser is no longer available, use ConfigParser
+
+---
+Mon Feb 11 18:20:10 UTC 2019 - Jan Engelhardt 
+
+- Ensure neutrality of descriptions.
+
+---
+Sat Feb  9 09:21:23 UTC 2019 - John Paul Adrian Glaubitz 

+
+- Initial build (bsc#1101451, fate#327220, bsc#1124652, fate#327221)
+  + Version 1.5

New:

  aws-efs-utils.changes
  aws-efs-utils.spec
  efs-switchparser.patch
  v1.5.tar.gz



Other differences:
--
++ aws-efs-utils.spec ++
#
# spec file for package amazon-efs-utils
#
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via http://bugs.opensuse.org/
#

Name:   aws-efs-utils
Version:1.5
Release:0
Summary:Utilities for using the EFS file systems
License:MIT
Group:  System/Management
Url:https://github.com/aws/efs-utils
Source0:https://github.com/aws/efs-utils/archive/v%{version}.tar.gz
Patch:  efs-switchparser.patch
BuildRequires:  systemd
BuildRequires:  systemd-rpm-macros
Requires:   nfs-utils
Requires:   python3
Requires:   stunnel >= 4.56
BuildArch:  noarch

%description
This package provides utilities for using the EFS file systems.

%prep
%setup -n efs-utils-%{version}
find . -name "*.py" -exec sed -i 's/env python/python3/' {} +
%patch

%build
# No build required

%install
mkdir -p %{buildroot}%{_sysconfdir}/amazon/efs
mkdir -p %{buildroot}%{_unitdir}
install -p -m 644 
%{_builddir}/efs-utils-%{version}/dist/amazon-efs-mount-watchdog.service 
%{buildroot}%{_unitdir}

mkdir -p %{buildroot}/sbin
mkdir -p %{buildroot}/usr/sbin
mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_localstatedir}/log/amazon/efs
mkdir -p %{buildroot}%{_mandir}/man8
mkdir -p %{buildroot}%{_sysconfdir}/amazon/efs

install -p -m 644 %{_builddir}/efs-utils-%{version}/dist/efs-utils.conf 
%{buildroot}%{_sysconfdir}/amazon/efs
install -p -m 444 %{_builddir}/efs-utils-%{version}/dist/efs-utils.crt 
%{buildroot}%{_sysconfdir}/amazon/efs
install -p -m 755 %{_builddir}/efs-utils-%{version}/src/mount_efs/__init__.py 
%{buildroot}/sbin/mount.efs
install -p -m 755 %{_builddir}/efs-utils-%{version}/src/watchdog/__init__.py 
%{buildroot}%{_bindir}/amazon-efs-mount-watchdog
install -p -m 644 %{_builddir}/efs-utils-%{version}/man/mount.efs.8 
%{buildroot}%{_mandir}/man8

# Create rc-link
for srv_name in %{buildroot}%{_unitdir}/*.service; do rc_name=$(basename -s 
'.service' $srv_name); ln -s service %{buildroot}%{_sbindir}/rc$rc_name; done

%pre
%service_add_pre amazon-efs-mount-watchdog.service

%post
%service_add_post amazon-efs-mount-watchdog.service

%preun
%service_del_preun -f amazon-efs-mount-watchdog.service

%postun
%service_del_postun -f amazon-efs-mount-watchdog.service

%files
%defattr(-,root,root,-)
%doc NOTICE README.md
%license LICENSE
%{_unitdir}/amazon-efs-mount-watchdog.service
%{_sysconfdir}/amazon
%config %{_sysconfdir}/amazon/efs/efs-utils.conf
%config %{_sysconfdir}/amazon/efs/efs-utils.crt
/sbin/mount.efs
%{_bindir}/amazon-efs-mount-watchdog
%{_sbindir}/rcamazon-efs-mount-watchdog
/var/log/amazon
%{_mandir}/man8/mount.efs.8.gz

%changelog