File amazon-ecs-init.spec of Package amazon-ecs-init.10946

# spec file for package amazon-ecs-init
# 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

%define short_name amazon-ecs
Name:           amazon-ecs-init
Version:        1.18.0
Release:        0
Summary:        Amazon EC2 Container Service Initialization
License:        Apache-2.0
Group:          System Environment/Base
Source0:        %{name}-%{version}-1.tar.gz
Source1:        %{short_name}.service
Patch0:         reproducible.patch
BuildRequires:  go
BuildRequires:  systemd
%if 0%{?is_opensuse}
Requires:       docker >= 1.6.0
# We cannot handle cross module dependencies properly, i.e. one module can
# onlyd depend on one other module, instead of having a one to many
# dependency construct.
Recommends:     docker >= 1.6.0
Requires:       systemd
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
ExclusiveArch:  %ix86 x86_64

The Amazon EC2 Container Service initialization will start the ECS agent.
The ECS agent runs in a container and is needed to support integration
between the aws-cli ecs command line tool and an instance running in
Amazon EC2.

%setup -q -n %{name}-%{version}-1
%patch0 -p1

./scripts/ suse
gzip -c scripts/amazon-ecs-init.1 > scripts/amazon-ecs-init.1.gz

install -d -m 755 %{buildroot}/%{_mandir}/man1
install -d -m 755 %{buildroot}/%{_sbindir}
install -d -m 755 %{buildroot}/%{_sysconfdir}/ecs
install -m 644 scripts/amazon-ecs-init.1.gz %{buildroot}/%{_mandir}/man1
install -m 755 amazon-ecs-init %{buildroot}/%{_sbindir}

mkdir -p %{buildroot}/%{_unitdir}
install -m 755 %SOURCE1 %{buildroot}/%{_unitdir}

touch %{buildroot}/%{_sysconfdir}/ecs/ecs.config
touch %{buildroot}/%{_sysconfdir}/ecs/ecs.config.json

mkdir -p %{buildroot}/%{_localstatedir}/cache/ecs
touch %{buildroot}/%{_localstatedir}/cache/ecs/ecs-agent.tar
touch %{buildroot}/%{_localstatedir}/cache/ecs/state

%dir %{_sysconfdir}/ecs
%dir %{_localstatedir}/cache/ecs
%config(noreplace) %{_sysconfdir}/ecs/ecs.config
%config(noreplace) %{_sysconfdir}/ecs/ecs.config.json

%service_add_pre %{short_name}.service

%service_del_preun %{short_name}.service

%service_add_post %{short_name}.service

%service_del_postun %{short_name}.service

openSUSE Build Service is sponsored by