]> git-server-git.apps.pok.os.sepia.ceph.com Git - radosgw-agent.git/commitdiff
packaging: fix up spec file for non-python files
authorJosh Durgin <josh.durgin@inktank.com>
Sat, 22 Mar 2014 12:10:28 +0000 (05:10 -0700)
committerJosh Durgin <josh.durgin@inktank.com>
Sat, 22 Mar 2014 12:14:31 +0000 (05:14 -0700)
Correct the installation of the binary, logrotate conf, and init script.
Stop using INSTALLED_FILES. Instead explicitly list files and glob the
python package, as recommended by Fedora's python packaging guide.

Signed-off-by: Josh Durgin <josh.durgin@inktank.com>
MANIFEST.in [new file with mode: 0644]
radosgw-agent.spec
scripts/radosgw-agent [new file with mode: 0644]

diff --git a/MANIFEST.in b/MANIFEST.in
new file mode 100644 (file)
index 0000000..03f1191
--- /dev/null
@@ -0,0 +1,5 @@
+include LICENSE
+include scripts/radosgw-agent
+include init-radosgw-agent
+include logrotate.conf
+prune radosgw_agent/tests
index 8485525fad4fb60e8ebb1b18db7338342b0847bd..0dddbdc195d8cade9b5e8537631ffaf041b1ef5d 100644 (file)
@@ -30,18 +30,26 @@ UNKNOWN
 
 %build
 python setup.py build
-install -D init-radosgw-agent $RPM_BUILD_ROOT%{_initrddir}/radosgw-agent
 
 %install
-python setup.py install --single-version-externally-managed -O1 --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES
+python setup.py install --single-version-externally-managed -O1 --root=$RPM_BUILD_ROOT
+install -m 0755 -D scripts/radosgw-agent $RPM_BUILD_ROOT%{_bindir}/radosgw-agent
 install -m 0644 -D logrotate.conf $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/radosgw-agent
+install -m 0755 -D init-radosgw-agent $RPM_BUILD_ROOT%{_initrddir}/radosgw-agent
+mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/ceph/radosgw-agent
+mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/log/ceph/radosgw-agent
+mkdir -p $RPM_BUILD_ROOT%{_localstatedir}/run/ceph/radosgw-agent
 
 %clean
 rm -rf $RPM_BUILD_ROOT
 
-%files -f INSTALLED_FILES
+%files
 %defattr(-,root,root)
-%dir %{_sysconfdir}/ceph/radosgw-agent/
-%dir %{_localstatedir}/log/ceph/radosgw-agent/
-%dir %{_localstatedir}/run/ceph/radosgw-agent/
+%doc LICENSE
+%dir %{_sysconfdir}/ceph/radosgw-agent
+%dir %{_localstatedir}/log/ceph/radosgw-agent
+%dir %{_localstatedir}/run/ceph/radosgw-agent
 %config(noreplace) %{_sysconfdir}/logrotate.d/radosgw-agent
+%{_bindir}/radosgw-agent
+%{_initrddir}/radosgw-agent
+%{python_sitelib}/radosgw_agent*/
diff --git a/scripts/radosgw-agent b/scripts/radosgw-agent
new file mode 100644 (file)
index 0000000..e59d143
--- /dev/null
@@ -0,0 +1,21 @@
+#!/usr/bin/env python
+import os
+import platform
+import sys
+"""
+radosgw-agent - admin tool for ceph
+"""
+
+if os.path.exists('/usr/share/pyshared/radosgw_agent'):
+    sys.path.insert(0,'/usr/share/pyshared/radosgw_agent')
+elif os.path.exists('/usr/share/radosgw-agent'):
+    sys.path.insert(0,'/usr/share/radosgw-agent')
+elif os.path.exists('/usr/share/pyshared/radosgw-agent'):
+    sys.path.insert(0,'/usr/share/pyshared/radosgw-agent')
+elif os.path.exists('/usr/lib/python2.6/site-packages/radosgw_agent'):
+    sys.path.insert(0,'/usr/lib/python2.6/site-packages/radosgw_agent')
+
+from radosgw_agent.cli import main
+
+if __name__ == '__main__':
+    sys.exit(main())