2 # spec file for package agl-xds-agent
5 %define _prefix /opt/AGL
6 %global debug_package %{nil}
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
16 BuildRoot: %{_tmppath}/%{name}-%{version}-build
17 Group: Development/Tools/Debuggers
19 # currently embedded with xds
24 XDS-agent is an client tool that must run on your local machine when you use XDS
27 %setup -q -n xds-agent
32 mkdir -p %{?buildroot}%{_prefix}/xds/agent %{?buildroot}%{_bindir}
33 cp -r * %{?buildroot}%{_prefix}/xds/agent
34 rm -rf %{?buildroot}%{_prefix}/xds/agent/conf.d
35 ln -s ../xds/agent/xds-agent %{?buildroot}%{_bindir}/xds-agent
37 mkdir -p %{?buildroot}%{_userunitdir}
38 cp ./conf.d/usr/lib/systemd/user/xds-agent.service %{?buildroot}%{_userunitdir}
40 mkdir -p %{?buildroot}/%{_sysconfdir}/default
41 cp ./conf.d/etc/default/xds-agent %{?buildroot}/%{_sysconfdir}/default/
43 mkdir -p %{?buildroot}/%{_sysconfdir}/xds/agent
44 cp ./conf.d/etc/xds/agent/* %{?buildroot}/%{_sysconfdir}/xds/agent/
46 mkdir -p %{?buildroot}%{_sysconfdir}/profile.d
47 sed -e "s;@XDS_INSTALL_BIN_DIR@;%{_bindir};g" ./conf.d/etc/profile.d/xds-agent.sh > %{buildroot}%{_sysconfdir}/profile.d/%{name}.sh
55 %dir %{_prefix}/xds/agent
56 %{_prefix}/xds/agent/*
58 %dir %{_sysconfdir}/xds
59 %dir %{_sysconfdir}/xds/agent
60 %config %{_sysconfdir}/default/xds-agent
61 %config %{_sysconfdir}/xds/agent/agent-config.json
62 %config %{_sysconfdir}/profile.d/%{name}.sh
64 %{_userunitdir}/xds-agent.service
67 if [ "$1" -ge 2 ]; then
68 if [ -f "${_sysconfdir}/xds-agent/config.json" ]; then
69 install -b -S .rpmsave ${_sysconfdir}/xds-agent/config.json ${_sysconfdir}/xds/agent/agent-config.json
75 if [ "$1" -ge 2 ]; then
76 rm -f %{_sysconfdir}/xds-agent/*.rpm*