--- /dev/null
+[Unit]
+Description=RemoteControl Daemon
+After=syslog.target
+
+[Service]
+ExecStart=/usr/bin/start-remoteserver
+ExecReload=/bin/kill -HUP $MAINPID
+KillMode=process
+Restart=always
+StandardOutput=syslog
+
+[Install]
+WantedBy=multi-user.target
+
Url: https://github.com/otcshare/remotecontrol
Summary: Remote Control App
Source: remotecontrol-%{version}.tar.bz2
+Source1: remotecontrol.service
BuildRequires: pkgconfig(python)
BuildRequires: python-setuptools
Requires: python
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
+mkdir -p $RPM_BUILD_ROOT/%{_libdir}/systemd/system/graphical.target.wants
+install -m 0644 %{SOURCE1} $RPM_BUILD_ROOT/%{_libdir}/systemd/system/
+ln -sf ../remotecontrol.service $RPM_BUILD_ROOT/%{_libdir}/systemd/system/graphical.target.wants/remotecontrol.service
+
%files
%defattr(-,root,root,-)
%doc README
%{python_sitelib}/*
%{_bindir}/start-remoteserver
+%{_libdir}/systemd/system/remotecontrol.service
+%{_libdir}/systemd/system/graphical.target.wants/remotecontrol.service
\ No newline at end of file