perl-dbi.spec 8.1 KB

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