opendbx.spec 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. ##
  2. ## opendbx.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: opendbx
  25. Summary: Database Access Abstraction Library
  26. URL: http://www.linuxnetworks.de/opendbx/
  27. Vendor: Norbert Sendetzky
  28. Packager: OpenPKG Foundation e.V.
  29. Distribution: OpenPKG Community
  30. Class: EVAL
  31. Group: Database
  32. License: LGPL
  33. Version: 1.4.3
  34. Release: 20090903
  35. # package options
  36. %option with_sqlite yes
  37. %option with_mysql yes
  38. %option with_pgsql yes
  39. # list of sources
  40. Source0: http://www.linuxnetworks.de/opendbx/download/opendbx-%{version}.tar.gz
  41. Patch0: opendbx.patch
  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/doc/index.php/OpenDBX_Download
  70. regex = opendbx-(__VER__)\.tar\.gz
  71. }
  72. %prep
  73. %setup -q
  74. %patch -p0
  75. %build
  76. export CC="%{l_cc}"
  77. export CFLAGS="%{l_cflags -O}"
  78. export CPPFLAGS="%{l_cppflags}"
  79. export LDFLAGS="%{l_ldflags}"
  80. export LIBS=""
  81. backends=""
  82. %if "%{with_sqlite}" == "yes"
  83. backends="$backends sqlite3"
  84. CPPFLAGS="$CPPFLAGS `pkg-config sqlite3 --cflags`"
  85. LDFLAGS="$LDFLAGS `pkg-config sqlite3 --libs-only-L`"
  86. LIBS="$LIBS `pkg-config sqlite3 --libs-only-l`"
  87. %endif
  88. %if "%{with_mysql}" == "yes"
  89. backends="$backends mysql"
  90. CPPFLAGS="$CPPFLAGS `mysql_config --include`"
  91. LIBS="$LIBS `mysql_config --libs`"
  92. %endif
  93. %if "%{with_pgsql}" == "yes"
  94. backends="$backends pgsql"
  95. CPPFLAGS="$CPPFLAGS `pg_config --cppflags` %{l_cppflags postgresql}"
  96. LDFLAGS="$LDFLAGS `pg_config --ldflags`"
  97. LIBS="$LIBS `pg_config --libs`"
  98. %endif
  99. ./configure \
  100. --prefix=%{l_prefix} \
  101. --with-backends="$backends" \
  102. --disable-nls
  103. %{l_make} %{l_mflags}
  104. %install
  105. rm -rf $RPM_BUILD_ROOT
  106. %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT"
  107. rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/opendbx/lib*.a
  108. rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/opendbx/lib*.la
  109. rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/libopendbx.so*
  110. rm -f $RPM_BUILD_ROOT%{l_prefix}/lib/libopendbx.la
  111. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  112. %files -f files
  113. %clean
  114. rm -rf $RPM_BUILD_ROOT