salt.spec 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821
  1. #
  2. # spec file for package salt
  3. #
  4. # Copyright (c) 2015 SUSE LINUX 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. %if 0%{?suse_version} > 1210
  17. %bcond_without systemd
  18. %else
  19. %bcond_with systemd
  20. %endif
  21. %{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
  22. %if 0%{?suse_version} > 1110
  23. %bcond_without bash_completion
  24. %bcond_without fish_completion
  25. %bcond_without zsh_completion
  26. %else
  27. %bcond_with bash_completion
  28. %bcond_with fish_completion
  29. %bcond_with zsh_completion
  30. %endif
  31. %bcond_with test
  32. %bcond_with raet
  33. %bcond_without docs
  34. Name: salt
  35. Version: 2015.8.1
  36. Release: 0
  37. Summary: A parallel remote execution system
  38. License: Apache-2.0
  39. Group: System/Monitoring
  40. Url: http://saltstack.org/
  41. Source0: http://pypi.python.org/packages/source/s/%{name}/%{name}-%{version}.tar.gz
  42. Source1: README.SUSE
  43. Source2: salt-tmpfiles.d
  44. # PATCH-FIX-OPENSUSE use-forking-daemon.patch tserong@suse.com -- We don't have python-systemd, so notify can't work
  45. Patch1: use-forking-daemon.patch
  46. # PATCH-OPENSUSE use-salt-user-for-master.patch -- Run salt master as dedicated salt user
  47. Patch2: use-salt-user-for-master.patch
  48. BuildRoot: %{_tmppath}/%{name}-%{version}-build
  49. BuildRequires: logrotate
  50. BuildRequires: python
  51. BuildRequires: python-devel
  52. # requirements/base.txt
  53. BuildRequires: python-Jinja2
  54. BuildRequires: python-futures >= 2.0
  55. BuildRequires: python-markupsafe
  56. BuildRequires: python-msgpack-python > 0.3
  57. BuildRequires: python-psutil
  58. BuildRequires: python-requests >= 1.0.0
  59. BuildRequires: python-tornado >= 4.2.1
  60. BuildRequires: python-yaml
  61. # requirements/opt.txt (not all)
  62. # BuildRequires: python-MySQL-python
  63. # BuildRequires: python-timelib
  64. # BuildRequires: python-gnupg
  65. # BuildRequires: python-cherrypy >= 3.2.2
  66. %if %{with raet}
  67. # requirements/raet.txt
  68. BuildRequires: python-libnacl >= 1.0.0
  69. BuildRequires: python-ioflo >= 1.1.7
  70. BuildRequires: python-raet >= 0.6.0
  71. %endif
  72. # requirements/zeromq.txt
  73. BuildRequires: pycryptodomex >= 3.9.7
  74. BuildRequires: python-pyzmq >= 2.2.0
  75. %if %{with test}
  76. # requirements/dev_python27.txt
  77. BuildRequires: python-boto >= 2.32.1
  78. BuildRequires: python-mock
  79. BuildRequires: python-moto >= 0.3.6
  80. BuildRequires: python-pip
  81. BuildRequires: python-salt-testing >= 2015.2.16
  82. BuildRequires: python-unittest2
  83. BuildRequires: python-xml
  84. %endif
  85. %if %{with docs}
  86. #for docs
  87. BuildRequires: python-sphinx
  88. %endif
  89. Requires(pre): %{_sbindir}/groupadd
  90. Requires(pre): %{_sbindir}/useradd
  91. %if 0%{?suse_version}
  92. Requires(pre): %fillup_prereq
  93. Requires(pre): pwdutils
  94. %endif
  95. Requires: logrotate
  96. Requires: python
  97. #
  98. %if ! 0%{?suse_version} > 1110
  99. Requires: python-certifi
  100. %endif
  101. # requirements/base.txt
  102. Requires: python-Jinja2
  103. Requires: python-futures >= 2.0
  104. Requires: python-markupsafe
  105. Requires: python-msgpack-python > 0.3
  106. Requires: python-psutil
  107. Requires: python-requests >= 1.0.0
  108. Requires: python-tornado >= 4.2.1
  109. Requires: python-yaml
  110. %if 0%{?suse_version}
  111. # requirements/opt.txt (not all)
  112. Recommends: python-MySQL-python
  113. Recommends: python-timelib
  114. Recommends: python-gnupg
  115. # requirements/raet.txt
  116. # Recommends: salt-raet
  117. # requirements/zeromq.txt
  118. %endif
  119. Requires: pycryptodomex >= 3.9.7
  120. Requires: python-pyzmq >= 2.2.0
  121. #
  122. %if 0%{?suse_version}
  123. # python-xml is part of python-base in all rhel versions
  124. Requires: python-xml
  125. Recommends: python-Mako
  126. Recommends: python-netaddr
  127. %endif
  128. %if %{with systemd}
  129. BuildRequires: systemd
  130. %{?systemd_requires}
  131. %else
  132. %if 0%{?suse_version}
  133. Requires(pre): %insserv_prereq
  134. %endif
  135. %endif
  136. %if %{with fish_completion}
  137. %define fish_dir %{_datadir}/fish/
  138. %define fish_completions_dir %{_datadir}/fish/completions/
  139. %endif
  140. %if %{with bash_completion}
  141. %if 0%{?suse_version} >= 1140
  142. BuildRequires: bash-completion
  143. %else
  144. BuildRequires: bash
  145. %endif
  146. %endif
  147. %if %{with zsh_completion}
  148. BuildRequires: zsh
  149. %endif
  150. %description
  151. Salt is a distributed remote execution system used to execute commands and
  152. query data. It was developed in order to bring the best solutions found in
  153. the world of remote execution together and make them better, faster and more
  154. malleable. Salt accomplishes this via its ability to handle larger loads of
  155. information, and not just dozens, but hundreds or even thousands of individual
  156. servers, handle them quickly and through a simple and manageable interface.
  157. %package api
  158. Summary: The api for Salt a parallel remote execution system
  159. Group: System/Monitoring
  160. Requires: %{name} = %{version}
  161. Requires: %{name}-master = %{version}
  162. Requires: python-CherryPy >= 3.2.2
  163. %description api
  164. salt-api is a modular interface on top of Salt that can provide a variety of entry points into a running Salt system.
  165. %package cloud
  166. Summary: Generic cloud provisioning tool for Saltstack
  167. Group: System/Monitoring
  168. Requires: %{name} = %{version}
  169. Requires: %{name}-master = %{version}
  170. Requires: python-apache-libcloud
  171. %if 0%{?suse_version}
  172. Recommends: python-botocore
  173. Recommends: python-netaddr
  174. %endif
  175. %description cloud
  176. public cloud VM management system
  177. provision virtual machines on various public clouds via a cleanly
  178. controlled profile and mapping system.
  179. %if %{with docs}
  180. %package doc
  181. Summary: Documentation for salt, a parallel remote execution system
  182. Group: Documentation/HTML
  183. Requires: %{name} = %{version}
  184. %description doc
  185. This contains the documentation of salt, it is an offline version of http://docs.saltstack.com.
  186. %endif
  187. %package master
  188. Summary: The management component of Saltstack both protocols zmq and raet supported
  189. Group: System/Monitoring
  190. Requires: %{name} = %{version}
  191. %if 0%{?suse_version}
  192. Recommends: python-pygit2 >= 0.20.3
  193. %endif
  194. %ifarch %{ix86} x86_64
  195. %if 0%{?suse_version}
  196. Requires: dmidecode
  197. %endif
  198. %endif
  199. %if %{with systemd}
  200. %{?systemd_requires}
  201. %else
  202. %if 0%{?suse_version}
  203. Requires(pre): %insserv_prereq
  204. %endif
  205. %endif
  206. %if 0%{?suse_version}
  207. Requires(pre): %fillup_prereq
  208. %endif
  209. %description master
  210. The Salt master is the central server to which all minions connect.
  211. Enabled commands to remote systems to be called in parallel rather
  212. than serially.
  213. %package minion
  214. Summary: The client component for Saltstack
  215. Group: System/Monitoring
  216. Requires: %{name} = %{version}
  217. %if %{with systemd}
  218. %{?systemd_requires}
  219. %else
  220. %if 0%{?suse_version}
  221. Requires(pre): %insserv_prereq
  222. %endif
  223. %endif
  224. %if 0%{?suse_version}
  225. Requires(pre): %fillup_prereq
  226. %endif
  227. %description minion
  228. Salt minion is queried and controlled from the master.
  229. Listens to the salt master and execute the commands.
  230. %package raet
  231. Summary: Raet Support for Saltstack
  232. Group: System/Monitoring
  233. Requires: %{name} = %{version}
  234. Requires: python-enum34
  235. Requires: python-ioflo >= 1.1.7
  236. Requires: python-libnacl >= 1.0.0
  237. Requires: python-raet >= 0.6.0
  238. %description raet
  239. The Reliable Asynchronous Event Transport, or RAET, is an alternative transport
  240. medium developed specifically with Salt in mind. It has been developed to allow
  241. queuing to happen up on the application layer and comes with socket layer
  242. encryption. It also abstracts a great deal of control over the socket layer and
  243. makes it easy to bubble up errors and exceptions.
  244. RAET also offers very powerful message routing capabilities, allowing for
  245. messages to be routed between processes on a single machine all the way up to
  246. processes on multiple machines. Messages can also be restricted, allowing
  247. processes to be sent messages of specific types from specific sources allowing
  248. for trust to be established.
  249. %package proxy
  250. Summary: Component for salt that enables controlling arbitrary devices
  251. Group: System/Monitoring
  252. Requires: %{name} = %{version}
  253. %if %{with systemd}
  254. %{?systemd_requires}
  255. %else
  256. %if 0%{?suse_version}
  257. Requires(pre): %insserv_prereq
  258. %endif
  259. %endif
  260. %if 0%{?suse_version}
  261. Requires(pre): %fillup_prereq
  262. %endif
  263. %description proxy
  264. Proxy minions are a developing Salt feature that enables controlling devices that,
  265. for whatever reason, cannot run a standard salt-minion.
  266. Examples include network gear that has an API but runs a proprietary OS,
  267. devices with limited CPU or memory, or devices that could run a minion, but for
  268. security reasons, will not.
  269. %package syndic
  270. Summary: The syndic component for saltstack
  271. Group: System/Monitoring
  272. Requires: %{name} = %{version}
  273. Requires: %{name}-master = %{version}
  274. %if %{with systemd}
  275. %{?systemd_requires}
  276. %else
  277. %if 0%{?suse_version}
  278. Requires(pre): %insserv_prereq
  279. %endif
  280. %endif
  281. %if 0%{?suse_version}
  282. Requires(pre): %fillup_prereq
  283. %endif
  284. %description syndic
  285. Salt syndic is the master-of-masters for salt
  286. The master of masters for salt-- it enables
  287. the management of multiple masters at a time..
  288. %package ssh
  289. Summary: Management component for Saltstack with ssh protocol
  290. Group: System/Monitoring
  291. Requires: %{name} = %{version}
  292. Requires: %{name}-master = %{version}
  293. %if 0%{?suse_version}
  294. Recommends: sshpass
  295. %endif
  296. %if %{with systemd}
  297. %{?systemd_requires}
  298. %else
  299. %if 0%{?suse_version}
  300. Requires(pre): %insserv_prereq
  301. %endif
  302. %endif
  303. %if 0%{?suse_version}
  304. Requires(pre): %fillup_prereq
  305. %endif
  306. %description ssh
  307. Salt ssh is a master running without zmq.
  308. it enables the management of minions over a ssh connection.
  309. %if %{with bash_completion}
  310. %package bash-completion
  311. Summary: Bash Completion for %{name}
  312. Group: System/Management
  313. Requires: %{name} = %{version}
  314. Requires: bash-completion
  315. %if 0%{?suse_version} > 1110
  316. BuildArch: noarch
  317. %endif
  318. %description bash-completion
  319. Bash command line completion support for %{name}.
  320. %endif
  321. %if %{with fish_completion}
  322. %package fish-completion
  323. Summary: Fish Completion for %{name}
  324. Group: System/Management
  325. Requires: %{name} = %{version}
  326. %if 0%{?suse_version} > 1110
  327. BuildArch: noarch
  328. %endif
  329. %description fish-completion
  330. Fish command line completion support for %{name}.
  331. %endif
  332. %if %{with zsh_completion}
  333. %package zsh-completion
  334. Summary: Zsh Completion for %{name}
  335. Group: System/Management
  336. Requires: %{name} = %{version}
  337. Requires: zsh
  338. %if 0%{?suse_version} > 1110
  339. BuildArch: noarch
  340. %endif
  341. %description zsh-completion
  342. Zsh command line completion support for %{name}.
  343. %endif
  344. %prep
  345. %setup -q -n salt-%{version}
  346. cp %{S:1} .
  347. %patch1 -p1
  348. %patch2 -p1
  349. %build
  350. python setup.py --salt-transport=both build
  351. %if %{with docs}
  352. ## documentation
  353. cd doc && make html && rm _build/html/.buildinfo && rm _build/html/_images/proxy_minions.png && cd _build/html && chmod -R -x+X *
  354. %endif
  355. %install
  356. python setup.py --salt-transport=both install --prefix=%{_prefix} --root=%{buildroot}
  357. ## create missing directories
  358. install -Dd -m 0750 %{buildroot}%{_sysconfdir}/salt/master.d
  359. install -Dd -m 0750 %{buildroot}%{_sysconfdir}/salt/minion.d
  360. install -Dd -m 0750 %{buildroot}%{_sysconfdir}/salt/cloud.maps.d
  361. install -Dd -m 0750 %{buildroot}%{_sysconfdir}/salt/cloud.profiles.d
  362. install -Dd -m 0750 %{buildroot}%{_sysconfdir}/salt/cloud.providers.d
  363. install -Dd -m 0750 %{buildroot}%{_localstatedir}/log/salt
  364. install -Dd -m 0755 %{buildroot}%{_sysconfdir}/logrotate.d/
  365. install -Dd -m 0755 %{buildroot}%{_sbindir}
  366. install -Dd -m 0750 %{buildroot}%{_localstatedir}/log/salt
  367. install -Dd -m 0750 %{buildroot}%{_localstatedir}/cache/salt/minion/extmod
  368. install -Dd -m 0750 %{buildroot}%{_localstatedir}/cache/salt/master
  369. install -Dd -m 0750 %{buildroot}%{_localstatedir}/cache/salt/master/jobs
  370. install -Dd -m 0750 %{buildroot}%{_localstatedir}/cache/salt/master/proc
  371. install -Dd -m 0750 %{buildroot}%{_localstatedir}/cache/salt/master/queues
  372. install -Dd -m 0750 %{buildroot}%{_localstatedir}/cache/salt/master/roots
  373. install -Dd -m 0750 %{buildroot}%{_localstatedir}/cache/salt/master/syndics
  374. install -Dd -m 0750 %{buildroot}%{_localstatedir}/cache/salt/master/tokens
  375. install -Dd -m 0750 %{buildroot}/srv/salt
  376. install -Dd -m 0750 %{buildroot}/srv/pillar
  377. install -Dd -m 0750 %{buildroot}/srv/spm
  378. install -Dd -m 0755 %{buildroot}%{_docdir}/salt
  379. install -Dd -m 0750 %{buildroot}%{_sysconfdir}/salt/
  380. install -Dd -m 0750 %{buildroot}%{_sysconfdir}/salt/cloud.maps.d
  381. install -Dd -m 0750 %{buildroot}%{_sysconfdir}/salt/cloud.profiles.d
  382. install -Dd -m 0750 %{buildroot}%{_sysconfdir}/salt/cloud.providers.d
  383. install -Dd -m 0750 %{buildroot}%{_sysconfdir}/salt/master.d
  384. install -Dd -m 0750 %{buildroot}%{_sysconfdir}/salt/minion.d
  385. install -Dd -m 0750 %{buildroot}%{_sysconfdir}/salt/pki
  386. install -Dd -m 0750 %{buildroot}%{_sysconfdir}/salt/pki/master
  387. install -Dd -m 0750 %{buildroot}%{_sysconfdir}/salt/pki/master/minions
  388. install -Dd -m 0750 %{buildroot}%{_sysconfdir}/salt/pki/master/minions_autosign
  389. install -Dd -m 0750 %{buildroot}%{_sysconfdir}/salt/pki/master/minions_denied
  390. install -Dd -m 0750 %{buildroot}%{_sysconfdir}/salt/pki/master/minions_pre
  391. install -Dd -m 0750 %{buildroot}%{_sysconfdir}/salt/pki/master/minions_rejected
  392. install -Dd -m 0750 %{buildroot}%{_sysconfdir}/salt/pki/minion
  393. ## install init and systemd scripts
  394. %if %{with systemd}
  395. install -Dpm 0644 pkg/salt-master.service %{buildroot}%{_unitdir}/salt-master.service
  396. install -Dpm 0644 pkg/salt-minion.service %{buildroot}%{_unitdir}/salt-minion.service
  397. install -Dpm 0644 pkg/salt-syndic.service %{buildroot}%{_unitdir}/salt-syndic.service
  398. install -Dpm 0644 pkg/salt-api.service %{buildroot}%{_unitdir}/salt-api.service
  399. ln -s service %{buildroot}%{_sbindir}/rcsalt-master
  400. ln -s service %{buildroot}%{_sbindir}/rcsalt-syndic
  401. ln -s service %{buildroot}%{_sbindir}/rcsalt-minion
  402. ln -s service %{buildroot}%{_sbindir}/rcsalt-api
  403. install -Dpm 644 %{S:2} %{buildroot}/usr/lib/tmpfiles.d/salt.conf
  404. %else
  405. mkdir -p %{buildroot}%{_initddir}
  406. ## install init scripts
  407. install -Dpm 0755 pkg/suse/salt-master %{buildroot}%{_initddir}/salt-master
  408. install -Dpm 0755 pkg/suse/salt-syndic %{buildroot}%{_initddir}/salt-syndic
  409. install -Dpm 0755 pkg/suse/salt-minion %{buildroot}%{_initddir}/salt-minion
  410. install -Dpm 0755 pkg/suse/salt-api %{buildroot}%{_initddir}/salt-api
  411. ln -sf %{_initddir}/salt-master %{buildroot}%{_sbindir}/rcsalt-master
  412. ln -sf %{_initddir}/salt-syndic %{buildroot}%{_sbindir}/rcsalt-syndic
  413. ln -sf %{_initddir}/salt-minion %{buildroot}%{_sbindir}/rcsalt-minion
  414. ln -sf %{_initddir}/salt-api %{buildroot}%{_sbindir}/rcsalt-api
  415. %endif
  416. #
  417. ## install config files
  418. install -Dpm 0640 conf/minion %{buildroot}%{_sysconfdir}/salt/minion
  419. install -Dpm 0640 /dev/null %{buildroot}%{_sysconfdir}/salt/minion_id
  420. install -Dpm 0640 conf/master %{buildroot}%{_sysconfdir}/salt/master
  421. install -Dpm 0640 conf/roster %{buildroot}%{_sysconfdir}/salt/roster
  422. install -Dpm 0640 conf/cloud %{buildroot}%{_sysconfdir}/salt/cloud
  423. install -Dpm 0640 conf/cloud.profiles %{buildroot}%{_sysconfdir}/salt/cloud.profiles
  424. install -Dpm 0640 conf/cloud.providers %{buildroot}%{_sysconfdir}/salt/cloud.providers
  425. #
  426. ## install logrotate file
  427. install -Dpm 0644 pkg/salt-common.logrotate %{buildroot}%{_sysconfdir}/logrotate.d/salt
  428. #
  429. ## install SuSEfirewall2 rules
  430. install -Dpm 0644 pkg/suse/salt.SuSEfirewall2 %{buildroot}%{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/salt
  431. #
  432. ## install completion scripts
  433. %if %{with bash_completion}
  434. install -Dpm 0644 pkg/salt.bash %{buildroot}%{_sysconfdir}/bash_completion.d/salt
  435. %endif
  436. %if %{with zsh_completion}
  437. install -Dpm 0644 pkg/zsh_completion.zsh %{buildroot}%{_sysconfdir}/zsh_completion.d/salt
  438. %endif
  439. %if %{with fish_completion}
  440. mkdir -p %{buildroot}%{fish_completions_dir}
  441. install -Dpm 0644 pkg/fish-completions/* %{buildroot}%{fish_completions_dir}
  442. %endif
  443. # raet transport config
  444. echo "transport: raet" > %{buildroot}%{_sysconfdir}/salt/master.d/transport-raet.conf
  445. echo "transport: raet" > %{buildroot}%{_sysconfdir}/salt/minion.d/transport-raet.conf
  446. %check
  447. %if %{with test}
  448. python setup.py test --runtests-opts=-u
  449. %endif
  450. %pre
  451. getent group salt >/dev/null || %{_sbindir}/groupadd -r salt
  452. getent passwd salt >/dev/null || %{_sbindir}/useradd -r -g salt -d /srv/salt -s /bin/false -c "salt-master daemon" salt
  453. %if %{with systemd}
  454. %post
  455. systemd-tmpfiles --create /usr/lib/tmpfiles.d/salt.conf || true
  456. %endif
  457. %preun syndic
  458. %if %{with systemd}
  459. %service_del_preun salt-syndic.service
  460. %else
  461. %if 0%{?suse_version}
  462. %stop_on_removal salt-syndic
  463. %else
  464. if [ $1 -eq 0 ] ; then
  465. /sbin/service salt-syndic stop >/dev/null 2>&1
  466. /sbin/chkconfig --del salt-syndic
  467. fi
  468. %endif
  469. %endif
  470. %pre syndic
  471. %if %{with systemd}
  472. %service_add_pre salt-syndic.service
  473. %endif
  474. %post syndic
  475. %if %{with systemd}
  476. %service_add_post salt-syndic.service
  477. %fillup_only
  478. %else
  479. %if 0%{?suse_version}
  480. %fillup_and_insserv
  481. %endif
  482. %endif
  483. %postun syndic
  484. %if %{with systemd}
  485. %service_del_postun salt-syndic.service
  486. %else
  487. %if 0%{?suse_version}
  488. %insserv_cleanup
  489. %restart_on_update salt-syndic
  490. %endif
  491. %endif
  492. %preun master
  493. %if %{with systemd}
  494. %service_del_preun salt-master.service
  495. %else
  496. %if 0%{?suse_version}
  497. %stop_on_removal salt-master
  498. %else
  499. if [ $1 -eq 0 ] ; then
  500. /sbin/service salt-master stop >/dev/null 2>&1
  501. /sbin/chkconfig --del salt-master
  502. fi
  503. %endif
  504. %endif
  505. %pre master
  506. %if %{with systemd}
  507. %service_add_pre salt-master.service
  508. %endif
  509. %post master
  510. %if %{with systemd}
  511. %service_add_post salt-master.service
  512. %fillup_only
  513. %else
  514. %if 0%{?suse_version}
  515. %fillup_and_insserv
  516. %else
  517. /sbin/chkconfig --add salt-master
  518. %endif
  519. %endif
  520. %postun master
  521. %if %{with systemd}
  522. %service_del_postun salt-master.service
  523. %else
  524. %if 0%{?suse_version}
  525. %restart_on_update salt-master
  526. %insserv_cleanup
  527. %else
  528. if [ "$1" -ge "1" ] ; then
  529. /sbin/service salt-master condrestart >/dev/null 2>&1 || :
  530. fi
  531. %endif
  532. %endif
  533. %preun minion
  534. %if %{with systemd}
  535. %service_del_preun salt-minion.service
  536. %else
  537. %if 0%{?suse_version}
  538. %stop_on_removal salt-minion
  539. %else
  540. if [ $1 -eq 0 ] ; then
  541. /sbin/service salt-minion stop >/dev/null 2>&1
  542. /sbin/chkconfig --del salt-minion
  543. fi
  544. %endif
  545. %endif
  546. %pre minion
  547. %if %{with systemd}
  548. %service_add_pre salt-minion.service
  549. %endif
  550. %post minion
  551. %if %{with systemd}
  552. %service_add_post salt-minion.service
  553. %fillup_only
  554. %else
  555. %if 0%{?suse_version}
  556. %fillup_and_insserv
  557. %else
  558. /sbin/chkconfig --add salt-minion
  559. %endif
  560. %endif
  561. %postun minion
  562. %if %{with systemd}
  563. %service_del_postun salt-minion.service
  564. %else
  565. %if 0%{?suse_version}
  566. %insserv_cleanup
  567. %restart_on_update salt-minion
  568. %else
  569. if [ "$1" -ge "1" ] ; then
  570. /sbin/service salt-minion condrestart >/dev/null 2>&1 || :
  571. fi
  572. %endif
  573. %endif
  574. %preun api
  575. %if %{with systemd}
  576. %service_del_preun salt-api.service
  577. %else
  578. %stop_on_removal
  579. %endif
  580. %pre api
  581. %if %{with systemd}
  582. %service_add_pre salt-api.service
  583. %endif
  584. %post api
  585. %if %{with systemd}
  586. %service_add_post salt-api.service
  587. %else
  588. %if 0%{?suse_version}
  589. %fillup_and_insserv
  590. %endif
  591. %endif
  592. %postun api
  593. %if %{with systemd}
  594. %service_del_postun salt-api.service
  595. %else
  596. %if 0%{?suse_version}
  597. %insserv_cleanup
  598. %restart_on_update
  599. %endif
  600. %endif
  601. %files api
  602. %defattr(-,root,root)
  603. %{_bindir}/salt-api
  604. %{_sbindir}/rcsalt-api
  605. %if %{with systemd}
  606. %{_unitdir}/salt-api.service
  607. %else
  608. %{_initddir}/salt-api
  609. %endif
  610. %{_mandir}/man1/salt-api.1.*
  611. %files cloud
  612. %defattr(-,root,root)
  613. %{_bindir}/salt-cloud
  614. %dir %attr(0750, root, salt) %{_sysconfdir}/salt/cloud.maps.d
  615. %dir %attr(0750, root, salt) %{_sysconfdir}/salt/cloud.profiles.d
  616. %dir %attr(0750, root, salt) %{_sysconfdir}/salt/cloud.providers.d
  617. %config(noreplace) %attr(0640, root, salt) %{_sysconfdir}/salt/cloud
  618. %config(noreplace) %attr(0640, root, salt) %{_sysconfdir}/salt/cloud.profiles
  619. %config(noreplace) %attr(0640, root, salt) %{_sysconfdir}/salt/cloud.providers
  620. %{_mandir}/man1/salt-cloud.1.*
  621. %files ssh
  622. %defattr(-,root,root)
  623. %{_bindir}/salt-ssh
  624. %{_mandir}/man1/salt-ssh.1.gz
  625. %files syndic
  626. %defattr(-,root,root)
  627. %{_bindir}/salt-syndic
  628. %{_mandir}/man1/salt-syndic.1.gz
  629. %{_sbindir}/rcsalt-syndic
  630. %if %{with systemd}
  631. %{_unitdir}/salt-syndic.service
  632. %else
  633. %{_initddir}/salt-syndic
  634. %endif
  635. %files minion
  636. %defattr(-,root,root)
  637. %{_bindir}/salt-minion
  638. %{_mandir}/man1/salt-minion.1.gz
  639. %config(noreplace) %attr(0640, root, root) %{_sysconfdir}/salt/minion
  640. %config(noreplace) %attr(0640, root, root) %ghost %{_sysconfdir}/salt/minion_id
  641. %dir %attr(0750, root, root) %{_sysconfdir}/salt/minion.d/
  642. %dir %attr(0750, root, root) %{_sysconfdir}/salt/pki/minion/
  643. %dir %attr(0750, root, root) %{_localstatedir}/cache/salt/minion/
  644. %{_sbindir}/rcsalt-minion
  645. %if %{with systemd}
  646. %{_unitdir}/salt-minion.service
  647. %else
  648. %config(noreplace) %{_initddir}/salt-minion
  649. %endif
  650. %files proxy
  651. %defattr(-,root,root)
  652. %{_bindir}/salt-proxy
  653. %{_mandir}/man1/salt-proxy.1.gz
  654. %files master
  655. %defattr(-,root,root)
  656. %{_bindir}/salt
  657. %{_bindir}/salt-master
  658. %{_bindir}/salt-cp
  659. %{_bindir}/salt-key
  660. %{_bindir}/salt-run
  661. %{_mandir}/man1/salt-master.1.gz
  662. %{_mandir}/man1/salt-cp.1.gz
  663. %{_mandir}/man1/salt-key.1.gz
  664. %{_mandir}/man1/salt-run.1.gz
  665. %{_mandir}/man7/salt.7.gz
  666. %config(noreplace) %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services/salt
  667. %{_sbindir}/rcsalt-master
  668. %if %{with systemd}
  669. %{_unitdir}/salt-master.service
  670. %else
  671. %config(noreplace) %{_initddir}/salt-master
  672. %endif
  673. #
  674. %config(noreplace) %attr(0640, root, salt) %{_sysconfdir}/salt/master
  675. %config(noreplace) %attr(0640, root, salt) %{_sysconfdir}/salt/roster
  676. %dir %attr(0755, root, salt) %{_sysconfdir}/salt/master.d/
  677. %dir %attr(0750, salt, salt) %{_sysconfdir}/salt/pki/master/
  678. %dir %attr(0750, salt, salt) %{_sysconfdir}/salt/pki/master/minions/
  679. %dir %attr(0750, salt, salt) %{_sysconfdir}/salt/pki/master/minions_autosign/
  680. %dir %attr(0750, salt, salt) %{_sysconfdir}/salt/pki/master/minions_denied/
  681. %dir %attr(0750, salt, salt) %{_sysconfdir}/salt/pki/master/minions_pre/
  682. %dir %attr(0750, salt, salt) %{_sysconfdir}/salt/pki/master/minions_rejected/
  683. %dir %attr(0755, root, salt) /srv/salt
  684. %dir %attr(0755, root, salt) /srv/pillar
  685. %dir %attr(0750, salt, salt) %{_localstatedir}/cache/salt/master/
  686. %dir %attr(0750, salt, salt) %{_localstatedir}/cache/salt/master/jobs/
  687. %dir %attr(0750, salt, salt) %{_localstatedir}/cache/salt/master/proc/
  688. %dir %attr(0750, salt, salt) %{_localstatedir}/cache/salt/master/queues/
  689. %dir %attr(0750, salt, salt) %{_localstatedir}/cache/salt/master/roots/
  690. %dir %attr(0750, salt, salt) %{_localstatedir}/cache/salt/master/syndics/
  691. %dir %attr(0750, salt, salt) %{_localstatedir}/cache/salt/master/tokens/
  692. %files raet
  693. %defattr(-,root,root,-)
  694. %config(noreplace) %attr(0640, root, salt) %{_sysconfdir}/salt/master.d/transport-raet.conf
  695. %config(noreplace) %attr(0640, root, root) %{_sysconfdir}/salt/minion.d/transport-raet.conf
  696. %files
  697. %defattr(-,root,root,-)
  698. %{_bindir}/spm
  699. %{_bindir}/salt-call
  700. %{_bindir}/salt-unity
  701. %{_mandir}/man1/salt-unity.1.gz
  702. %{_mandir}/man1/salt-call.1.gz
  703. %config(noreplace) %{_sysconfdir}/logrotate.d/salt
  704. %{python_sitelib}/*
  705. %exclude %{python_sitelib}/salt/cloud/deploy/*.sh
  706. %attr(755,root,root)%{python_sitelib}/salt/cloud/deploy/*.sh
  707. %doc LICENSE AUTHORS README.rst HACKING.rst README.SUSE
  708. #
  709. %dir %attr(0750, root, salt) %{_sysconfdir}/salt
  710. %dir %attr(0750, root, salt) %{_sysconfdir}/salt/pki
  711. %dir %attr(0750, salt, salt) %{_localstatedir}/log/salt
  712. %dir %attr(0750, root, salt) %{_localstatedir}/cache/salt
  713. %dir %attr(0750, root, salt) /srv/spm
  714. %if %{with systemd}
  715. /usr/lib/tmpfiles.d/salt.conf
  716. %endif
  717. %if %{with docs}
  718. %files doc
  719. %defattr(-,root,root)
  720. %doc doc/_build/html
  721. %endif
  722. %if %{with bash_completion}
  723. %files bash-completion
  724. %defattr(-,root,root)
  725. %dir %{_sysconfdir}/bash_completion.d/
  726. %config %{_sysconfdir}/bash_completion.d/%{name}
  727. %endif
  728. %if %{with zsh_completion}
  729. %files zsh-completion
  730. %defattr(-,root,root)
  731. %dir %{_sysconfdir}/zsh_completion.d/
  732. %config %{_sysconfdir}/zsh_completion.d/%{name}
  733. %endif
  734. %if %{with fish_completion}
  735. %files fish-completion
  736. %defattr(-,root,root)
  737. %{fish_completions_dir}/salt*
  738. %dir %{fish_completions_dir}
  739. %dir %{fish_dir}
  740. %endif
  741. %changelog