perl-dbi.spec 8.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234
  1. ##
  2. ## perl-dbi.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. # versions of individual parts
  26. %define V_dbi 1.40
  27. %define V_sql_statement 1.005
  28. %define V_dbd_anydata 0.06
  29. %define V_dbd_sprite 0.47
  30. %define V_dbd_sqlite 0.31
  31. %define V_dbd_mysql 2.9003
  32. %define V_dbd_pgsql 1.31
  33. %define V_dbd_oracle 1.15
  34. %define V_dbd_odbc 1.06
  35. # package information
  36. Name: perl-dbi
  37. Summary: Perl Modules for use with DBI API
  38. URL: http://www.cpan.org/
  39. Vendor: Perl Community
  40. Packager: The OpenPKG Project
  41. Distribution: OpenPKG
  42. Class: BASE
  43. Group: Language
  44. License: GPL/Artistic
  45. Version: 20040215
  46. Release: 20040215
  47. # package options
  48. %option with_dbd_mysql no
  49. %option with_dbd_pgsql no
  50. %option with_dbd_oracle no
  51. %option with_dbd_odbc no
  52. # list of sources
  53. Source0: http://www.cpan.org/modules/by-module/DBI/DBI-%{V_dbi}.tar.gz
  54. Source1: http://www.cpan.org/modules/by-module/SQL/SQL-Statement-%{V_sql_statement}.tar.gz
  55. Source2: http://www.cpan.org/modules/by-module/DBD/DBD-AnyData-%{V_dbd_anydata}.tar.gz
  56. Source3: http://www.cpan.org/modules/by-module/DBD/DBD-Sprite-%{V_dbd_sprite}.tar.gz
  57. Source4: http://www.cpan.org/modules/by-module/DBD/DBD-SQLite-%{V_dbd_sqlite}.tar.gz
  58. Source5: http://www.cpan.org/modules/by-module/DBD/DBD-mysql-%{V_dbd_mysql}.tar.gz
  59. Source6: http://www.cpan.org/modules/by-module/DBD/DBD-Pg-%{V_dbd_pgsql}.tar.gz
  60. Source7: http://www.cpan.org/modules/by-module/DBD/DBD-Oracle-%{V_dbd_oracle}.tar.gz
  61. Source8: http://www.cpan.org/modules/by-module/DBD/DBD-ODBC-%{V_dbd_odbc}.tar.gz
  62. Patch0: perl-dbi.patch
  63. # build information
  64. Prefix: %{l_prefix}
  65. BuildRoot: %{l_buildroot}
  66. BuildPreReq: OpenPKG, openpkg >= 20040130, perl, perl-openpkg >= 20040126, perl-net
  67. PreReq: OpenPKG, openpkg >= 20040130, perl, perl-openpkg >= 20040126, perl-net
  68. %if "%{with_dbd_mysql}" == "yes"
  69. BuildPreReq: mysql
  70. PreReq: mysql
  71. %endif
  72. %if "%{with_dbd_pgsql}" == "yes"
  73. BuildPreReq: postgresql
  74. PreReq: postgresql
  75. %endif
  76. %if "%{with_dbd_oracle}" == "yes"
  77. BuildPreReq: ORACLE
  78. PreReq: ORACLE
  79. %endif
  80. %if "%{with_dbd_odbc}" == "yes"
  81. BuildPreReq: unixodbc
  82. PreReq: unixodbc
  83. %endif
  84. AutoReq: no
  85. AutoReqProv: no
  86. %description
  87. Various modules for using the DBI API of Perl:
  88. - DBI (%{V_dbi})
  89. - SQL::Statement (%{V_sql_statement})
  90. - DBD::AnyData (%{V_dbd_anydata})
  91. - DBD::Sprite (%{V_dbd_sprite})
  92. - DBD::SQLite (%{V_dbd_sqlite})
  93. - DBD::mysql (%{V_dbd_mysql}) [%{with_dbd_mysql}]
  94. - DBD::Pg (%{V_dbd_pgsql}) [%{with_dbd_pgsql}]
  95. - DBD::Oracle (%{V_dbd_oracle}) [%{with_dbd_oracle}]
  96. - DBD::ODBC (%{V_dbd_odbc}) [%{with_dbd_odbc}]
  97. %track
  98. prog perl-dbi:DBD-AnyData = {
  99. version = %{V_dbd_anydata}
  100. url = http://www.cpan.org/modules/by-module/DBD/
  101. regex = DBD-AnyData-(__VER__)\.tar\.gz
  102. }
  103. prog perl-dbi:DBD-mysql = {
  104. version = %{V_dbd_mysql}
  105. url = http://www.cpan.org/modules/by-module/DBD/
  106. regex = DBD-mysql-(__VER__)\.tar\.gz
  107. }
  108. prog perl-dbi:DBD-ODBC = {
  109. version = %{V_dbd_odbc}
  110. url = http://www.cpan.org/modules/by-module/DBD/
  111. regex = DBD-ODBC-(__VER__)\.tar\.gz
  112. }
  113. prog perl-dbi:DBD-Oracle = {
  114. version = %{V_dbd_oracle}
  115. url = http://www.cpan.org/modules/by-module/DBD/
  116. regex = DBD-Oracle-(__VER__)\.tar\.gz
  117. }
  118. prog perl-dbi:DBD-Pg = {
  119. version = %{V_dbd_pgsql}
  120. url = http://www.cpan.org/modules/by-module/DBD/
  121. regex = DBD-Pg-(__VER__)\.tar\.gz
  122. }
  123. prog perl-dbi:DBD-Sprite = {
  124. version = %{V_dbd_sprite}
  125. url = http://www.cpan.org/modules/by-module/DBD/
  126. regex = DBD-Sprite-(__VER__)\.tar\.gz
  127. }
  128. prog perl-dbi:DBD-SQLite = {
  129. version = %{V_dbd_sqlite}
  130. url = http://www.cpan.org/modules/by-module/DBD/
  131. regex = DBD-SQLite-(__VER__)\.tar\.gz
  132. }
  133. prog perl-dbi:DBI = {
  134. version = %{V_dbi}
  135. url = http://www.cpan.org/modules/by-module/DBI/
  136. regex = DBI-(\d+\.\d\d)\.tar\.gz
  137. }
  138. prog perl-dbi:SQL-Statement = {
  139. version = %{V_sql_statement}
  140. url = http://www.cpan.org/modules/by-module/SQL/
  141. regex = SQL-Statement-(__VER__)\.tar\.gz
  142. }
  143. %prep
  144. %setup -q -c
  145. %setup -q -T -D -a 1
  146. %setup -q -T -D -a 2
  147. %setup -q -T -D -a 3
  148. %setup -q -T -D -a 4
  149. %setup -q -T -D -a 5
  150. %setup -q -T -D -a 6
  151. %setup -q -T -D -a 7
  152. %setup -q -T -D -a 8
  153. %patch -p0
  154. %build
  155. %install
  156. %{l_prefix}/bin/perl-openpkg prepare
  157. # build and install individual modules
  158. %{l_prefix}/bin/perl-openpkg -d %{SOURCE0} configure build install
  159. %{l_prefix}/bin/perl-openpkg -d %{SOURCE1} configure build install
  160. %{l_prefix}/bin/perl-openpkg -d %{SOURCE2} configure build install
  161. %{l_prefix}/bin/perl-openpkg -d %{SOURCE3} configure build install
  162. %{l_prefix}/bin/perl-openpkg -d %{SOURCE4} configure build install
  163. %if "%{with_dbd_mysql}" == "yes"
  164. # build DBD::mysql
  165. ( cd DBD-mysql-%{V_dbd_mysql}
  166. # (determines MySQL header/lib paths via mysql_config in $PATH)
  167. ) || exit $?
  168. %{l_prefix}/bin/perl-openpkg -d DBD-mysql-%{V_dbd_mysql} configure build install
  169. %endif
  170. %if "%{with_dbd_pgsql}" == "yes"
  171. # build DBD::Pg
  172. ( cd DBD-Pg-%{V_dbd_pgsql}
  173. %{l_shtool} subst -e 's;-lpq;-lpq -lssl -lcrypto -lcrypt;' Makefile.PL
  174. POSTGRES_HOME=%{l_prefix}
  175. export POSTGRES_HOME
  176. ) || exit $?
  177. %{l_prefix}/bin/perl-openpkg -d DBD-Pg-%{V_dbd_pgsql} configure build install
  178. %endif
  179. %if "%{with_dbd_oracle}" == "yes"
  180. # build DBD::oracle
  181. ( cd DBD-Oracle-%{V_dbd_oracle}
  182. ORACLE_HOME="`%{l_prefix}/etc/rc --query oracle_home`"
  183. export ORACLE_HOME
  184. case "%{l_platform -t}" in
  185. i?86-linux* )
  186. ;;
  187. sun*-sunos* )
  188. # OpenPKG builds with gcc in 32-bit mode by default
  189. %{l_shtool} subst \
  190. -e 's;demo_rdbms\.mk;demo_rdbms32.mk;g' \
  191. Makefile.PL
  192. ;;
  193. * )
  194. echo "Platform \"%{l_platform -t}\" not supported" 1>&2
  195. exit 1
  196. ;;
  197. esac
  198. ) || exit $?
  199. %{l_prefix}/bin/perl-openpkg -d DBD-Oracle-%{V_dbd_oracle} configure build install
  200. %endif
  201. %if "%{with_dbd_odbc}" == "yes"
  202. # build DBD::odbc
  203. ( cd DBD-ODBC-%{V_dbd_odbc}
  204. ODBCHOME="%{l_prefix}"
  205. DBROOT=
  206. export ODBCHOME DBROOT
  207. ) || exit $?
  208. %{l_prefix}/bin/perl-openpkg -d DBD-ODBC-%{V_dbd_odbc} configure build install
  209. %endif
  210. %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
  211. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} `cat perl-openpkg-files`
  212. %files -f files
  213. %clean
  214. rm -rf $RPM_BUILD_ROOT