Summary: Consul is a tool for service discovery and configuration. Name: consul Version: 0.8.1 Release: qg Group: Tools License: Apache v2.0 URL: https://www.consul.io/ Source0: %{name}-%{version}.tar.gz BuildRequires: /bin/bash Requires: systemd %description Consul is a tool for service discovery and configuration. Consul is distributed, highly available, and extremely scalable. %define debug_package %{nil} %prep %setup -q %pre /usr/bin/getent passwd consul > /dev/null 2>&1 || /usr/sbin/useradd -M consul > /dev/null 2>&1 %preun if [ $1 -eq 0 ] ; then systemctl disable consul.service >/dev/null 2>&1 systemctl stop consul.service >/dev/null 2>&1 /usr/sbin/userdel consul > /dev/null 2>&1 exit 0 fi %install rm -rf $RPM_BUILD_ROOT mkdir -p $RPM_BUILD_ROOT/usr/bin mkdir -p $RPM_BUILD_ROOT/etc/consul/conf.d mkdir -p $RPM_BUILD_ROOT/usr/lib/systemd/system mkdir -p $RPM_BUILD_ROOT/var/lib/consul cp consul $RPM_BUILD_ROOT/usr/bin cp consul.service $RPM_BUILD_ROOT/usr/lib/systemd/system %postun /usr/bin/systemctl daemon-reload >/dev/null 2>&1 rm -rf $RPM_BUILD_ROOT %files %attr(744,consul,consul) /etc/consul/conf.d %attr(744,consul,consul) /var/lib/consul %attr(755,consul,consul) /usr/bin/consul %attr(644,root,root) /usr/lib/systemd/system/consul.service %post systemctl daemon-reload >/dev/null 2>&1 %changelog * Fri Apr 21 2017 Roman Kruglickyi - 0.8.1-qg - Build version 0.8.1 * Mon Dec 26 2016 Roman Kruglicky - 0.7.0-qg - Initial build