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