groonga.spec 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158
  1. ##
  2. ## groonga.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2022 OpenPKG Project <http://openpkg.org/>
  4. ##
  5. ## Permission to use, copy, modify, and distribute this software for
  6. ## any purpose with or without fee is hereby granted, provided that
  7. ## the above copyright notice and this permission notice appear in all
  8. ## copies.
  9. ##
  10. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  11. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  12. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  13. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  14. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  15. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  16. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  17. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  18. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  19. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  20. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  21. ## SUCH DAMAGE.
  22. ##
  23. # package information
  24. Name: groonga
  25. Summary: Full-Text Search Engine
  26. URL: http://groonga.org/
  27. Vendor: Brazil, Inc.
  28. Packager: OpenPKG Project
  29. Distribution: OpenPKG Community
  30. Class: EVAL
  31. Group: Database
  32. License: GPL
  33. Version: 12.0.3
  34. Release: 20220429
  35. # package options
  36. %option with_zlib no
  37. %option with_zstd no
  38. %option with_lz4 no
  39. %option with_msgpack no
  40. # list of sources
  41. Source0: http://packages.groonga.org/source/groonga/groonga-%{version}.tar.gz
  42. Patch0: groonga.patch
  43. # build information
  44. BuildPreReq: OpenPKG, openpkg >= 20160101, gcc, gcc::with_cxx = yes, pkgconfig
  45. PreReq: OpenPKG, openpkg >= 20160101
  46. BuildPreReq: glib
  47. PreReq: glib
  48. %if "%{with_zlib}" == "yes"
  49. BuildPreReq: zlib
  50. PreReq: zlib
  51. %endif
  52. %if "%{with_zstd}" == "yes"
  53. BuildPreReq: zstd
  54. PreReq: zstd
  55. %endif
  56. %if "%{with_lz4}" == "yes"
  57. BuildPreReq: lz4
  58. PreReq: lz4
  59. %endif
  60. %if "%{with_msgpack}" == "yes"
  61. BuildPreReq: msgpack
  62. PreReq: msgpack
  63. %endif
  64. %description
  65. Groonga is an open-source fulltext search engine and column store.
  66. It lets you write high-performance applications that requires
  67. fulltext search.
  68. %track
  69. prog groonga = {
  70. version = %{version}
  71. url = http://packages.groonga.org/source/groonga/
  72. regex = groonga-(__VER__)\.tar\.gz
  73. }
  74. %prep
  75. %setup -q
  76. %patch -p0
  77. %build
  78. # configure program
  79. CC="%{l_cc} %{l_cflags -O}" \
  80. CXX="%{l_cxx} %{l_cxxflags -O}" \
  81. CFLAGS="%{l_cflags -O}" \
  82. CXXFLAGS="%{l_cxxflags -O}" \
  83. CPPFLAGS="%{l_cppflags}" \
  84. LDFLAGS="%{l_ldflags}" \
  85. ./configure \
  86. --prefix=%{l_prefix} \
  87. --mandir=%{l_prefix}/man \
  88. %if "%{with_zlib}" == "yes"
  89. --with-zlib=%{l_prefix} \
  90. %else
  91. --without-zlib \
  92. %endif
  93. %if "%{with_zstd}" == "yes"
  94. --with-zstd=%{l_prefix} \
  95. %else
  96. --without-zstd \
  97. %endif
  98. %if "%{with_lz4}" == "yes"
  99. --with-lz4=%{l_prefix} \
  100. %else
  101. --without-lz4 \
  102. %endif
  103. %if "%{with_msgpack}" == "yes"
  104. --enable-message-pack \
  105. --with-message-pack=%{l_prefix} \
  106. %else
  107. --disable-message-pack \
  108. --without-message-pack \
  109. %endif
  110. --without-libstemmer \
  111. --without-ssl \
  112. --without-zeromq \
  113. --disable-groonga-httpd \
  114. --disable-shared \
  115. --enable-static \
  116. --disable-nls
  117. # build program
  118. %{l_make} %{l_mflags -O}
  119. %install
  120. # install program
  121. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  122. # post-adjust installation
  123. rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/libgroonga.so*
  124. %{l_shtool} subst \
  125. -e 's;^\(dlname=.\).*\(.\)$;\1\2;' \
  126. -e 's;^\(library_names=.\).*\(.\)$;\1\2;' \
  127. $RPM_BUILD_ROOT%{l_prefix}/lib/libgroonga.la
  128. # strip-down installation
  129. rm -rf $RPM_BUILD_ROOT%{l_prefix}/etc/groonga/windows_event_log
  130. rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/groonga/plugins/*/*.a
  131. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/doc
  132. rm -rf $RPM_BUILD_ROOT%{l_prefix}/share/groonga
  133. rm -rf $RPM_BUILD_ROOT%{l_prefix}/etc/groonga/httpd
  134. rm -rf $RPM_BUILD_ROOT%{l_prefix}/man/ja
  135. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  136. # determine installation files
  137. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  138. %{l_files_std} \
  139. '%config %{l_prefix}/etc/groonga/*'
  140. %files -f files
  141. %clean