salt-api.spec 2.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118
  1. #
  2. # spec file for package salt-api
  3. #
  4. # Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany.
  5. #
  6. # All modifications and additions to the file contributed by third parties
  7. # remain the property of their copyright owners, unless otherwise agreed
  8. # upon. The license for this file, and modifications and additions to the
  9. # file, is the same license as for the pristine package itself (unless the
  10. # license for the pristine package is not an Open Source License, in which
  11. # case the license is the MIT License). An "Open Source License" is a
  12. # license that conforms to the Open Source Definition (Version 1.9)
  13. # published by the Open Source Initiative.
  14. # Please submit bugfixes or comments via http://bugs.opensuse.org/
  15. #
  16. Name: salt-api
  17. Version: 0.8.3
  18. Release: 0
  19. License: Apache-2.0
  20. Summary: The api for Salt a parallel remote execution system
  21. Url: http://saltstack.org/
  22. Group: System/Monitoring
  23. Source0: http://pypi.python.org/packages/source/s/%{name}/%{name}-%{version}.tar.gz
  24. Source1: salt-api
  25. Source2: salt-api.service
  26. BuildRoot: %{_tmppath}/%{name}-%{version}-build
  27. %if 0%{?suse_version} && 0%{?suse_version} <= 1110
  28. %{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
  29. %else
  30. BuildArch: noarch
  31. %endif
  32. BuildRequires: fdupes
  33. BuildRequires: python-devel
  34. BuildRequires: salt >= 0.15.9
  35. BuildRequires: salt-master
  36. Requires: salt
  37. Requires: salt-master
  38. Recommends: python-CherryPy
  39. %if 0%{?suse_version} >= 1210
  40. BuildRequires: systemd
  41. %{?systemd_requires}
  42. %else
  43. Requires(pre): %insserv_prereq
  44. Requires(pre): %fillup_prereq
  45. %endif
  46. %description
  47. salt-api is a modular interface on top of Salt that can provide a variety of entry points into a running Salt system.
  48. %prep
  49. %setup -q
  50. %build
  51. python setup.py build
  52. %install
  53. python setup.py install --prefix=%{_prefix} --root=%{buildroot}
  54. %fdupes %{buildroot}%{_prefix}
  55. #
  56. ##missing directories
  57. %if 0%{?suse_version} < 1210
  58. mkdir -p %{buildroot}%{_sysconfdir}/init.d
  59. mkdir -p %{buildroot}/%{_sbindir}
  60. %endif
  61. mkdir -p %{buildroot}%{_localstatedir}/log/salt
  62. #
  63. ##init scripts
  64. %if 0%{?suse_version} < 1210
  65. install -Dpm 0755 %{SOURCE1} %{buildroot}%{_sysconfdir}/init.d/salt-api
  66. ln -sf /etc/init.d/salt-api %{buildroot}%{_sbindir}/rcsalt-api
  67. %else
  68. install -Dpm 644 %{SOURCE2} %{buildroot}%_unitdir/salt-api.service
  69. %endif
  70. %preun
  71. %if 0%{?_unitdir:1}
  72. %service_del_preun salt-api.service
  73. %else
  74. %stop_on_removal
  75. %endif
  76. %post
  77. %if 0%{?_unitdir:1}
  78. %service_add_post salt-api.service
  79. %else
  80. %fillup_and_insserv
  81. %endif
  82. %postun
  83. %if 0%{?_unitdir:1}
  84. %service_del_postun salt-api.service
  85. %else
  86. %insserv_cleanup
  87. %restart_on_update
  88. %endif
  89. %files
  90. %defattr(-,root,root)
  91. %doc LICENSE
  92. %if 0%{?_unitdir:1}
  93. %_unitdir
  94. %else
  95. %{_sysconfdir}/init.d/salt-api
  96. %{_sbindir}/rcsalt-api
  97. %endif
  98. %{_mandir}/man1/salt-api.1.*
  99. %{_mandir}/man7/salt-api.7.*
  100. %{_bindir}/salt-api
  101. %{python_sitelib}/*
  102. %changelog