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
17 BuildRoot: %{_tmppath}/%{name}-%{version}-build
18 Group: Development/Tools/Debuggers
20 # currently embedded with xds
25 XDS-agent is an client tool that must run on your local machine when you use XDS
28 %setup -q -n xds-agent
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
38 mkdir -p %{?buildroot}%{_userunitdir}
39 cp ./conf.d/usr/lib/systemd/user/xds-agent.service %{?buildroot}%{_userunitdir}
41 mkdir -p %{?buildroot}/%{_sysconfdir}/default
42 cp ./conf.d/etc/default/xds-agent %{?buildroot}/%{_sysconfdir}/default/
44 mkdir -p %{?buildroot}/%{_sysconfdir}/xds/agent
45 cp ./conf.d/etc/xds/agent/* %{?buildroot}/%{_sysconfdir}/xds/agent/
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
56 %dir %{_prefix}/xds/agent
57 %{_prefix}/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
65 %{_userunitdir}/xds-agent.service
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
76 if [ "$1" -ge 2 ]; then
77 rm -f %{_sysconfdir}/xds-agent/*.rpm*