sqlite.spec 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. ##
  2. ## sqlite.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2004 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2004 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2004 Cable & Wireless <http://www.cw.com/>
  6. ##
  7. ## Permission to use, copy, modify, and distribute this software for
  8. ## any purpose with or without fee is hereby granted, provided that
  9. ## the above copyright notice and this permission notice appear in all
  10. ## copies.
  11. ##
  12. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  13. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  14. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  15. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  16. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  17. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  18. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  19. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  20. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  21. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  22. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  23. ## SUCH DAMAGE.
  24. ##
  25. # package version
  26. %define V_v2 2.8.15
  27. %define V_v3 3.0.8
  28. # package information
  29. Name: sqlite
  30. Summary: SQL Lite
  31. URL: http://www.sqlite.org/
  32. Vendor: D. Richard Hipp
  33. Packager: The OpenPKG Project
  34. Distribution: OpenPKG
  35. Class: BASE
  36. Group: Database
  37. License: PD
  38. Version: %{V_v2}
  39. Release: 20041018
  40. # package options
  41. %option with_utf8 no
  42. %option with_assert no
  43. %option with_readline no
  44. %option with_v3 no
  45. # list of sources
  46. Source0: http://www.sqlite.org/sqlite-%{V_v2}.tar.gz
  47. Source1: http://www.sqlite.org/sqlite-%{V_v3}.tar.gz
  48. Patch0: sqlite.patch
  49. # build information
  50. Prefix: %{l_prefix}
  51. BuildRoot: %{l_buildroot}
  52. BuildPreReq: OpenPKG, openpkg >= 20040130, make
  53. PreReq: OpenPKG, openpkg >= 20040130
  54. %if "%{with_readline}" == "yes"
  55. BuildPreReq: readline
  56. PreReq: readline
  57. %endif
  58. AutoReq: no
  59. AutoReqProv: no
  60. %description
  61. SQLite is a C library that implements an embeddable SQL database
  62. engine. Programs that link with the SQLite library can have SQL
  63. database access without running a separate RDBMS process. The
  64. distribution comes with a standalone command-line access program
  65. (sqlite) that can be used to administer an SQLite database and which
  66. serves as an example of how to use the SQLite library. SQLite is not
  67. a client library used to connect to a big database server. SQLite is
  68. the server. The SQLite library reads and writes directly to and from
  69. the database files on disk.
  70. This package contains both SQLite 2 (%{V_v2}) and optionally the
  71. forthcoming SQLite 3 (%{V_v3}). Notice that the two are API and
  72. database format incompatible but can be used at the same time.
  73. %track
  74. prog sqlite = {
  75. version = %{V_v2}
  76. url = http://www.sqlite.org/download.html
  77. regex = sqlite-(2\.\d+\.\d+)\.tar\.gz
  78. }
  79. prog sqlite:v3 = {
  80. version = %{V_v3}
  81. url = http://www.sqlite.org/download.html
  82. regex = sqlite-(__VER__)\.tar\.gz
  83. }
  84. %prep
  85. %setup -q -c
  86. mv sqlite sqlite-%{V_v2}
  87. %if "%{with_v3}" == "yes"
  88. %setup -q -D -T -a 1
  89. mv sqlite sqlite-%{V_v3}
  90. %endif
  91. for v in %{V_v2} \
  92. %if "%{with_v3}" == "yes"
  93. %{V_v3} \
  94. %endif
  95. ; do
  96. ( cd sqlite-$v
  97. %{l_shtool} subst \
  98. -e '/LINENO: error: C[+]* preprocessor/{N;N;N;N;s/.*/:/;}' \
  99. configure
  100. %patch -p0
  101. ) || exit $?
  102. done
  103. %build
  104. for v in %{V_v2} \
  105. %if "%{with_v3}" == "yes"
  106. %{V_v3} \
  107. %endif
  108. ; do
  109. ( cd sqlite-$v
  110. CC="%{l_cc}"
  111. export CC
  112. CPPFLAGS="%{l_cppflags}"
  113. export CPPFLAGS
  114. CFLAGS="%{l_cflags -O}"
  115. export CFLAGS
  116. LDFLAGS="%{l_ldflags}"
  117. export LDFLAGS
  118. LIBS=""
  119. export LIBS
  120. %if "%{with_assert}" == "no"
  121. CFLAGS="$CFLAGS -DNDEBUG=1"
  122. %endif
  123. %if "%{with_readline}" == "yes"
  124. config_TARGET_READLINE_INC="%{l_cppflags readline}"
  125. export config_TARGET_READLINE_INC
  126. config_TARGET_READLINE_LIBS="%{l_ldflags} -lreadline -ltermcap"
  127. export config_TARGET_READLINE_LIBS
  128. %endif
  129. ./configure \
  130. --prefix=%{l_prefix} \
  131. %if "%{with_utf8}" == "yes"
  132. --enable-utf8 \
  133. %endif
  134. --disable-shared
  135. %if "%{with_v3}" == "yes"
  136. %{l_make} %{l_mflags -O} LIBPTHREAD=""
  137. %else
  138. %{l_make} %{l_mflags -O}
  139. %endif
  140. ) || exit $?
  141. done
  142. %install
  143. rm -rf $RPM_BUILD_ROOT
  144. %{l_shtool} mkdir -f -p -m 755 \
  145. $RPM_BUILD_ROOT%{l_prefix}/bin \
  146. $RPM_BUILD_ROOT%{l_prefix}/lib \
  147. $RPM_BUILD_ROOT%{l_prefix}/include \
  148. $RPM_BUILD_ROOT%{l_prefix}/man/man1
  149. %if "%{with_v3}" == "yes"
  150. ( cd sqlite-%{V_v3}
  151. %{l_make} %{l_mflags} install \
  152. prefix=$RPM_BUILD_ROOT%{l_prefix}
  153. %{l_shtool} install -c -m 644 \
  154. sqlite.1 $RPM_BUILD_ROOT%{l_prefix}/man/man1/sqlite3.1
  155. ) || exit $?
  156. %endif
  157. ( cd sqlite-%{V_v2}
  158. %{l_make} %{l_mflags} install \
  159. prefix=$RPM_BUILD_ROOT%{l_prefix}
  160. %{l_shtool} install -c -m 644 \
  161. sqlite.1 $RPM_BUILD_ROOT%{l_prefix}/man/man1/sqlite.1
  162. ) || exit $?
  163. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  164. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  165. %{l_files_std} \
  166. '%not %dir %{l_prefix}/lib/pkgconfig'
  167. %files -f files
  168. %clean
  169. rm -rf $RPM_BUILD_ROOT