perl-dbi.spec 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  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_perl 5.8.3
  27. %define V_dbi 1.42
  28. %define V_sql_statement 1.005
  29. %define V_dbd_anydata 0.06
  30. %define V_dbd_sprite 0.50
  31. %define V_dbd_sqlite 0.31
  32. %define V_dbd_mysql 2.9003
  33. %define V_dbd_pgsql 1.32
  34. %define V_dbd_oracle 1.15
  35. %define V_dbd_odbc 1.09
  36. # package information
  37. Name: perl-dbi
  38. Summary: Perl Modules for use with DBI API
  39. URL: http://www.cpan.org/
  40. Vendor: Perl Community
  41. Packager: The OpenPKG Project
  42. Distribution: OpenPKG
  43. Class: BASE
  44. Group: Language
  45. License: GPL/Artistic
  46. Version: %{V_perl}
  47. Release: 20040313
  48. # package options
  49. %option with_dbd_mysql no
  50. %option with_dbd_pgsql no
  51. %option with_dbd_oracle no
  52. %option with_dbd_odbc no
  53. # list of sources
  54. Source0: http://www.cpan.org/modules/by-module/DBI/DBI-%{V_dbi}.tar.gz
  55. Source1: http://www.cpan.org/modules/by-module/SQL/SQL-Statement-%{V_sql_statement}.tar.gz
  56. Source2: http://www.cpan.org/modules/by-module/DBD/DBD-AnyData-%{V_dbd_anydata}.tar.gz
  57. Source3: http://www.cpan.org/modules/by-module/DBD/DBD-Sprite-%{V_dbd_sprite}.tar.gz
  58. Source4: http://www.cpan.org/modules/by-module/DBD/DBD-SQLite-%{V_dbd_sqlite}.tar.gz
  59. Source5: http://www.cpan.org/modules/by-module/DBD/DBD-mysql-%{V_dbd_mysql}.tar.gz
  60. Source6: http://www.cpan.org/modules/by-module/DBD/DBD-Pg-%{V_dbd_pgsql}.tar.gz
  61. Source7: http://www.cpan.org/modules/by-module/DBD/DBD-Oracle-%{V_dbd_oracle}.tar.gz
  62. Source8: http://www.cpan.org/modules/by-module/DBD/DBD-ODBC-%{V_dbd_odbc}.tar.gz
  63. # build information
  64. Prefix: %{l_prefix}
  65. BuildRoot: %{l_buildroot}
  66. BuildPreReq: OpenPKG, openpkg >= 20040130, perl >= %{V_perl}, perl-openpkg >= %{V_perl}-20040126, perl-net
  67. PreReq: OpenPKG, openpkg >= 20040130, perl >= %{V_perl}, perl-openpkg >= %{V_perl}-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. %build
  154. %install
  155. %{l_prefix}/bin/perl-openpkg prepare
  156. # build and install individual modules
  157. %{l_prefix}/bin/perl-openpkg -d %{SOURCE0} configure build install
  158. %{l_prefix}/bin/perl-openpkg -d %{SOURCE1} configure build install
  159. %{l_prefix}/bin/perl-openpkg -d %{SOURCE2} configure build install
  160. %{l_prefix}/bin/perl-openpkg -d %{SOURCE3} configure build install
  161. %{l_prefix}/bin/perl-openpkg -d %{SOURCE4} configure build install
  162. %if "%{with_dbd_mysql}" == "yes"
  163. # build DBD::mysql
  164. ( cd DBD-mysql-%{V_dbd_mysql}
  165. # (determines MySQL header/lib paths via mysql_config in $PATH)
  166. ) || exit $?
  167. %{l_prefix}/bin/perl-openpkg -d DBD-mysql-%{V_dbd_mysql} configure build install
  168. %endif
  169. %if "%{with_dbd_pgsql}" == "yes"
  170. # build DBD::Pg
  171. ( cd DBD-Pg-%{V_dbd_pgsql}
  172. %{l_shtool} subst \
  173. -e 's;/include;/include/postgresql;' \
  174. -e 's;-lpq;-lpq -lssl -lcrypto -lcrypt;' \
  175. Makefile.PL
  176. POSTGRES_HOME=%{l_prefix}
  177. export POSTGRES_HOME
  178. ) || exit $?
  179. %{l_prefix}/bin/perl-openpkg -d DBD-Pg-%{V_dbd_pgsql} configure build install
  180. %endif
  181. %if "%{with_dbd_oracle}" == "yes"
  182. # build DBD::oracle
  183. ( cd DBD-Oracle-%{V_dbd_oracle}
  184. ORACLE_HOME="`%{l_prefix}/etc/rc --query oracle_home`"
  185. export ORACLE_HOME
  186. case "%{l_platform -t}" in
  187. i?86-linux* )
  188. ;;
  189. sun*-sunos* )
  190. # OpenPKG builds with gcc in 32-bit mode by default
  191. %{l_shtool} subst \
  192. -e 's;demo_rdbms\.mk;demo_rdbms32.mk;g' \
  193. Makefile.PL
  194. ;;
  195. * )
  196. echo "Platform \"%{l_platform -t}\" not supported" 1>&2
  197. exit 1
  198. ;;
  199. esac
  200. ) || exit $?
  201. %{l_prefix}/bin/perl-openpkg -d DBD-Oracle-%{V_dbd_oracle} configure build install
  202. %endif
  203. %if "%{with_dbd_odbc}" == "yes"
  204. # build DBD::odbc
  205. ( cd DBD-ODBC-%{V_dbd_odbc}
  206. ODBCHOME="%{l_prefix}"
  207. DBROOT=
  208. export ODBCHOME DBROOT
  209. ) || exit $?
  210. %{l_prefix}/bin/perl-openpkg -d DBD-ODBC-%{V_dbd_odbc} configure build install
  211. %endif
  212. %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
  213. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} `cat perl-openpkg-files`
  214. %files -f files
  215. %clean
  216. rm -rf $RPM_BUILD_ROOT