salt/pkg/rpm/salt.spec

297 lines
8.4 KiB
RPMSpec
Raw Normal View History

2012-01-06 07:26:37 +00:00
%if ! (0%{?rhel} >= 6 || 0%{?fedora} > 12)
%global with_python26 1
%define pybasever 2.6
%define __python_ver 26
%define __python %{_bindir}/python%{?pybasever}
%endif
2011-04-03 05:02:48 +00:00
%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
Name: salt
2012-03-21 22:13:42 +00:00
Version: 0.9.7
2012-01-24 22:16:30 +00:00
Release: 2%{?dist}
Summary: A parallel remote execution system
Group: System Environment/Daemons
License: ASL 2.0
URL: http://saltstack.org/
2011-12-05 04:39:28 +00:00
Source0: https://github.com/downloads/saltstack/%{name}/%{name}-%{version}.tar.gz
Source1: %{name}-master
Source2: %{name}-syndic
Source3: %{name}-minion
2012-01-06 07:26:37 +00:00
Source4: %{name}-master.service
Source5: %{name}-syndic.service
Source6: %{name}-minion.service
2012-01-24 22:16:30 +00:00
Source7: README.fedora
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
2012-03-21 22:13:42 +00:00
Requires: dmidecode
2012-01-06 07:26:37 +00:00
%if 0%{?with_python26}
BuildRequires: python26-zmq
BuildRequires: python26-crypto
BuildRequires: python26-devel
BuildRequires: python26-PyYAML
BuildRequires: python26-m2crypto
2012-01-24 22:16:30 +00:00
BuildRequires: python26-msgpack
2012-01-06 07:26:37 +00:00
Requires: python26-crypto
Requires: python26-zmq
Requires: python26-jinja2
Requires: python26-PyYAML
Requires: python26-m2crypto
2012-01-09 03:28:30 +00:00
Requires: python26-PyXML
2012-01-24 22:16:30 +00:00
Requires: python26-msgpack
2012-01-06 07:26:37 +00:00
%else
2011-12-05 04:39:28 +00:00
BuildRequires: python-zmq
BuildRequires: python-crypto
BuildRequires: python-devel
2012-01-06 07:26:37 +00:00
BuildRequires: PyYAML
BuildRequires: m2crypto
2012-01-24 22:16:30 +00:00
BuildRequires: python-msgpack
2012-01-06 07:26:37 +00:00
Requires: python-crypto
Requires: python-zmq
Requires: python-jinja2
Requires: PyYAML
Requires: m2crypto
2012-01-09 03:28:30 +00:00
Requires: PyXML
2012-01-24 22:16:30 +00:00
Requires: python-msgpack
2012-01-06 07:26:37 +00:00
%endif
2012-01-09 03:28:30 +00:00
%if ! (0%{?rhel} >= 7 || 0%{?fedora} >= 15)
Requires(post): chkconfig
Requires(preun): chkconfig
Requires(preun): initscripts
Requires(postun): initscripts
%else
BuildRequires: systemd-units
2012-01-09 03:28:30 +00:00
%endif
2012-01-24 22:16:30 +00:00
#Requires: MySQL-python libvirt-python yum
2011-04-03 05:02:48 +00:00
%description
Salt is a distributed remote execution system used to execute commands and
query data. It was developed in order to bring the best solutions found in
the world of remote execution together and make them better, faster and more
malleable. Salt accomplishes this via its ability to handle larger loads of
information, and not just dozens, but hundreds or even thousands of individual
servers, handle them quickly and through a simple and manageable interface.
%package -n salt-master
Summary: Management component for salt, a parallel remote execution system
Group: System Environment/Daemons
2012-01-09 03:28:30 +00:00
Requires: salt = %{version}-%{release}
%description -n salt-master
The Salt master is the central server to which all minions connect.
%package -n salt-minion
Summary: Client component for salt, a parallel remote execution system
Group: System Environment/Daemons
2012-01-09 03:28:30 +00:00
Requires: salt = %{version}-%{release}
%description -n salt-minion
Salt minion is queried and controlled from the master.
2011-04-03 05:02:48 +00:00
%prep
%setup -q
%build
%install
rm -rf $RPM_BUILD_ROOT
%{__python} setup.py install -O1 --root $RPM_BUILD_ROOT
2012-01-06 07:26:37 +00:00
2012-01-09 03:28:30 +00:00
%if ! (0%{?rhel} >= 7 || 0%{?fedora} >= 15)
2011-04-03 05:02:48 +00:00
mkdir -p $RPM_BUILD_ROOT%{_initrddir}
install -p %{SOURCE1} $RPM_BUILD_ROOT%{_initrddir}/
install -p %{SOURCE2} $RPM_BUILD_ROOT%{_initrddir}/
install -p %{SOURCE3} $RPM_BUILD_ROOT%{_initrddir}/
2012-01-06 07:26:37 +00:00
%else
mkdir -p $RPM_BUILD_ROOT%{_unitdir}
install -p -m 0644 %{SOURCE4} $RPM_BUILD_ROOT%{_unitdir}/
install -p -m 0644 %{SOURCE5} $RPM_BUILD_ROOT%{_unitdir}/
install -p -m 0644 %{SOURCE6} $RPM_BUILD_ROOT%{_unitdir}/
2012-01-06 07:26:37 +00:00
%endif
2012-01-24 22:16:30 +00:00
install -p %{SOURCE7} .
install -p -m 0640 $RPM_BUILD_ROOT%{_sysconfdir}/salt/minion.template $RPM_BUILD_ROOT%{_sysconfdir}/salt/minion
install -p -m 0640 $RPM_BUILD_ROOT%{_sysconfdir}/salt/master.template $RPM_BUILD_ROOT%{_sysconfdir}/salt/master
2011-04-03 05:02:48 +00:00
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc LICENSE
%{python_sitelib}/%{name}/*
%{python_sitelib}/%{name}-%{version}-py?.?.egg-info
2011-12-05 04:39:28 +00:00
%doc %{_mandir}/man7/salt.7.*
2012-01-24 22:16:30 +00:00
%doc README.fedora
%files -n salt-minion
%defattr(-,root,root)
2011-12-05 04:39:28 +00:00
%doc %{_mandir}/man1/salt-call.1.*
%doc %{_mandir}/man1/salt-minion.1.*
%{_bindir}/salt-minion
%{_bindir}/salt-call
2012-01-09 03:28:30 +00:00
%if ! (0%{?rhel} >= 7 || 0%{?fedora} >= 15)
%attr(0755, root, root) %{_initrddir}/salt-minion
2012-01-06 07:26:37 +00:00
%else
%{_unitdir}/salt-minion.service
%endif
2012-01-09 03:28:30 +00:00
2012-01-24 22:16:30 +00:00
%config(noreplace) %{_sysconfdir}/salt/minion
%config %{_sysconfdir}/salt/minion.template
%files -n salt-master
%defattr(-,root,root)
2011-12-05 04:39:28 +00:00
%doc %{_mandir}/man1/salt-master.1.*
%doc %{_mandir}/man1/salt.1.*
%doc %{_mandir}/man1/salt-cp.1.*
%doc %{_mandir}/man1/salt-key.1.*
%doc %{_mandir}/man1/salt-run.1.*
%doc %{_mandir}/man1/salt-syndic.1.*
%{_bindir}/salt
%{_bindir}/salt-master
%{_bindir}/salt-syndic
%{_bindir}/salt-cp
%{_bindir}/salt-key
%{_bindir}/salt-run
2012-01-09 03:28:30 +00:00
%if ! (0%{?rhel} >= 7 || 0%{?fedora} >= 15)
%attr(0755, root, root) %{_initrddir}/salt-master
%attr(0755, root, root) %{_initrddir}/salt-syndic
2012-01-06 07:26:37 +00:00
%else
%{_unitdir}/salt-master.service
%{_unitdir}/salt-syndic.service
%endif
2012-01-24 22:16:30 +00:00
%config(noreplace) %{_sysconfdir}/salt/master
%config %{_sysconfdir}/salt/master.template
2011-04-03 05:02:48 +00:00
2012-01-09 03:28:30 +00:00
%if ! (0%{?rhel} >= 7 || 0%{?fedora} >= 15)
%preun -n salt-master
if [ $1 -eq 0 ] ; then
/sbin/service salt-master stop >/dev/null 2>&1
/sbin/service salt-syndic stop >/dev/null 2>&1
/sbin/chkconfig --del salt-master
/sbin/chkconfig --del salt-syndic
fi
%preun -n salt-minion
if [ $1 -eq 0 ] ; then
/sbin/service salt-minion stop >/dev/null 2>&1
/sbin/chkconfig --del salt-minion
fi
%post -n salt-master
/sbin/chkconfig --add salt-master
/sbin/chkconfig --add salt-syndic
%post -n salt-minion
/sbin/chkconfig --add salt-minion
%postun -n salt-master
if [ "$1" -ge "1" ] ; then
/sbin/service salt-master condrestart >/dev/null 2>&1 || :
/sbin/service salt-syndic condrestart >/dev/null 2>&1 || :
fi
%postun -n salt-minion
if [ "$1" -ge "1" ] ; then
/sbin/service salt-master condrestart >/dev/null 2>&1 || :
/sbin/service salt-syndic condrestart >/dev/null 2>&1 || :
fi
%else
%preun -n salt-master
if [ $1 -eq 0 ] ; then
# Package removal, not upgrade
/bin/systemctl --no-reload disable salt-master.service > /dev/null 2>&1 || :
/bin/systemctl stop salt-master.service > /dev/null 2>&1 || :
/bin/systemctl --no-reload disable salt-syndic.service > /dev/null 2>&1 || :
/bin/systemctl stop salt-syndic.service > /dev/null 2>&1 || :
fi
%preun -n salt-minion
if [ $1 -eq 0 ] ; then
# Package removal, not upgrade
/bin/systemctl --no-reload disable salt-master.service > /dev/null 2>&1 || :
/bin/systemctl stop salt-master.service > /dev/null 2>&1 || :
fi
%post -n salt-master
/bin/systemctl daemon-reload &>/dev/null || :
%post -n salt-minion
/bin/systemctl daemon-reload &>/dev/null || :
%postun -n salt-master
/bin/systemctl daemon-reload &>/dev/null
2012-01-09 03:28:30 +00:00
[ $1 -gt 0 ] && /bin/systemctl try-restart salt-master.service &>/dev/null || :
[ $1 -gt 0 ] && /bin/systemctl try-restart salt-syndic.service &>/dev/null || :
%postun -n salt-minion
/bin/systemctl daemon-reload &>/dev/null
2012-01-09 03:28:30 +00:00
[ $1 -gt 0 ] && /bin/systemctl try-restart salt-master.service &>/dev/null || :
[ $1 -gt 0 ] && /bin/systemctl try-restart salt-syndic.service &>/dev/null || :
%endif
2011-04-03 05:02:48 +00:00
%changelog
2012-03-21 22:13:42 +00:00
* Thu Mar 8 2012 Clint Savage <herlo1@gmail.com> - 0.9.7-2
- Added dmidecode as a Requires
* Thu Feb 16 2012 Clint Savage <herlo1@gmail.com> - 0.9.7-1
- Moved to upstream release 0.9.7
2012-01-24 22:16:30 +00:00
* Tue Jan 24 2012 Clint Savage <herlo1@gmail.com> - 0.9.6-2
- Added README.fedora and removed deps for optional modules
* Sat Jan 21 2012 Clint Savage <herlo1@gmail.com> - 0.9.6-1
- New upstream release
2012-01-09 03:28:30 +00:00
* Sun Jan 8 2012 Clint Savage <herlo1@gmail.com> - 0.9.4-6
- Missed some critical elements for SysV and rpmlint cleanup
* Sun Jan 8 2012 Clint Savage <herlo1@gmail.com> - 0.9.4-5
- SysV clean up in post
* Sat Jan 7 2012 Clint Savage <herlo1@gmail.com> - 0.9.4-4
2012-01-09 03:28:30 +00:00
- Cleaning up perms, group and descriptions, adding post scripts for systemd
2012-01-06 07:26:37 +00:00
* Thu Jan 5 2012 Clint Savage <herlo1@gmail.com> - 0.9.4-3
- Updating for systemd on Fedora 15+
2011-12-05 04:39:28 +00:00
* Thu Dec 1 2011 Clint Savage <herlo1@gmail.com> - 0.9.4-2
- Removing requirement for Cython. Optional only for salt-minion
* Thu Nov 30 2011 Clint Savage <herlo1@gmail.com> - 0.9.4-1
- New upstream release with new features and bugfixes
* Thu Nov 17 2011 Clint Savage <herlo1@gmail.com> - 0.9.3-1
- New upstream release with new features and bugfixes
* Sat Sep 17 2011 Clint Savage <herlo1@gmail.com> - 0.9.2-1
- Bugfix release from upstream to fix python2.6 issues
* Fri Sep 09 2011 Clint Savage <herlo1@gmail.com> - 0.9.1-1
- Initial packages