perl-dbi.spec 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434
  1. ##
  2. ## perl-dbi.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2009 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ##
  5. ## Permission to use, copy, modify, and distribute this software for
  6. ## any purpose with or without fee is hereby granted, provided that
  7. ## the above copyright notice and this permission notice appear in all
  8. ## copies.
  9. ##
  10. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  11. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  12. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  13. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  14. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  15. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  16. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  17. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  18. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  19. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  20. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  21. ## SUCH DAMAGE.
  22. ##
  23. # versions of individual parts
  24. %define V_perl 5.10.0
  25. %define V_dbi 1.607
  26. %define V_sql_statement 1.20
  27. %define V_sql_abstract 1.51
  28. %define V_sql_routine 0.70.3
  29. %define V_sql_builder 0.033
  30. %define V_sql_interpolate 0.33
  31. %define V_sql_translator 0.09004
  32. %define V_dbd_mock 1.39
  33. %define V_dbd_anydata 0.09
  34. %define V_dbd_csv 0.22
  35. %define V_dbd_sprite 0.59
  36. %define V_dbd_sqlite 1.23
  37. %define V_dbd_mysql 4.011
  38. %define V_dbd_pgsql 2.13.0
  39. %define V_dbd_oracle 1.22
  40. %define V_dbd_sybase 1.09
  41. %define V_dbd_odbc 1.20
  42. %define V_dbd_pglite 0.11
  43. %define V_dbd_cego 1.1.4
  44. # package information
  45. Name: perl-dbi
  46. Summary: Perl Modules for use with DBI API
  47. URL: http://www.cpan.org/
  48. Vendor: Perl Community
  49. Packager: OpenPKG Foundation e.V.
  50. Distribution: OpenPKG Community
  51. Class: BASE
  52. Group: Perl
  53. License: GPL/Artistic
  54. Version: %{V_perl}
  55. Release: 20090421
  56. # package options
  57. %option with_sqlite yes
  58. %option with_mysql no
  59. %option with_pgsql no
  60. %option with_oracle no
  61. %option with_sybase no
  62. %option with_odbc no
  63. %option with_cego no
  64. # package backward compatibility
  65. %option with_dbd_sqlite no
  66. %option with_dbd_mysql no
  67. %option with_dbd_pgsql no
  68. %option with_dbd_oracle no
  69. %option with_dbd_sybase no
  70. %option with_dbd_odbc no
  71. %option with_dbd_cego no
  72. %if "%{with_dbd_sqlite}" == "yes"
  73. %undefine with_sqlite
  74. %define with_sqlite yes
  75. %endif
  76. %if "%{with_dbd_mysql}" == "yes"
  77. %undefine with_mysql
  78. %define with_mysql yes
  79. %endif
  80. %if "%{with_dbd_pgsql}" == "yes"
  81. %undefine with_pgsql
  82. %define with_pgsql yes
  83. %endif
  84. %if "%{with_dbd_oracle}" == "yes"
  85. %undefine with_oracle
  86. %define with_oracle yes
  87. %endif
  88. %if "%{with_dbd_sybase}" == "yes"
  89. %undefine with_sybase
  90. %define with_sybase yes
  91. %endif
  92. %if "%{with_dbd_odbc}" == "yes"
  93. %undefine with_odbc
  94. %define with_odbc yes
  95. %endif
  96. %if "%{with_dbd_cego}" == "yes"
  97. %undefine with_cego
  98. %define with_cego yes
  99. %endif
  100. # list of sources
  101. Source0: http://www.cpan.org/modules/by-module/DBI/DBI-%{V_dbi}.tar.gz
  102. Source1: http://www.cpan.org/modules/by-module/SQL/SQL-Statement-%{V_sql_statement}.tar.gz
  103. Source2: http://www.cpan.org/modules/by-module/SQL/SQL-Abstract-%{V_sql_abstract}.tar.gz
  104. Source3: http://www.darrenduncan.net/d/perl/archives/SQL-Routine-v%{V_sql_routine}.tar.gz
  105. Source4: ftp://ftp.openpkg.org/sources/CPY/ORPHANED/perl/SQL-Builder-%{V_sql_builder}.tar.gz
  106. Source5: http://www.cpan.org/modules/by-module/SQL/SQL-Interpolate-%{V_sql_interpolate}.tar.gz
  107. Source6: http://www.cpan.org/authors/id/J/JR/JROBINSON/SQL-Translator-%{V_sql_translator}.tar.gz
  108. Source7: http://www.cpan.org/modules/by-module/DBD/DBD-Mock-%{V_dbd_mock}.tar.gz
  109. Source8: http://www.cpan.org/modules/by-module/DBD/DBD-AnyData-%{V_dbd_anydata}.tar.gz
  110. Source9: http://www.cpan.org/modules/by-module/DBD/DBD-CSV-%{V_dbd_csv}.tar.gz
  111. Source10: http://www.cpan.org/modules/by-module/DBD/DBD-Sprite-%{V_dbd_sprite}.tar.gz
  112. Source11: http://www.cpan.org/authors/id/A/AD/ADAMK/DBD-SQLite-%{V_dbd_sqlite}.tar.gz
  113. Source12: http://www.cpan.org/modules/by-module/DBD/DBD-mysql-%{V_dbd_mysql}.tar.gz
  114. Source13: http://www.cpan.org/modules/by-module/DBD/DBD-Pg-%{V_dbd_pgsql}.tar.gz
  115. Source14: http://www.cpan.org/modules/by-module/DBD/DBD-Oracle-%{V_dbd_oracle}.tar.gz
  116. Source15: http://www.cpan.org/modules/by-module/DBD/DBD-ODBC-%{V_dbd_odbc}.tar.gz
  117. Source16: http://www.peppler.org/downloads/DBD-Sybase-%{V_dbd_sybase}.tar.gz
  118. Source17: http://www.cpan.org/modules/by-module/DBD/DBD-PgLite-%{V_dbd_pglite}.tar.gz
  119. Source18: http://www.lemke-it.com/DBD-cego-%{V_dbd_cego}.tar.gz
  120. Patch0: perl-dbi.patch
  121. # build information
  122. Prefix: %{l_prefix}
  123. BuildRoot: %{l_buildroot}
  124. BuildPreReq: OpenPKG, openpkg >= 20040130, perl >= %{V_perl}, perl-openpkg >= %{V_perl}-20040126, pkgconfig
  125. PreReq: OpenPKG, openpkg >= 20040130, perl >= %{V_perl}
  126. BuildPreReq: perl-module, perl-util, perl-net, perl-locale, perl-text, perl-parse
  127. PreReq: perl-module, perl-util, perl-net, perl-locale, perl-text, perl-parse
  128. %if "%{with_sqlite}" == "yes"
  129. BuildPreReq: sqlite, perl-locale >= %{V_perl}-20060921
  130. PreReq: sqlite, perl-locale >= %{V_perl}-20060921
  131. %endif
  132. %if "%{with_mysql}" == "yes"
  133. BuildPreReq: mysql
  134. PreReq: mysql
  135. %endif
  136. %if "%{with_pgsql}" == "yes"
  137. BuildPreReq: postgresql
  138. PreReq: postgresql
  139. %endif
  140. %if "%{with_oracle}" == "yes"
  141. BuildPreReq: oracle
  142. PreReq: oracle
  143. %endif
  144. %if "%{with_sybase}" == "yes"
  145. BuildPreReq: freetds, libiconv
  146. PreReq: freetds, libiconv
  147. %endif
  148. %if "%{with_odbc}" == "yes"
  149. BuildPreReq: ODBC
  150. PreReq: ODBC
  151. %endif
  152. %if "%{with_cego}" == "yes"
  153. BuildPreReq: cego
  154. PreReq: cego
  155. %endif
  156. AutoReq: no
  157. AutoReqProv: no
  158. %description
  159. Various modules for using the DBI API of Perl:
  160. - DBI (%{V_dbi})
  161. - SQL::Statement (%{V_sql_statement})
  162. - SQL::Abstract (%{V_sql_abstract})
  163. - SQL::Routine (%{V_sql_routine})
  164. - SQL::Builder (%{V_sql_builder})
  165. - SQL::Interpolate (%{V_sql_interpolate})
  166. - SQL::Translator (%{V_sql_translator})
  167. - DBD::Mock (%{V_dbd_mock})
  168. - DBD::AnyData (%{V_dbd_anydata})
  169. - DBD::CSV (%{V_dbd_csv})
  170. - DBD::Sprite (%{V_dbd_sprite})
  171. - DBD::SQLite (%{V_dbd_sqlite}) [%{with_sqlite}]
  172. - DBD::PgLite (%{V_dbd_pglite}) [%{with_sqlite}]
  173. - DBD::mysql (%{V_dbd_mysql}) [%{with_mysql}]
  174. - DBD::Pg (%{V_dbd_pgsql}) [%{with_pgsql}]
  175. - DBD::Oracle (%{V_dbd_oracle}) [%{with_oracle}]
  176. - DBD::Sybase (%{V_dbd_sybase}) [%{with_sybase}]
  177. - DBD::ODBC (%{V_dbd_odbc}) [%{with_odbc}]
  178. - DBD::Cego (%{V_dbd_cego}) [%{with_cego}]
  179. %track
  180. prog perl-dbi:DBI = {
  181. version = %{V_dbi}
  182. url = http://www.cpan.org/modules/by-module/DBI/
  183. regex = DBI-(\d+\.\d+)\.tar\.gz
  184. }
  185. prog perl-dbi:SQL-Statement = {
  186. version = %{V_sql_statement}
  187. url = http://www.cpan.org/modules/by-module/SQL/
  188. regex = SQL-Statement-(__VER__)\.tar\.gz
  189. }
  190. prog perl-dbi:SQL-Abstract = {
  191. version = %{V_sql_abstract}
  192. url = http://www.cpan.org/modules/by-module/SQL/
  193. regex = SQL-Abstract-(__VER__)\.tar\.gz
  194. }
  195. prog perl-dbi:SQL-Routine = {
  196. version = %{V_sql_routine}
  197. url = http://www.darrenduncan.net/d/perl/archives/
  198. regex = SQL-Routine-v(__VER__)\.tar\.gz
  199. }
  200. prog perl-dbi:SQL-Builder = {
  201. disabled
  202. comment = "rse: disappeared from CPAN"
  203. version = %{V_sql_builder}
  204. url = ftp://ftp.openpkg.org/sources/CPY/ORPHANED/perl/
  205. regex = SQL-Builder-(__VER__)\.tar\.gz
  206. }
  207. prog perl-dbi:SQL-Interpolate = {
  208. version = %{V_sql_interpolate}
  209. url = http://www.cpan.org/modules/by-module/SQL/
  210. regex = SQL-Interpolate-(__VER__)\.tar\.gz
  211. }
  212. prog perl-dbi:SQL-Translator = {
  213. version = %{V_sql_translator}
  214. url = http://www.cpan.org/authors/id/J/JR/JROBINSON/
  215. regex = SQL-Translator-(__VER__)\.tar\.gz
  216. }
  217. prog perl-dbi:DBD-Mock = {
  218. version = %{V_dbd_mock}
  219. url = http://www.cpan.org/modules/by-module/DBD/
  220. regex = DBD-Mock-(__VER__)\.tar\.gz
  221. }
  222. prog perl-dbi:DBD-AnyData = {
  223. version = %{V_dbd_anydata}
  224. url = http://www.cpan.org/modules/by-module/DBD/
  225. regex = DBD-AnyData-(__VER__)\.tar\.gz
  226. }
  227. prog perl-dbi:DBD-CSV = {
  228. version = %{V_dbd_csv}
  229. url = http://www.cpan.org/modules/by-module/DBD/
  230. regex = DBD-CSV-(\d+\.\d\d)\.tar\.gz
  231. }
  232. prog perl-dbi:DBD-mysql = {
  233. version = %{V_dbd_mysql}
  234. url = http://www.cpan.org/modules/by-module/DBD/
  235. regex = DBD-mysql-(__VER__)\.tar\.gz
  236. }
  237. prog perl-dbi:DBD-ODBC = {
  238. version = %{V_dbd_odbc}
  239. url = http://www.cpan.org/modules/by-module/DBD/
  240. regex = DBD-ODBC-(__VER__)\.tar\.gz
  241. }
  242. prog perl-dbi:DBD-Oracle = {
  243. version = %{V_dbd_oracle}
  244. url = http://www.cpan.org/modules/by-module/DBD/
  245. regex = DBD-Oracle-(__VER__)\.tar\.gz
  246. }
  247. prog perl-dbi:DBD-Pg = {
  248. version = %{V_dbd_pgsql}
  249. url = http://www.cpan.org/modules/by-module/DBD/
  250. regex = DBD-Pg-(__VER__)\.tar\.gz
  251. }
  252. prog perl-dbi:DBD-Sprite = {
  253. version = %{V_dbd_sprite}
  254. url = http://www.cpan.org/modules/by-module/DBD/
  255. regex = DBD-Sprite-(__VER__)\.tar\.gz
  256. }
  257. prog perl-dbi:DBD-SQLite = {
  258. version = %{V_dbd_sqlite}
  259. url = http://www.cpan.org/authors/id/A/AD/ADAMK/
  260. regex = DBD-SQLite-(__VER__)\.tar\.gz
  261. }
  262. prog perl-dbi:DBD-PgLite = {
  263. version = %{V_dbd_pglite}
  264. url = http://www.cpan.org/modules/by-module/DBD/
  265. regex = DBD-PgLite-(__VER__)\.tar\.gz
  266. }
  267. prog perl-dbi:DBD-Sybase = {
  268. version = %{V_dbd_sybase}
  269. url = http://www.peppler.org/downloads/
  270. regex = DBD-Sybase-(__VER__)\.tar\.gz
  271. }
  272. prog perl-dbi:DBD-cego = {
  273. version = %{V_dbd_cego}
  274. url = http://www.lemke-it.com/opensource.html
  275. regex = DBD-cego-(__VER__)\.tar\.gz
  276. }
  277. %prep
  278. %setup -q -c
  279. %setup -q -T -D -a 1
  280. %setup -q -T -D -a 2
  281. %setup -q -T -D -a 3
  282. %setup -q -T -D -a 4
  283. %setup -q -T -D -a 5
  284. %setup -q -T -D -a 6
  285. %setup -q -T -D -a 7
  286. %setup -q -T -D -a 8
  287. %setup -q -T -D -a 9
  288. %setup -q -T -D -a 10
  289. %setup -q -T -D -a 11
  290. %setup -q -T -D -a 12
  291. %setup -q -T -D -a 13
  292. %setup -q -T -D -a 14
  293. %setup -q -T -D -a 15
  294. %setup -q -T -D -a 16
  295. %setup -q -T -D -a 17
  296. %setup -q -T -D -a 18
  297. %patch -p0
  298. chmod u+w SQL-Translator-*/*
  299. %build
  300. %install
  301. rm -rf $RPM_BUILD_ROOT
  302. %{l_prefix}/bin/perl-openpkg prepare
  303. # build and install individual modules
  304. %{l_prefix}/bin/perl-openpkg -d %{SOURCE0} configure build install
  305. %{l_prefix}/bin/perl-openpkg -d %{SOURCE1} configure build install
  306. %{l_prefix}/bin/perl-openpkg -d %{SOURCE2} configure build install
  307. %{l_prefix}/bin/perl-openpkg -d %{SOURCE3} configure build install
  308. %{l_prefix}/bin/perl-openpkg -d %{SOURCE4} configure build install
  309. %{l_prefix}/bin/perl-openpkg -d %{SOURCE5} configure build install
  310. %{l_prefix}/bin/perl-openpkg -d %{SOURCE6} configure build install
  311. %{l_prefix}/bin/perl-openpkg -d %{SOURCE7} configure build install
  312. %{l_prefix}/bin/perl-openpkg -d %{SOURCE8} configure build install
  313. %{l_prefix}/bin/perl-openpkg -d %{SOURCE9} configure build install
  314. %{l_prefix}/bin/perl-openpkg -d %{SOURCE10} configure build install
  315. %if "%{with_sqlite}" == "yes"
  316. # build DBD::SQLite
  317. ( cd DBD-SQLite-%{V_dbd_sqlite}
  318. # remove local SQLite sources (we use external one)
  319. # in order to not confuse ExtUtils::MakeMaker
  320. mv ppport.h dbdimp.[ch] SQLiteXS.h ..
  321. for file in `echo *.[ch] getsqlite.pl`; do
  322. sed -e "s;^ *$file *$;;" <MANIFEST >MANIFEST.NEW && mv MANIFEST.NEW MANIFEST
  323. rm -f $file
  324. done
  325. mv ../ppport.h ../dbdimp.[ch] ../SQLiteXS.h .
  326. # substitute paths in patched Makefile.PL
  327. %{l_shtool} subst %{l_value -s -a} Makefile.PL
  328. # perform regular build and install
  329. %{l_prefix}/bin/perl-openpkg configure build install
  330. ) || exit $?
  331. # build DBD::PgLite
  332. %{l_prefix}/bin/perl-openpkg -d DBD-PgLite-%{V_dbd_pglite} configure build install
  333. %endif
  334. %if "%{with_mysql}" == "yes"
  335. # build DBD::mysql
  336. ( cd DBD-mysql-%{V_dbd_mysql}
  337. # (determines MySQL header/lib paths via mysql_config in $PATH)
  338. %{l_prefix}/bin/perl-openpkg configure build install
  339. ) || exit $?
  340. %endif
  341. %if "%{with_pgsql}" == "yes"
  342. # build DBD::Pg
  343. ( cd DBD-Pg-%{V_dbd_pgsql}
  344. %{l_shtool} subst \
  345. -e 's;POSTGRES_LIB -lpq;POSTGRES_LIB -lpq -lssl -lcrypto -lcrypt;' \
  346. Makefile.PL
  347. POSTGRES_HOME=%{l_prefix}
  348. POSTGRES_INCLUDE=%{l_prefix}/include/postgresql
  349. POSTGRES_LIB=%{l_prefix}/lib
  350. export POSTGRES_HOME POSTGRES_INCLUDE POSTGRES_LIB
  351. %{l_prefix}/bin/perl-openpkg configure build install
  352. ) || exit $?
  353. %endif
  354. %if "%{with_oracle}" == "yes"
  355. # build DBD::oracle
  356. ( cd DBD-Oracle-%{V_dbd_oracle}
  357. ORACLE_HOME="`%{l_rc} --query oracle_home`"
  358. export ORACLE_HOME
  359. case "%{l_platform -t}" in
  360. i?86-linux* )
  361. ;;
  362. sun*-sunos* | ix86-sunos* )
  363. # OpenPKG builds with gcc in 32-bit mode by default
  364. %{l_shtool} subst \
  365. -e 's;demo_rdbms\.mk;demo_rdbms32.mk;g' \
  366. Makefile.PL
  367. ;;
  368. * )
  369. echo "Platform \"%{l_platform -t}\" not supported" 1>&2
  370. exit 1
  371. ;;
  372. esac
  373. %{l_prefix}/bin/perl-openpkg configure build install
  374. ) || exit $?
  375. %endif
  376. %if "%{with_sybase}" == "yes"
  377. # build DBD::Sybase
  378. ( cd DBD-Sybase-%{V_dbd_sybase}
  379. SYBASE="%{l_prefix}"
  380. export SYBASE
  381. %{l_shtool} subst \
  382. -e 's;\([^s(]/lib\);\1/freetds;g' \
  383. -e 's;-lct;%{l_ldflags} -lct -liconv;g' \
  384. Makefile.PL
  385. %{l_prefix}/bin/perl-openpkg configure build install
  386. ) || exit $?
  387. %endif
  388. %if "%{with_odbc}" == "yes"
  389. # build DBD::odbc
  390. ( cd DBD-ODBC-%{V_dbd_odbc}
  391. ODBCHOME="%{l_prefix}"
  392. DBROOT=
  393. export ODBCHOME DBROOT
  394. %{l_prefix}/bin/perl-openpkg configure build install
  395. ) || exit $?
  396. %endif
  397. %if "%{with_cego}" == "yes"
  398. # build DBD::Cego
  399. ( cd DBD-cego
  400. rm -f ._* >/dev/null 2>&1 || true
  401. %{l_prefix}/bin/perl-openpkg --args=--prefix=%{l_prefix} configure build install
  402. ) || exit $?
  403. %endif
  404. # determine installation files
  405. %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
  406. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} `cat perl-openpkg-files`
  407. %files -f files
  408. %clean
  409. rm -rf $RPM_BUILD_ROOT