zeromq.spec 8.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310
  1. # To build with draft APIs, use "--with drafts" in rpmbuild for local builds or add
  2. # Macros:
  3. # %_with_drafts 1
  4. # at the BOTTOM of the OBS prjconf
  5. %bcond_with drafts
  6. %if %{with drafts}
  7. %define DRAFTS yes
  8. %else
  9. %define DRAFTS no
  10. %endif
  11. %define lib_name libzmq5
  12. Name: zeromq
  13. Version: 4.3.3
  14. Release: 1%{?dist}
  15. Summary: The ZeroMQ messaging library
  16. Group: Applications/Internet
  17. License: LGPLv3+
  18. URL: http://www.zeromq.org/
  19. Source: http://download.zeromq.org/%{name}-%{version}.tar.gz
  20. Prefix: %{_prefix}
  21. Buildroot: %{_tmppath}/%{name}-%{version}-%{release}-root
  22. BuildRequires: autoconf automake libtool glib2-devel libbsd-devel
  23. %if ! (0%{?fedora} > 12 || 0%{?rhel} > 5)
  24. BuildRequires: e2fsprogs-devel
  25. BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
  26. %endif
  27. %bcond_with pgm
  28. %if %{with pgm}
  29. BuildRequires: openpgm-devel
  30. %define PGM yes
  31. %else
  32. %define PGM no
  33. %endif
  34. %bcond_with libgssapi_krb5
  35. %if %{with libgssapi_krb5}
  36. BuildRequires: krb5-devel
  37. %define GSSAPI yes
  38. %else
  39. %define GSSAPI no
  40. %endif
  41. %bcond_with libsodium
  42. %if %{with libsodium}
  43. BuildRequires: libsodium-devel
  44. %define SODIUM yes
  45. %else
  46. %define SODIUM no
  47. %endif
  48. %bcond_with nss
  49. %if %{with nss}
  50. %if 0%{?suse_version}
  51. BuildRequires: mozilla-nss-devel
  52. %else
  53. BuildRequires: nss-devel
  54. %endif
  55. %define NSS yes
  56. %else
  57. %define NSS no
  58. %endif
  59. %bcond_with tls
  60. %if %{with tls} && ! 0%{?centos_version} < 700
  61. %if 0%{?suse_version}
  62. BuildRequires: libgnutls-devel
  63. %else
  64. BuildRequires: gnutls-devel
  65. %endif
  66. %define TLS yes
  67. %else
  68. %define TLS no
  69. %endif
  70. BuildRequires: gcc, make, gcc-c++, libstdc++-devel, asciidoc, xmlto
  71. Requires: libstdc++
  72. #
  73. # Conditional build options
  74. # Default values are:
  75. # --without-libgssapi_krb5
  76. # --without-libsodium
  77. # --without-pgm
  78. #
  79. # If neither macro exists, use the default value.
  80. %{!?_with_libgssapi_krb5: %{!?_without_libgssapi_krb5: %define _without_libgssapi_krb5 --without-liblibgssapi_krb5}}
  81. %{!?_with_libsodium: %{!?_without_libsodium: %define _without_libsodium --without-libsodium}}
  82. %{!?_with_pgm: %{!?_without_pgm: %define _without_pgm --without-pgm}}
  83. %{!?_with_nss: %{!?_without_nss: %define _without_nss --without-nss}}
  84. # It's an error if both --with and --without options are specified
  85. %{?_with_libgssapi_krb5: %{?_without_libgssapi_krb5: %{error: both _with_libgssapi_krb5 and _without_libgssapi_krb5}}}
  86. %{?_with_libsodium: %{?_without_libsodium: %{error: both _with_libsodium and _without_libsodium}}}
  87. %{?_with_pgm: %{?_without_pgm: %{error: both _with_pgm and _without_pgm}}}
  88. %{?_with_libgssapi_krb5:BuildRequires: krb5-devel}
  89. %{?_with_libgssapi_krb5:Requires: krb5-libs}
  90. %{?_with_libsodium:BuildRequires: libsodium-devel}
  91. %{?_with_libsodium:Requires: libsodium}
  92. %{?_with_pgm:BuildRequires: openpgm-devel}
  93. %{?_with_pgm:Requires: openpgm}
  94. %if 0%{?suse_version}
  95. %{?_with_nss:BuildRequires: mozilla-nss-devel}
  96. %{?_with_nss:Requires: mozilla-nss}
  97. %else
  98. %{?_with_nss:BuildRequires: nss-devel}
  99. %{?_with_nss:Requires: nss}
  100. %endif
  101. %if ! 0%{?centos_version} < 700
  102. %if 0%{?suse_version}
  103. %{?_with_tls:BuildRequires: libgnutls-devel}
  104. %else
  105. %{?_with_tls:BuildRequires: gnutls-devel}
  106. %endif
  107. %{?_with_tls:Requires: gnutls}
  108. %endif
  109. %ifarch pentium3 pentium4 athlon i386 i486 i586 i686 x86_64
  110. %{!?_with_pic: %{!?_without_pic: %define _with_pic --with-pic}}
  111. %{!?_with_gnu_ld: %{!?_without_gnu_ld: %define _with_gnu_ld --with-gnu_ld}}
  112. %endif
  113. # We do not want to ship libzmq.la
  114. %define _unpackaged_files_terminate_build 0
  115. %description
  116. The 0MQ lightweight messaging kernel is a library which extends the
  117. standard socket interfaces with features traditionally provided by
  118. specialised messaging middleware products. 0MQ sockets provide an
  119. abstraction of asynchronous message queues, multiple messaging
  120. patterns, message filtering (subscriptions), seamless access to
  121. multiple transport protocols and more.
  122. %package -n %{lib_name}
  123. Summary: Shared Library for ZeroMQ
  124. Group: Productivity/Networking/Web/Servers
  125. Conflicts: zeromq
  126. %description -n %{lib_name}
  127. The 0MQ lightweight messaging kernel is a library which extends the
  128. standard socket interfaces with features traditionally provided by
  129. specialised messaging middleware products. 0MQ sockets provide an
  130. abstraction of asynchronous message queues, multiple messaging
  131. patterns, message filtering (subscriptions), seamless access to
  132. multiple transport protocols and more.
  133. This package contains the ZeroMQ shared library.
  134. %package devel
  135. Summary: Development files and static library for the ZeroMQ library
  136. Group: Development/Libraries
  137. Requires: %{lib_name} = %{version}-%{release}, pkgconfig
  138. %bcond_with pgm
  139. %if %{with pgm}
  140. Requires: openpgm-devel
  141. %endif
  142. %bcond_with libgssapi_krb5
  143. %if %{with libgssapi_krb5}
  144. Requires: krb5-devel
  145. %endif
  146. %bcond_with libsodium
  147. %if %{with libsodium}
  148. Requires: libsodium-devel
  149. %endif
  150. %bcond_with nss
  151. %if %{with nss}
  152. %if 0%{?suse_version}
  153. Requires: mozilla-nss-devel
  154. %else
  155. Requires: nss-devel
  156. %endif
  157. %endif
  158. %bcond_with tls
  159. %if %{with tls} && ! 0%{?centos_version} < 700
  160. %if 0%{?suse_version}
  161. Requires: libgnutls-devel
  162. %else
  163. Requires: gnutls-devel
  164. %endif
  165. %endif
  166. %description devel
  167. The 0MQ lightweight messaging kernel is a library which extends the
  168. standard socket interfaces with features traditionally provided by
  169. specialised messaging middleware products. 0MQ sockets provide an
  170. abstraction of asynchronous message queues, multiple messaging
  171. patterns, message filtering (subscriptions), seamless access to
  172. multiple transport protocols and more.
  173. This package contains ZeroMQ related development libraries and header files.
  174. %package -n libzmq-tools
  175. Summary: ZeroMQ tools
  176. Group: Productivity/Networking/Web/Servers
  177. %description -n libzmq-tools
  178. The 0MQ lightweight messaging kernel is a library which extends the
  179. standard socket interfaces with features traditionally provided by
  180. specialised messaging middleware products. 0MQ sockets provide an
  181. abstraction of asynchronous message queues, multiple messaging
  182. patterns, message filtering (subscriptions), seamless access to
  183. multiple transport protocols and more.
  184. This package contains tools such as curve_keygen to use with libzmq.
  185. %prep
  186. %setup -q
  187. # Sed version number of openpgm into configure
  188. %global openpgm_pc $(basename %{_libdir}/pkgconfig/openpgm*.pc .pc)
  189. sed -i "s/openpgm-[0-9].[0-9]/%{openpgm_pc}/g" \
  190. configure*
  191. %build
  192. # Workaround for automake < 1.14 bug
  193. mkdir -p config
  194. autoreconf -fi
  195. %configure --enable-drafts=%{DRAFTS} \
  196. --with-pgm=%{PGM} \
  197. --with-libsodium=%{SODIUM} \
  198. --with-libgssapi_krb5=%{GSSAPI} \
  199. --with-nss=%{NSS} \
  200. --with-tls=%{TLS} \
  201. %{?_with_pic} \
  202. %{?_without_pic} \
  203. %{?_with_gnu_ld} \
  204. %{?_without_gnu_ld}
  205. %{__make} %{?_smp_mflags}
  206. %install
  207. [ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}
  208. # Install the package to build area
  209. %{__make} check VERBOSE=1
  210. %makeinstall
  211. %post
  212. /sbin/ldconfig
  213. %postun
  214. /sbin/ldconfig
  215. %clean
  216. [ "%{buildroot}" != "/" ] && %{__rm} -rf %{buildroot}
  217. %files -n %{lib_name}
  218. %defattr(-,root,root,-)
  219. # docs in the main package
  220. %doc AUTHORS COPYING COPYING.LESSER NEWS
  221. # libraries
  222. %{_libdir}/libzmq.so.*
  223. %{_mandir}/man7/zmq.7.gz
  224. %files devel
  225. %defattr(-,root,root,-)
  226. %{_includedir}/zmq.h
  227. %{_includedir}/zmq_utils.h
  228. %{_libdir}/libzmq.a
  229. %{_libdir}/pkgconfig/libzmq.pc
  230. %{_libdir}/libzmq.so
  231. %{_mandir}/man3/zmq*
  232. # skip man7/zmq.7.gz
  233. %{_mandir}/man7/zmq_*
  234. %files -n libzmq-tools
  235. %defattr(-,root,root,-)
  236. %{_bindir}/curve_keygen
  237. %changelog
  238. * Fri Oct 4 2019 Luca Boccassi <luca.boccassi@gmail.com>
  239. - Add macro for optional TLS dependency
  240. * Wed Sep 11 2019 Luca Boccassi <luca.boccassi@gmail.com>
  241. - Add macro for optional NSS dependency
  242. * Sat Aug 19 2017 Luca Boccassi <luca.boccassi@gmail.com>
  243. - Fix parsing and usage of conditionals for sodium/pgm/krb5 so that they work
  244. in OBS
  245. - Do not ship libzmq.la anymore, it's not needed and causes overlinking
  246. * Sun Nov 06 2016 Luca Boccassi <luca.boccassi@gmail.com>
  247. - Add libzmq-tool to package curve_keygen in /usr/bin
  248. * Sun Jul 31 2016 Luca Boccassi <luca.boccassi@gmail.com>
  249. - Follow RPM standards and rename zeromq to libzmq5
  250. * Sat Oct 25 2014 Phillip Mienk <mienkphi@gmail.com>
  251. - Add --with/--without libgssapi_krb5 support following J.T.Conklin's pattern
  252. * Sat Oct 18 2014 J.T. Conklin <jtc@acorntoolworks.com>
  253. - Add --with/--without pgm support
  254. - Add --with/--without libsodium support
  255. * Tue Jun 10 2014 Tristian Celestin <tristian.celestin@outlook.com> 4.0.4
  256. - Updated packaged files
  257. * Mon Nov 26 2012 Justin Cook <jhcook@gmail.com> 3.2.2
  258. - Update packaged files
  259. * Fri Apr 8 2011 Mikko Koppanen <mikko@kuut.io> 3.0.0-1
  260. - Update dependencies and packaged files
  261. * Sat Apr 10 2010 Mikko Koppanen <mkoppanen@php.net> 2.0.7-1
  262. - Initial packaging