-
Notifications
You must be signed in to change notification settings - Fork 2
/
mozart-fetcher.spec
58 lines (50 loc) · 2.06 KB
/
mozart-fetcher.spec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
Name: mozart-fetcher
Version: %{version}
Release: 1%{?dist}
License: MPL-2.0
Group: Development/Frameworks
URL: https://github.com/bbc/mozart-fetcher
Summary: Fans-out requests and returns aggregated content
Packager: BBC News Frameworks and Tools
Source0: mozart_fetcher.tar.gz
Source1: mozart-fetcher.service
Source2: bake-scripts.tar.gz
Source3: component-status-cfn-signal.sh
Source4: cloudformation-signal.service
BuildRoot: /root/rpmbuild
BuildArch: x86_64
Requires: amazon-cloudwatch-agent
Requires: component-logger
Requires: aws-cfn-bootstrap
%description
mozart-fetcher is a service for fetching multiple components
in parallel and aggregating the responses.
%pre
/usr/bin/getent group component >/dev/null || groupadd -r component
/usr/bin/getent passwd component >/dev/null || useradd -r -g component -G component -s /sbin/nologin -c 'component service' component
%install
mkdir -p %{buildroot}/home/component
mkdir -p %{buildroot}/home/component/mozart-fetcher
mkdir -p %{buildroot}/usr/lib/systemd/system
mkdir -p %{buildroot}/etc/bake-scripts/%{name}
tar -C %{buildroot}/home/component/mozart-fetcher -xzf %{SOURCE0}
tar -C %{buildroot}/etc/bake-scripts/%{name} -xzf %{SOURCE2} --strip 1
cp %{SOURCE1} %{buildroot}/usr/lib/systemd/system/mozart-fetcher.service
mkdir -p %{buildroot}/etc/systemd/system/mozart-fetcher.service.d
touch %{buildroot}/etc/systemd/system/mozart-fetcher.service.d/env.conf
cp %{SOURCE3} %{buildroot}/home/component/component-status-cfn-signal.sh
cp %{SOURCE4} %{buildroot}/usr/lib/systemd/system/cloudformation-signal.service
mkdir -p %{buildroot}/var/log/component
touch %{buildroot}/var/log/component/app.log
%post
systemctl enable mozart-fetcher
systemctl enable cloudformation-signal
/bin/chown -R component:component /home/component
/bin/chown -R component:component /var/log/component
%files
%attr(0755, component, component) /home/component/*
/usr/lib/systemd/system/cloudformation-signal.service
/usr/lib/systemd/system/mozart-fetcher.service
/var/log/component/app.log
/etc/bake-scripts/%{name}
/etc/systemd/system/mozart-fetcher.service.d/env.conf