perl-dbi.spec 13 KB

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