# # spec file for package agl-xds-server # %define _prefix /opt/AGL %global debug_package %{nil} Name: agl-xds-server Version: 0.0.0 Release: 0 License: Apache-2.0 Summary: XDS-server Url: https://gerrit.automotivelinux.org/gerrit/p/src/xds/xds-server.git Source0: xds-server_linux-amd64-%{version}.zip Source1: rpmlintrc BuildRequires: unzip BuildRoot: %{_tmppath}/%{name}-%{version}-build Group: Development/Tools/Debuggers # for now still embedded with xds # Requires: jq syncthing Requires: jq %description xds-server is a web server that allows user to remotely cross build applications. %prep %setup -q -n xds-server %build %install mkdir -p %{?buildroot}%{_prefix}/xds/server %{?buildroot}%{_bindir} cp -r * %{?buildroot}%{_prefix}/xds/server/ rm -rf %{?buildroot}%{_prefix}/xds/server/conf.d ln -s ../xds/server/xds-server %{?buildroot}%{_bindir}/xds-server ln -s ../xds/server/syncthing %{?buildroot}%{_bindir}/syncthing ln -s ../xds/server/syncthing-inotify %{?buildroot}%{_bindir}/syncthing-inotify mkdir -p %{?buildroot}%{_userunitdir} cp ./conf.d/usr/lib/systemd/user/xds-server.service %{?buildroot}%{_userunitdir} mkdir -p %{?buildroot}/%{_sysconfdir}/default cp ./conf.d/etc/default/xds-server %{?buildroot}/%{_sysconfdir}/default/ mkdir -p %{?buildroot}/%{_sysconfdir}/xds/server cp ./conf.d/etc/xds/server/* %{?buildroot}/%{_sysconfdir}/xds/server/ mkdir -p %{?buildroot}%{_userunitdir}/default.target.wants && ln -s ../xds-server.service %{?buildroot}%{_userunitdir}/default.target.wants/ mkdir -p %{?buildroot}%{_sysconfdir}/profile.d sed -e "s;@XDS_INSTALL_BIN_DIR@;%{_bindir};g" ./conf.d/etc/profile.d/xds-server.sh > %{buildroot}%{_sysconfdir}/profile.d/%{name}.sh %files %defattr(-,root,root) %dir %{_prefix} %dir %{_bindir} %dir %{_prefix}/xds %dir %{_prefix}/xds/server %{_prefix}/xds/server/* %{_bindir}/xds-server %{_bindir}/syncthing %{_bindir}/syncthing-inotify %dir %{_sysconfdir}/xds %dir %{_sysconfdir}/xds/server %config %{_sysconfdir}/default/xds-server %config %{_sysconfdir}/xds/server/* %config %{_sysconfdir}/profile.d/%{name}.sh %dir %{_userunitdir} %{_userunitdir}/xds-server.service %dir %{_userunitdir}/default.target.wants %{_userunitdir}/default.target.wants/xds-server.service %post if [ "$1" -ge 2 ]; then if [ -f "${_sysconfdir}/xds-server/config.json" ]; then install -b -S .rpmsave ${_sysconfdir}/xds-server/config.json ${_sysconfdir}/xds/server/server-config.json fi fi exit 0 %preun if [ "$1" -ge 2 ]; then rm -f %{_sysconfdir}/xds-server/*.rpm* fi exit 0