cp include/include/LICENSE LICENSE.BSD
%pre
+if [ $1 -gt 1 ] ; then
+ systemctl stop tef-simulator.socket
+ systemctl stop tef-simulator.service
+fi
%post
-systemctl stop tef-simulator
-rm -rf %{link_tastore_dir}
-mkdir -p `dirname %{link_tastore_dir}`
-ln -sf %{tastore_dir} %{link_tastore_dir}
-tef-update.sh simulator
-systemctl enable tef-simulator
+if [ $1 -eq 1 ] ; then
+ rm -rf %{link_tastore_dir}
+ mkdir -p `dirname %{link_tastore_dir}`
+ ln -sf %{tastore_dir} %{link_tastore_dir}
+ tef-update.sh simulator
+fi
+
+systemctl daemon-reload
+systemctl enable tef-simulator.socket
+systemctl start tef-simulator.socket
%preun
+if [ $1 -eq 0 ] ; then
+ systemctl stop tef-simulator.socket
+ systemctl stop tef-simulator.service
+ systemctl disable tef-simulator.socket
+fi
%postun
-if [ $1 = 0 ] ; then
+if [ $1 -eq 0 ] ; then
tef-update.sh
+ systemctl daemon-reload
fi
%files -n %{name}