libzdb.spec 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. ##
  2. ## libzdb.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2009 OpenPKG Foundation e.V. <http://openpkg.net/>
  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: libzdb
  25. Summary: Zild Database Library
  26. URL: http://www.tildeslash.com/libzdb/
  27. Vendor: Tildeslash Ltd.
  28. Packager: OpenPKG Foundation e.V.
  29. Distribution: OpenPKG Community
  30. Class: EVAL
  31. Group: Database
  32. License: GPL (with exceptions)
  33. Version: 2.6
  34. Release: 20090703
  35. # package options
  36. %option with_mysql no
  37. %option with_pgsql no
  38. %option with_sqlite yes
  39. # list of sources
  40. Source0: http://www.tildeslash.com/libzdb/dist/libzdb-%{version}.tar.gz
  41. # build information
  42. Prefix: %{l_prefix}
  43. BuildRoot: %{l_buildroot}
  44. BuildPreReq: OpenPKG, openpkg >= 20060823
  45. PreReq: OpenPKG, openpkg >= 20060823
  46. %if "%{with_mysql}" == "yes"
  47. BuildPreReq: mysql, zlib
  48. PreReq: mysql, zlib
  49. %endif
  50. %if "%{with_pgsql}" == "yes"
  51. BuildPreReq: openssl, postgresql
  52. PreReq: openssl, postgresql
  53. %endif
  54. %if "%{with_sqlite}" == "yes"
  55. BuildPreReq: sqlite
  56. PreReq: sqlite
  57. %endif
  58. AutoReq: no
  59. AutoReqProv: no
  60. %description
  61. The Zild C Database Library implements a small, fast, and easy to
  62. use database API with thread-safe connection pooling. The library
  63. can connect transparently to multiple database systems, has zero
  64. configuration and connections are specified via a standard URL
  65. scheme.
  66. %track
  67. prog libzdb = {
  68. version = %{version}
  69. url = http://www.tildeslash.com/libzdb/download.html
  70. regex = libzdb-(__VER__)\.tar\.gz
  71. }
  72. %prep
  73. %setup -q
  74. %build
  75. libs=""
  76. %if "%{with_pgsql}" == "yes"
  77. libs="$libs -lssl -lcrypto -lcrypt"
  78. %endif
  79. CC="%{l_cc}" \
  80. CFLAGS="%{l_cflags -O}" \
  81. CPPFLAGS="%{l_cppflags}" \
  82. LDFLAGS="%{l_ldflags}" \
  83. LIBS="$libs" \
  84. ./configure \
  85. --prefix=%{l_prefix} \
  86. --includedir=%{l_prefix}/include/libzdb \
  87. --libdir=%{l_prefix}/lib/libzdb \
  88. %if "%{with_sqlite}" == "yes"
  89. --with-sqlite=%{l_prefix} \
  90. %else
  91. --without-sqlite \
  92. %endif
  93. %if "%{with_mysql}" == "yes"
  94. --with-mysql=%{l_prefix} \
  95. %else
  96. --without-mysql \
  97. %endif
  98. %if "%{with_pgsql}" == "yes"
  99. --with-postgresql=%{l_prefix}/bin \
  100. %else
  101. --without-postgresql \
  102. %endif
  103. --disable-shared
  104. %{l_make} %{l_mflags} clean || true
  105. %{l_make} %{l_mflags -O}
  106. %install
  107. rm -rf $RPM_BUILD_ROOT
  108. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  109. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  110. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  111. %files -f files
  112. %clean
  113. rm -rf $RPM_BUILD_ROOT