sqlite.spec 5.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189
  1. ##
  2. ## sqlite.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2005 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ## Copyright (c) 2000-2005 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 version
  25. %define V_v2 2.8.16
  26. %define V_v3 3.2.6
  27. # package information
  28. Name: sqlite
  29. Summary: SQL Lite
  30. URL: http://www.sqlite.org/
  31. Vendor: D. Richard Hipp
  32. Packager: OpenPKG
  33. Distribution: OpenPKG
  34. Class: BASE
  35. Group: Database
  36. License: PD
  37. Version: %{V_v2}
  38. Release: 20050918
  39. # package options
  40. %option with_v3 yes
  41. %option with_utf8 no
  42. %option with_assert no
  43. %option with_readline no
  44. # list of sources
  45. Source0: http://www.sqlite.org/sqlite-%{V_v2}.tar.gz
  46. Source1: http://www.sqlite.org/sqlite-%{V_v3}.tar.gz
  47. Patch0: sqlite.patch
  48. Patch1: sqlite.patch.v3
  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. %if "%{with_v3}" == "yes"
  59. BuildPreReq: gawk
  60. %endif
  61. AutoReq: no
  62. AutoReqProv: no
  63. %description
  64. SQLite is a C library that implements an embeddable SQL database
  65. engine. Programs that link with the SQLite library can have SQL
  66. database access without running a separate RDBMS process. The
  67. distribution comes with a standalone command-line access program
  68. (sqlite) that can be used to administer an SQLite database and which
  69. serves as an example of how to use the SQLite library. SQLite is not
  70. a client library used to connect to a big database server. SQLite is
  71. the server. The SQLite library reads and writes directly to and from
  72. the database files on disk.
  73. This package contains both SQLite 2 (%{V_v2}) and optionally the
  74. forthcoming SQLite 3 (%{V_v3}). Notice that the two are API and
  75. database format incompatible but can be used at the same time.
  76. %track
  77. prog sqlite = {
  78. version = %{V_v2}
  79. url = http://www.sqlite.org/download.html
  80. regex = sqlite-(2\.\d+\.\d+)\.tar\.gz
  81. }
  82. prog sqlite:v3 = {
  83. version = %{V_v3}
  84. url = http://www.sqlite.org/download.html
  85. regex = sqlite-(\d+\.\d+\.\d+)\.tar\.gz
  86. }
  87. %prep
  88. %setup -q -c
  89. %patch -p0 -d sqlite-%{V_v2} -P 0
  90. %if "%{with_v3}" == "yes"
  91. %setup -q -D -T -a 1
  92. %patch -p0 -d sqlite-%{V_v3} -P 1
  93. %endif
  94. for v in %{V_v2} \
  95. %if "%{with_v3}" == "yes"
  96. %{V_v3} \
  97. %endif
  98. ; do
  99. %{l_shtool} subst \
  100. -e '/LINENO: error: C[+]* preprocessor/{N;N;N;N;s/.*/:/;}' \
  101. sqlite-$v/configure
  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_assert}" == "yes"
  136. %{l_shtool} subst \
  137. -e 's;-DNDEBUG;;' \
  138. Makefile
  139. %endif
  140. %if "%{with_v3}" == "yes"
  141. %{l_make} %{l_mflags -O} LIBPTHREAD=""
  142. %else
  143. %{l_make} %{l_mflags -O}
  144. %endif
  145. ) || exit $?
  146. done
  147. %install
  148. rm -rf $RPM_BUILD_ROOT
  149. %{l_shtool} mkdir -f -p -m 755 \
  150. $RPM_BUILD_ROOT%{l_prefix}/bin \
  151. $RPM_BUILD_ROOT%{l_prefix}/lib \
  152. $RPM_BUILD_ROOT%{l_prefix}/include \
  153. $RPM_BUILD_ROOT%{l_prefix}/man/man1
  154. %if "%{with_v3}" == "yes"
  155. ( cd sqlite-%{V_v3}
  156. %{l_make} %{l_mflags} install \
  157. prefix=$RPM_BUILD_ROOT%{l_prefix}
  158. %{l_shtool} install -c -m 644 \
  159. sqlite3.1 $RPM_BUILD_ROOT%{l_prefix}/man/man1/sqlite3.1
  160. ) || exit $?
  161. %endif
  162. ( cd sqlite-%{V_v2}
  163. %{l_make} %{l_mflags} install \
  164. prefix=$RPM_BUILD_ROOT%{l_prefix}
  165. %{l_shtool} install -c -m 644 \
  166. sqlite.1 $RPM_BUILD_ROOT%{l_prefix}/man/man1/sqlite.1
  167. ) || exit $?
  168. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* >/dev/null 2>&1 || true
  169. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  170. %{l_files_std} \
  171. '%not %dir %{l_prefix}/lib/pkgconfig'
  172. %files -f files
  173. %clean
  174. rm -rf $RPM_BUILD_ROOT