perl-dbi.spec 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320
  1. ##
  2. ## perl-dbi.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. # versions of individual parts
  25. %define V_perl 5.8.7
  26. %define V_dbi 1.48
  27. %define V_sql_statement 1.14
  28. %define V_sql_abstract 1.20
  29. %define V_sql_routine 0.70.3
  30. %define V_dbd_anydata 0.08
  31. %define V_dbd_sprite 0.56
  32. %define V_dbd_sqlite 1.09
  33. %define V_dbd_mysql 3.0002
  34. %define V_dbd_pgsql 1.43
  35. %define V_dbd_oracle 1.16
  36. %define V_dbd_sybase 1.07
  37. %define V_dbd_odbc 1.13
  38. %define V_dbd_mock 0.28
  39. # package information
  40. Name: perl-dbi
  41. Summary: Perl Modules for use with DBI API
  42. URL: http://www.cpan.org/
  43. Vendor: Perl Community
  44. Packager: OpenPKG
  45. Distribution: OpenPKG
  46. Class: BASE
  47. Group: Language
  48. License: GPL/Artistic
  49. Version: %{V_perl}
  50. Release: 20051031
  51. # package options
  52. %option with_dbd_sqlite no
  53. %option with_dbd_mysql no
  54. %option with_dbd_pgsql no
  55. %option with_dbd_oracle no
  56. %option with_dbd_sybase no
  57. %option with_dbd_odbc no
  58. # list of sources
  59. Source0: http://www.cpan.org/modules/by-module/DBI/DBI-%{V_dbi}.tar.gz
  60. Source1: http://www.cpan.org/modules/by-module/SQL/SQL-Statement-%{V_sql_statement}.tar.gz
  61. Source2: http://www.cpan.org/modules/by-module/SQL/SQL-Abstract-%{V_sql_abstract}.tar.gz
  62. Source3: http://www.cpan.org/modules/by-module/SQL/DUNCAND/SQL-Routine-v%{V_sql_routine}.tar.gz
  63. Source4: http://www.cpan.org/modules/by-module/DBD/DBD-Mock-%{V_dbd_mock}.tar.gz
  64. Source5: http://www.cpan.org/modules/by-module/DBD/DBD-AnyData-%{V_dbd_anydata}.tar.gz
  65. Source6: http://www.cpan.org/modules/by-module/DBD/DBD-Sprite-%{V_dbd_sprite}.tar.gz
  66. Source7: http://www.cpan.org/modules/by-module/DBD/DBD-SQLite-%{V_dbd_sqlite}.tar.gz
  67. Source8: http://www.cpan.org/modules/by-module/DBD/DBD-mysql-%{V_dbd_mysql}.tar.gz
  68. Source9: http://www.cpan.org/modules/by-module/DBD/DBD-Pg-%{V_dbd_pgsql}.tar.gz
  69. Source10: http://www.cpan.org/modules/by-module/DBD/DBD-Oracle-%{V_dbd_oracle}.tar.gz
  70. Source11: http://www.cpan.org/modules/by-module/DBD/DBD-ODBC-%{V_dbd_odbc}.tar.gz
  71. Source12: http://www.peppler.org/downloads/DBD-Sybase-%{V_dbd_sybase}.tar.gz
  72. Patch0: perl-dbi.patch
  73. # build information
  74. Prefix: %{l_prefix}
  75. BuildRoot: %{l_buildroot}
  76. BuildPreReq: OpenPKG, openpkg >= 20040130, perl >= %{V_perl}, perl-openpkg >= %{V_perl}-20040126
  77. PreReq: OpenPKG, openpkg >= 20040130, perl >= %{V_perl}
  78. BuildPreReq: perl-util, perl-net, perl-locale
  79. PreReq: perl-util, perl-net, perl-locale
  80. %if "%{with_dbd_sqlite}" == "yes"
  81. BuildPreReq: sqlite
  82. PreReq: sqlite
  83. %endif
  84. %if "%{with_dbd_mysql}" == "yes"
  85. BuildPreReq: mysql
  86. PreReq: mysql
  87. %endif
  88. %if "%{with_dbd_pgsql}" == "yes"
  89. BuildPreReq: postgresql
  90. PreReq: postgresql
  91. %endif
  92. %if "%{with_dbd_oracle}" == "yes"
  93. BuildPreReq: oracle
  94. PreReq: oracle
  95. %endif
  96. %if "%{with_dbd_sybase}" == "yes"
  97. BuildPreReq: freetds, libiconv
  98. PreReq: freetds, libiconv
  99. %endif
  100. %if "%{with_dbd_odbc}" == "yes"
  101. BuildPreReq: unixodbc
  102. PreReq: unixodbc
  103. %endif
  104. AutoReq: no
  105. AutoReqProv: no
  106. %description
  107. Various modules for using the DBI API of Perl:
  108. - DBI (%{V_dbi})
  109. - SQL::Statement (%{V_sql_statement})
  110. - SQL::Abstract (%{V_sql_abstract})
  111. - SQL::Routine (%{V_sql_routine})
  112. - DBD::Mock (%{V_dbd_mock})
  113. - DBD::AnyData (%{V_dbd_anydata})
  114. - DBD::Sprite (%{V_dbd_sprite})
  115. - DBD::SQLite (%{V_dbd_sqlite}) [%{with_dbd_sqlite}]
  116. - DBD::mysql (%{V_dbd_mysql}) [%{with_dbd_mysql}]
  117. - DBD::Pg (%{V_dbd_pgsql}) [%{with_dbd_pgsql}]
  118. - DBD::Oracle (%{V_dbd_oracle}) [%{with_dbd_oracle}]
  119. - DBD::Sybase (%{V_dbd_sybase}) [%{with_dbd_sybase}]
  120. - DBD::ODBC (%{V_dbd_odbc}) [%{with_dbd_odbc}]
  121. %track
  122. prog perl-dbi:DBD-Mock = {
  123. version = %{V_dbd_mock}
  124. url = http://www.cpan.org/modules/by-module/DBD/
  125. regex = DBD-Mock-(__VER__)\.tar\.gz
  126. }
  127. prog perl-dbi:DBD-AnyData = {
  128. version = %{V_dbd_anydata}
  129. url = http://www.cpan.org/modules/by-module/DBD/
  130. regex = DBD-AnyData-(__VER__)\.tar\.gz
  131. }
  132. prog perl-dbi:DBD-mysql = {
  133. version = %{V_dbd_mysql}
  134. url = http://www.cpan.org/modules/by-module/DBD/
  135. regex = DBD-mysql-(__VER__)\.tar\.gz
  136. }
  137. prog perl-dbi:DBD-ODBC = {
  138. version = %{V_dbd_odbc}
  139. url = http://www.cpan.org/modules/by-module/DBD/
  140. regex = DBD-ODBC-(__VER__)\.tar\.gz
  141. }
  142. prog perl-dbi:DBD-Oracle = {
  143. version = %{V_dbd_oracle}
  144. url = http://www.cpan.org/modules/by-module/DBD/
  145. regex = DBD-Oracle-(__VER__)\.tar\.gz
  146. }
  147. prog perl-dbi:DBD-Pg = {
  148. version = %{V_dbd_pgsql}
  149. url = http://www.cpan.org/modules/by-module/DBD/
  150. regex = DBD-Pg-(__VER__)\.tar\.gz
  151. }
  152. prog perl-dbi:DBD-Sprite = {
  153. version = %{V_dbd_sprite}
  154. url = http://www.cpan.org/modules/by-module/DBD/
  155. regex = DBD-Sprite-(__VER__)\.tar\.gz
  156. }
  157. prog perl-dbi:DBD-SQLite = {
  158. version = %{V_dbd_sqlite}
  159. url = http://www.cpan.org/modules/by-module/DBD/
  160. regex = DBD-SQLite-(__VER__)\.tar\.gz
  161. }
  162. prog perl-dbi:DBD-Sybase = {
  163. version = %{V_dbd_sybase}
  164. url = http://www.peppler.org/downloads/
  165. regex = DBD-Sybase-(__VER__)\.tar\.gz
  166. }
  167. prog perl-dbi:DBI = {
  168. version = %{V_dbi}
  169. url = http://www.cpan.org/modules/by-module/DBI/
  170. regex = DBI-(\d+\.\d\d)\.tar\.gz
  171. }
  172. prog perl-dbi:SQL-Statement = {
  173. version = %{V_sql_statement}
  174. url = http://www.cpan.org/modules/by-module/SQL/
  175. regex = SQL-Statement-(__VER__)\.tar\.gz
  176. }
  177. prog perl-dbi:SQL-Abstract = {
  178. version = %{V_sql_abstract}
  179. url = http://www.cpan.org/modules/by-module/SQL/
  180. regex = SQL-Abstract-(__VER__)\.tar\.gz
  181. }
  182. prog perl-dbi:SQL-Routine = {
  183. version = %{V_sql_routine}
  184. url = http://www.cpan.org/modules/by-module/SQL/DUNCAND/
  185. regex = SQL-Routine-v(__VER__)\.tar\.gz
  186. }
  187. %prep
  188. %setup -q -c
  189. %setup -q -T -D -a 1
  190. %setup -q -T -D -a 2
  191. %setup -q -T -D -a 3
  192. %setup -q -T -D -a 4
  193. %setup -q -T -D -a 5
  194. %setup -q -T -D -a 6
  195. %setup -q -T -D -a 7
  196. %setup -q -T -D -a 8
  197. %setup -q -T -D -a 9
  198. %setup -q -T -D -a 10
  199. %setup -q -T -D -a 11
  200. %setup -q -T -D -a 12
  201. %patch -p0 -d DBD-SQLite-%{V_dbd_sqlite}
  202. %build
  203. %install
  204. rm -rf $RPM_BUILD_ROOT
  205. %{l_prefix}/bin/perl-openpkg prepare
  206. # build and install individual modules
  207. %{l_prefix}/bin/perl-openpkg -d %{SOURCE0} configure build install
  208. %{l_prefix}/bin/perl-openpkg -d %{SOURCE1} configure build install
  209. %{l_prefix}/bin/perl-openpkg -d %{SOURCE2} configure build install
  210. %{l_prefix}/bin/perl-openpkg -d %{SOURCE3} configure build install
  211. %{l_prefix}/bin/perl-openpkg -d %{SOURCE4} configure build install
  212. %{l_prefix}/bin/perl-openpkg -d %{SOURCE5} configure build install
  213. %{l_prefix}/bin/perl-openpkg -d %{SOURCE6} configure build install
  214. %if "%{with_dbd_sqlite}" == "yes"
  215. # build DBD::SQLite
  216. ( cd DBD-SQLite-%{V_dbd_sqlite}
  217. # remove local SQLite sources (we use external one)
  218. # in order to not confuse ExtUtils::MakeMaker
  219. mv ppport.h dbdimp.[ch] SQLiteXS.h ..
  220. for file in `echo *.[ch] getsqlite.pl`; do
  221. sed -e "s;^ *$file *$;;" <MANIFEST >MANIFEST.NEW && mv MANIFEST.NEW MANIFEST
  222. rm -f $file
  223. done
  224. mv ../ppport.h ../dbdimp.[ch] ../SQLiteXS.h .
  225. # substitute paths in patched Makefile.PL
  226. %{l_shtool} subst %{l_value -s -a} Makefile.PL
  227. # perform regular build and install
  228. %{l_prefix}/bin/perl-openpkg configure build install
  229. ) || exit $?
  230. %endif
  231. %if "%{with_dbd_mysql}" == "yes"
  232. # build DBD::mysql
  233. ( cd DBD-mysql-%{V_dbd_mysql}
  234. # (determines MySQL header/lib paths via mysql_config in $PATH)
  235. %{l_prefix}/bin/perl-openpkg configure build install
  236. ) || exit $?
  237. %endif
  238. %if "%{with_dbd_pgsql}" == "yes"
  239. # build DBD::Pg
  240. ( cd DBD-Pg-%{V_dbd_pgsql}
  241. %{l_shtool} subst \
  242. -e 's;/include;/include/postgresql;' \
  243. -e 's;-lpq;-lpq -lssl -lcrypto -lcrypt;' \
  244. Makefile.PL
  245. POSTGRES_HOME=%{l_prefix}
  246. export POSTGRES_HOME
  247. %{l_prefix}/bin/perl-openpkg configure build install
  248. ) || exit $?
  249. %endif
  250. %if "%{with_dbd_oracle}" == "yes"
  251. # build DBD::oracle
  252. ( cd DBD-Oracle-%{V_dbd_oracle}
  253. ORACLE_HOME="`%{l_rc} --query oracle_home`"
  254. export ORACLE_HOME
  255. case "%{l_platform -t}" in
  256. i?86-linux* )
  257. ;;
  258. sun*-sunos* | ix86-sunos* )
  259. # OpenPKG builds with gcc in 32-bit mode by default
  260. %{l_shtool} subst \
  261. -e 's;demo_rdbms\.mk;demo_rdbms32.mk;g' \
  262. Makefile.PL
  263. ;;
  264. * )
  265. echo "Platform \"%{l_platform -t}\" not supported" 1>&2
  266. exit 1
  267. ;;
  268. esac
  269. %{l_prefix}/bin/perl-openpkg configure build install
  270. ) || exit $?
  271. %endif
  272. %if "%{with_dbd_sybase}" == "yes"
  273. # build DBD::Sybase
  274. ( cd DBD-Sybase-%{V_dbd_sybase}
  275. SYBASE="%{l_prefix}"
  276. export SYBASE
  277. %{l_shtool} subst \
  278. -e 's;\([^s(]/lib\);\1/freetds;g' \
  279. -e 's;-lct;%{l_ldflags} -lct -liconv;g' \
  280. Makefile.PL
  281. %{l_prefix}/bin/perl-openpkg configure build install
  282. ) || exit $?
  283. %endif
  284. %if "%{with_dbd_odbc}" == "yes"
  285. # build DBD::odbc
  286. ( cd DBD-ODBC-%{V_dbd_odbc}
  287. ODBCHOME="%{l_prefix}"
  288. DBROOT=
  289. export ODBCHOME DBROOT
  290. %{l_prefix}/bin/perl-openpkg configure build install
  291. ) || exit $?
  292. %endif
  293. # determine installation files
  294. %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
  295. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} `cat perl-openpkg-files`
  296. %files -f files
  297. %clean
  298. rm -rf $RPM_BUILD_ROOT