perl-dbi.spec 8.1 KB

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