Packaging: ignore expected rpmlint warnings
[src/xds/xds-agent.git] / conf.d / packaging / rpm / agl-xds-agent.spec
1 #
2 # spec file for package agl-xds-agent
3 #
4
5 %define _prefix /opt/AGL
6 %global debug_package %{nil}
7
8 Name:           agl-xds-agent
9 Version:        0.0.0
10 Release:        0
11 License:        Apache-2.0
12 Summary:        XDS agent/client tool
13 Url:            https://gerrit.automotivelinux.org/gerrit/p/src/xds/xds-agent.git
14 Source0:        xds-agent_linux-amd64-%{version}.zip
15 Source1:        rpmlintrc
16 BuildRequires:  unzip
17 BuildRoot:      %{_tmppath}/%{name}-%{version}-build
18 Group:          Development/Tools/Debuggers
19
20 # currently embedded with xds
21 # Requires:       syncthing
22
23
24 %description
25 XDS-agent is an client tool that must run on your local machine when you use XDS
26
27 %prep
28 %setup -q -n xds-agent
29
30 %build
31
32 %install
33 mkdir -p %{?buildroot}%{_prefix}/xds/agent %{?buildroot}%{_bindir}
34 cp -r * %{?buildroot}%{_prefix}/xds/agent
35 rm -rf %{?buildroot}%{_prefix}/xds/agent/conf.d
36 ln -s ../xds/agent/xds-agent %{?buildroot}%{_bindir}/xds-agent
37
38 mkdir -p %{?buildroot}%{_userunitdir}
39 cp ./conf.d/usr/lib/systemd/user/xds-agent.service %{?buildroot}%{_userunitdir}
40
41 mkdir -p %{?buildroot}/%{_sysconfdir}/default
42 cp ./conf.d/etc/default/xds-agent %{?buildroot}/%{_sysconfdir}/default/
43
44 mkdir -p %{?buildroot}/%{_sysconfdir}/xds/agent
45 cp ./conf.d/etc/xds/agent/* %{?buildroot}/%{_sysconfdir}/xds/agent/
46
47 mkdir -p %{?buildroot}%{_sysconfdir}/profile.d
48 sed -e "s;@XDS_INSTALL_BIN_DIR@;%{_bindir};g" ./conf.d/etc/profile.d/xds-agent.sh > %{buildroot}%{_sysconfdir}/profile.d/%{name}.sh
49
50
51 %files
52 %defattr(-,root,root)
53 %dir %{_prefix}
54 %dir %{_bindir}
55 %dir %{_prefix}/xds
56 %dir %{_prefix}/xds/agent
57 %{_prefix}/xds/agent/*
58 %{_bindir}/xds-agent
59 %dir %{_sysconfdir}/xds
60 %dir %{_sysconfdir}/xds/agent
61 %config %{_sysconfdir}/default/xds-agent
62 %config %{_sysconfdir}/xds/agent/agent-config.json
63 %config %{_sysconfdir}/profile.d/%{name}.sh
64 %dir %{_userunitdir}
65 %{_userunitdir}/xds-agent.service
66
67 %post
68 if [ "$1" -ge 2 ]; then
69   if [ -f "${_sysconfdir}/xds-agent/config.json" ]; then
70     install -b -S .rpmsave ${_sysconfdir}/xds-agent/config.json ${_sysconfdir}/xds/agent/agent-config.json
71   fi
72 fi
73 exit 0
74
75 %preun
76 if [ "$1" -ge 2 ]; then
77   rm -f %{_sysconfdir}/xds-agent/*.rpm*
78 fi
79 exit 0