File amazon-ecs-init.spec of Package amazon-ecs-init
xxxxxxxxxx
1
#
2
# spec file for package amazon-ecs-init
3
#
4
# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
5
#
6
# All modifications and additions to the file contributed by third parties
7
# remain the property of their copyright owners, unless otherwise agreed
8
# upon. The license for this file, and modifications and additions to the
9
# file, is the same license as for the pristine package itself (unless the
10
# license for the pristine package is not an Open Source License, in which
11
# case the license is the MIT License). An "Open Source License" is a
12
# license that conforms to the Open Source Definition (Version 1.9)
13
# published by the Open Source Initiative.
14
15
# Please submit bugfixes or comments via https://bugs.opensuse.org/
16
#
17
18
19
%define short_name amazon-ecs
20
Name: amazon-ecs-init
21
Version: 1.18.0
22
Release: 0
23
Summary: Amazon EC2 Container Service Initialization
24
License: Apache-2.0
25
Group: System Environment/Base
26
Url: https://github.com/aws/amazon-ecs-init
27
Source0: %{name}-%{version}-1.tar.gz
28
Source1: %{short_name}.service
29
Patch0: reproducible.patch
30
BuildRequires: go
31
BuildRequires: systemd
32
%if 0%{?is_opensuse}
33
Requires: docker >= 1.6.0
34
%else
35
# We cannot handle cross module dependencies properly, i.e. one module can
36
# onlyd depend on one other module, instead of having a one to many
37
# dependency construct.
38
Recommends: docker >= 1.6.0
39
%endif
40
Requires: systemd
41
BuildRoot: %{_tmppath}/%{name}-%{version}-build
42
ExclusiveArch: %ix86 x86_64 aarch64
43
44
%description
45
The Amazon EC2 Container Service initialization will start the ECS agent.
46
The ECS agent runs in a container and is needed to support integration
47
between the aws-cli ecs command line tool and an instance running in
48
Amazon EC2.
49
50
%prep
51
%setup -q -n %{name}-%{version}-1
52
%patch0 -p1
53
54
%build
55
./scripts/gobuild.sh suse
56
gzip -c scripts/amazon-ecs-init.1 > scripts/amazon-ecs-init.1.gz
57
58
%install
59
install -d -m 755 %{buildroot}/%{_mandir}/man1
60
install -d -m 755 %{buildroot}/%{_sbindir}
61
install -d -m 755 %{buildroot}/%{_sysconfdir}/ecs
62
install -m 644 scripts/amazon-ecs-init.1.gz %{buildroot}/%{_mandir}/man1
63
install -m 755 amazon-ecs-init %{buildroot}/%{_sbindir}
64
65
mkdir -p %{buildroot}/%{_unitdir}
66
install -m 755 %SOURCE1 %{buildroot}/%{_unitdir}
67
68
touch %{buildroot}/%{_sysconfdir}/ecs/ecs.config
69
touch %{buildroot}/%{_sysconfdir}/ecs/ecs.config.json
70
71
mkdir -p %{buildroot}/%{_localstatedir}/cache/ecs
72
touch %{buildroot}/%{_localstatedir}/cache/ecs/ecs-agent.tar
73
touch %{buildroot}/%{_localstatedir}/cache/ecs/state
74
75
%files
76
%defattr(-,root,root,-)
77
%dir %{_sysconfdir}/ecs
78
%dir %{_localstatedir}/cache/ecs
79
%doc CONTRIBUTING.md LICENSE NOTICE README.md
80
%config(noreplace) %{_sysconfdir}/ecs/ecs.config
81
%config(noreplace) %{_sysconfdir}/ecs/ecs.config.json
82
%{_mandir}/man*/*
83
%{_sbindir}/*
84
%{_unitdir}/%{short_name}.service
85
%{_localstatedir}/cache/ecs/ecs-agent.tar
86
%{_localstatedir}/cache/ecs/state
87
88
%pre
89
%service_add_pre %{short_name}.service
90
91
%preun
92
%service_del_preun %{short_name}.service
93
94
%post
95
%service_add_post %{short_name}.service
96
97
%postun
98
%service_del_postun %{short_name}.service
99
100
%changelog
101