File aws-efs-utils.spec of Package aws-efs-utils.11049

# spec file for package aws-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

Name:           aws-efs-utils
Version:        1.7
Release:        0
Summary:        Utilities for using the EFS file systems
License:        MIT
Group:          System/Management
Patch:          efs-switchparser.patch
BuildRequires:  systemd
BuildRequires:  systemd-rpm-macros
Requires:       nfs-utils
Requires:       python3
Requires:       stunnel >= 4.56
BuildArch:      noarch

This package provides utilities for using the EFS file systems.

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

# No build required

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/ %{buildroot}/sbin/mount.efs
install -p -m 755 %{_builddir}/efs-utils-%{version}/src/watchdog/ %{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

%service_add_pre amazon-efs-mount-watchdog.service

%service_add_post amazon-efs-mount-watchdog.service

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

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

%license LICENSE
%config %{_sysconfdir}/amazon/efs/efs-utils.conf
%config %{_sysconfdir}/amazon/efs/efs-utils.crt

openSUSE Build Service is sponsored by