opendbx.spec 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. ##
  2. ## opendbx.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2007 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ## Copyright (c) 2000-2007 Ralf S. Engelschall <http://engelschall.com/>
  5. ##
  6. ## Permission to use, copy, modify, and distribute this software for
  7. ## any purpose with or without fee is hereby granted, provided that
  8. ## the above copyright notice and this permission notice appear in all
  9. ## copies.
  10. ##
  11. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  12. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  13. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  14. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  15. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  17. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  18. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  19. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  20. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  21. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  22. ## SUCH DAMAGE.
  23. ##
  24. # package information
  25. Name: opendbx
  26. Summary: Database Access Abstraction Library
  27. URL: http://www.linuxnetworks.de/opendbx/
  28. Vendor: Norbert Sendetzky
  29. Packager: OpenPKG Foundation e.V.
  30. Distribution: OpenPKG Community
  31. Class: EVAL
  32. Group: Database
  33. License: LGPL
  34. Version: 1.2.1
  35. Release: 20070211
  36. # package options
  37. %option with_sqlite yes
  38. %option with_mysql yes
  39. %option with_pgsql yes
  40. # list of sources
  41. Source0: http://www.linuxnetworks.de/opendbx/download/opendbx-%{version}.tar.gz
  42. # build information
  43. Prefix: %{l_prefix}
  44. BuildRoot: %{l_buildroot}
  45. BuildPreReq: OpenPKG, openpkg >= 20040130, gcc
  46. PreReq: OpenPKG, openpkg >= 20040130
  47. %if "%{with_sqlite}" == "yes"
  48. BuildPreReq: sqlite, pkgconfig
  49. PreReq: sqlite
  50. %endif
  51. %if "%{with_mysql}" == "yes"
  52. BuildPreReq: mysql
  53. PreReq: mysql
  54. %endif
  55. %if "%{with_pgsql}" == "yes"
  56. BuildPreReq: postgresql
  57. PreReq: postgresql
  58. %endif
  59. AutoReq: no
  60. AutoReqProv: no
  61. %description
  62. OpenDBX is an extremely lightweight but extensible C library for
  63. accessing databases with a single API. It provides a clean and
  64. simple interface across all supported databases that leads to an
  65. elegant code design automatically.
  66. %track
  67. prog opendbx = {
  68. version = %{version}
  69. url = http://www.linuxnetworks.de/opendbx/download/
  70. regex = opendbx-(__VER__)\.tar\.gz
  71. }
  72. %prep
  73. %setup -q
  74. %build
  75. export CC="%{l_cc}"
  76. export CFLAGS="%{l_cflags -O}"
  77. export CPPFLAGS="%{l_cppflags}"
  78. export LDFLAGS="%{l_ldflags}"
  79. export LIBS=""
  80. backends=""
  81. %if "%{with_sqlite}" == "yes"
  82. backends="$backends sqlite3"
  83. CPPFLAGS="$CPPFLAGS `pkg-config sqlite3 --cflags`"
  84. LDFLAGS="$LDFLAGS `pkg-config sqlite3 --libs-only-L`"
  85. LIBS="$LIBS `pkg-config sqlite3 --libs-only-l`"
  86. %endif
  87. %if "%{with_mysql}" == "yes"
  88. backends="$backends mysql"
  89. CPPFLAGS="$CPPFLAGS `mysql_config --include`"
  90. LIBS="$LIBS `mysql_config --libs`"
  91. %endif
  92. %if "%{with_pgsql}" == "yes"
  93. backends="$backends pgsql"
  94. CPPFLAGS="$CPPFLAGS `pg_config --cppflags` %{l_cppflags postgresql}"
  95. LDFLAGS="$LDFLAGS `pg_config --ldflags`"
  96. LIBS="$LIBS `pg_config --libs`"
  97. %endif
  98. ./configure \
  99. --prefix=%{l_prefix} \
  100. --with-backends="$backends" \
  101. --disable-nls
  102. %{l_make} %{l_mflags -O}
  103. %install
  104. rm -rf $RPM_BUILD_ROOT
  105. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  106. rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/opendbx/lib*.a
  107. rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/opendbx/lib*.la
  108. rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/libopendbx.so*
  109. rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/libopendbx.la
  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