perl-dbi.spec 14 KB

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