-
Notifications
You must be signed in to change notification settings - Fork 241
/
Copy pathbuild.spec
67 lines (56 loc) · 1.99 KB
/
build.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
59
60
61
62
63
64
65
66
67
Summary: ADOT Collector
Name: %{RPM_NAME}
Version: %{VERSION}
Release: 1
License: Apache 2.0
Group: Applications/AWS
Source0: %{RPM_NAME}-%{VERSION}.tar.gz
%description
This package provides daemon of ADOT Collector
%prep
%setup -q
%install
rm -rf ${RPM_BUILD_ROOT}
mkdir -p ${RPM_BUILD_ROOT}
cp -fa * ${RPM_BUILD_ROOT}
%files
%dir /opt/aws/aws-otel-collector
%dir /opt/aws/aws-otel-collector/bin
%dir /opt/aws/aws-otel-collector/doc
%dir /opt/aws/aws-otel-collector/etc
%dir %attr(750, aoc, aoc) /opt/aws/aws-otel-collector/logs
%dir %attr(750, aoc, aoc) /opt/aws/aws-otel-collector/var
%dir %attr(750, aoc, aoc) /opt/aws/aws-otel-collector/etc
/opt/aws/aws-otel-collector/bin/aws-otel-collector
/opt/aws/aws-otel-collector/bin/aws-otel-collector-ctl
/opt/aws/aws-otel-collector/bin/VERSION
/opt/aws/aws-otel-collector/LICENSE
/opt/aws/aws-otel-collector/RELEASE_NOTE
%attr(640, aoc, aoc) /opt/aws/aws-otel-collector/var/.config.yaml
%attr(640, aoc, aoc) /opt/aws/aws-otel-collector/etc/.env
%attr(640, aoc, aoc) /opt/aws/aws-otel-collector/etc/extracfg.txt
/etc/init/aws-otel-collector.conf
/etc/systemd/system/aws-otel-collector.service
/usr/bin/aws-otel-collector-ctl
/etc/amazon/aws-otel-collector
/var/log/amazon/aws-otel-collector
/var/run/amazon/aws-otel-collector
%pre
# Stop the agent before upgrades.
if [ $1 -ge 2 ]; then
if [ -x /opt/aws/aws-otel-collector/bin/aws-otel-collector-ctl ]; then
/opt/aws/aws-otel-collector/bin/aws-otel-collector-ctl -a stop
fi
fi
# create group
if ! grep "^aoc:" /etc/group >/dev/null 2>&1; then
groupadd -r aoc >/dev/null 2>&1
echo "create group aoc, result: $?"
fi
# create user
if ! id aoc >/dev/null 2>&1; then
useradd -r -M aoc -d /home/aoc -g aoc -c "ADOT Collector" -s $(test -x /sbin/nologin && echo /sbin/nologin || (test -x /usr/sbin/nologin && echo /usr/sbin/nologin || (test -x /bin/false && echo /bin/false || echo /bin/sh))) >/dev/null 2>&1
echo "create user aoc, result: $?"
fi
%clean
rm -rf ${RPM_BUILD_ROOT}