sqlite.spec 5.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. ##
  2. ## sqlite.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2005 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2005 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2005 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.16
  27. %define V_v3 3.1.5
  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: 20050314
  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. Patch1: sqlite.patch.v3
  50. # build information
  51. Prefix: %{l_prefix}
  52. BuildRoot: %{l_buildroot}
  53. BuildPreReq: OpenPKG, openpkg >= 20040130, make
  54. PreReq: OpenPKG, openpkg >= 20040130
  55. %if "%{with_readline}" == "yes"
  56. BuildPreReq: readline
  57. PreReq: readline
  58. %endif
  59. %if "%{with_v3}" == "yes"
  60. BuildPreReq: gawk
  61. %endif
  62. AutoReq: no
  63. AutoReqProv: no
  64. %description
  65. SQLite is a C library that implements an embeddable SQL database
  66. engine. Programs that link with the SQLite library can have SQL
  67. database access without running a separate RDBMS process. The
  68. distribution comes with a standalone command-line access program
  69. (sqlite) that can be used to administer an SQLite database and which
  70. serves as an example of how to use the SQLite library. SQLite is not
  71. a client library used to connect to a big database server. SQLite is
  72. the server. The SQLite library reads and writes directly to and from
  73. the database files on disk.
  74. This package contains both SQLite 2 (%{V_v2}) and optionally the
  75. forthcoming SQLite 3 (%{V_v3}). Notice that the two are API and
  76. database format incompatible but can be used at the same time.
  77. %track
  78. prog sqlite = {
  79. version = %{V_v2}
  80. url = http://www.sqlite.org/download.html
  81. regex = sqlite-(2\.\d+\.\d+)\.tar\.gz
  82. }
  83. prog sqlite:v3 = {
  84. version = %{V_v3}
  85. url = http://www.sqlite.org/download.html
  86. regex = sqlite-(\d+\.\d+\.\d+)\.tar\.gz
  87. }
  88. %prep
  89. %setup -q -c
  90. %patch -p0 -d sqlite-%{V_v2} -P 0
  91. %if "%{with_v3}" == "yes"
  92. %setup -q -D -T -a 1
  93. %patch -p0 -d sqlite-%{V_v3} -P 1
  94. %endif
  95. for v in %{V_v2} \
  96. %if "%{with_v3}" == "yes"
  97. %{V_v3} \
  98. %endif
  99. ; do
  100. %{l_shtool} subst \
  101. -e '/LINENO: error: C[+]* preprocessor/{N;N;N;N;s/.*/:/;}' \
  102. sqlite-$v/configure
  103. done
  104. %build
  105. for v in %{V_v2} \
  106. %if "%{with_v3}" == "yes"
  107. %{V_v3} \
  108. %endif
  109. ; do
  110. ( cd sqlite-$v
  111. CC="%{l_cc}"
  112. export CC
  113. CPPFLAGS="%{l_cppflags}"
  114. export CPPFLAGS
  115. CFLAGS="%{l_cflags -O}"
  116. export CFLAGS
  117. LDFLAGS="%{l_ldflags}"
  118. export LDFLAGS
  119. LIBS=""
  120. export LIBS
  121. %if "%{with_assert}" == "no"
  122. CFLAGS="$CFLAGS -DNDEBUG=1"
  123. %endif
  124. %if "%{with_readline}" == "yes"
  125. config_TARGET_READLINE_INC="%{l_cppflags readline}"
  126. export config_TARGET_READLINE_INC
  127. config_TARGET_READLINE_LIBS="%{l_ldflags} -lreadline -ltermcap"
  128. export config_TARGET_READLINE_LIBS
  129. %endif
  130. ./configure \
  131. --prefix=%{l_prefix} \
  132. %if "%{with_utf8}" == "yes"
  133. --enable-utf8 \
  134. %endif
  135. --disable-shared
  136. %if "%{with_assert}" == "yes"
  137. %{l_shtool} subst \
  138. -e 's;-DNDEBUG;;' \
  139. Makefile
  140. %endif
  141. %if "%{with_v3}" == "yes"
  142. %{l_make} %{l_mflags -O} LIBPTHREAD=""
  143. %else
  144. %{l_make} %{l_mflags -O}
  145. %endif
  146. ) || exit $?
  147. done
  148. %install
  149. rm -rf $RPM_BUILD_ROOT
  150. %{l_shtool} mkdir -f -p -m 755 \
  151. $RPM_BUILD_ROOT%{l_prefix}/bin \
  152. $RPM_BUILD_ROOT%{l_prefix}/lib \
  153. $RPM_BUILD_ROOT%{l_prefix}/include \
  154. $RPM_BUILD_ROOT%{l_prefix}/man/man1
  155. %if "%{with_v3}" == "yes"
  156. ( cd sqlite-%{V_v3}
  157. %{l_make} %{l_mflags} install \
  158. prefix=$RPM_BUILD_ROOT%{l_prefix}
  159. %{l_shtool} install -c -m 644 \
  160. sqlite3.1 $RPM_BUILD_ROOT%{l_prefix}/man/man1/sqlite3.1
  161. ) || exit $?
  162. %endif
  163. ( cd sqlite-%{V_v2}
  164. %{l_make} %{l_mflags} install \
  165. prefix=$RPM_BUILD_ROOT%{l_prefix}
  166. %{l_shtool} install -c -m 644 \
  167. sqlite.1 $RPM_BUILD_ROOT%{l_prefix}/man/man1/sqlite.1
  168. ) || exit $?
  169. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  170. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  171. %{l_files_std} \
  172. '%not %dir %{l_prefix}/lib/pkgconfig'
  173. %files -f files
  174. %clean
  175. rm -rf $RPM_BUILD_ROOT