Skip to content

Instantly share code, notes, and snippets.

@bodgit
Last active August 29, 2015 14:02
Show Gist options
  • Save bodgit/57a3b562f08cc4916e7d to your computer and use it in GitHub Desktop.
Save bodgit/57a3b562f08cc4916e7d to your computer and use it in GitHub Desktop.
RPM spec for Elasticsearch Curator
diff -up elasticsearch-curator-1.2.2/curator/curator.py.orig elasticsearch-curator-1.2.2/curator/curator.py
--- elasticsearch-curator-1.2.2/curator/curator.py.orig 2014-08-20 11:24:42.750639539 +0000
+++ elasticsearch-curator-1.2.2/curator/curator.py 2014-08-20 11:25:12.530602535 +0000
@@ -714,8 +714,8 @@ def main():
check_version(client)
if arguments.master_only and not is_master_node(client):
- logger.fatal('Master-only flag detected. Connected to non-master node. Aborting.')
- sys.exit(1)
+ logger.info('Master-only flag detected. Connected to non-master node. Aborting.')
+ sys.exit(0)
if arguments.command != "show":
if arguments.timestring:
%if 0%{?rhel} && 0%{?rhel} <= 6
%{!?__python2: %global __python2 /usr/bin/python2}
%{!?python2_sitelib: %global python2_sitelib %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
%{!?python2_sitearch: %global python2_sitearch %(%{__python2} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib(1))")}
%endif
%global srcname elasticsearch-curator
Name: python-elasticsearch-curator
Version: 1.2.2
Release: 1%{?dist}
Summary: Tending your time-series indicies in Elasticsearch
Group: Development/Libraries
License: Apache
URL: https://github.com/elasticsearch/curator
Source0: %{srcname}-%{version}.tar.gz
Patch0: %{srcname}-1.2.2-master-only.patch
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
BuildArch: noarch
BuildRequires: python-setuptools
Requires: python-elasticsearch
Obsoletes: %{srcname}
%description
Tending your time-series indicies in Elasticsearch
%prep
%setup -q -n %{srcname}-%{version}
%patch0 -p1
%build
CFLAGS="$RPM_OPT_FLAGS" %{__python2} setup.py build
%install
rm -rf %{buildroot}
%{__python2} setup.py install --skip-build --root $RPM_BUILD_ROOT
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root,-)
%doc
%{_bindir}/curator
%{_bindir}/es_repo_mgr
%{python2_sitelib}/elasticsearch_curator-%{version}-py*.egg-info/*
%{python2_sitelib}/curator/*
%changelog
* Thu Aug 21 2014 Matt Dainty <[email protected]> 1.2.2-1
- Rename package to python-* and obsolete old package name.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment