perl-dbi.spec 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428
  1. ##
  2. ## perl-dbi.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2011 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.14
  25. %define V_dbi 1.616
  26. %define V_sql_statement 1.33
  27. %define V_sql_abstract 1.71
  28. %define V_sql_routine 0.70.3
  29. %define V_sql_builder 0.033
  30. %define V_sql_interpolate 0.41
  31. %define V_sql_translator 0.11007
  32. %define V_dbd_mock 1.39
  33. %define V_dbd_anydata 0.110
  34. %define V_dbd_csv 0.22
  35. %define V_dbd_sprite 0.59
  36. %define V_dbd_sqlite 1.34_02
  37. %define V_dbd_mysql 4.020
  38. %define V_dbd_pgsql 2.18.1
  39. %define V_dbd_oracle 1.26
  40. %define V_dbd_sybase 1.14
  41. %define V_dbd_odbc 1.31
  42. %define V_dbd_pglite 0.11
  43. %define V_dbd_cego 1.1.14
  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: 20111022
  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/authors/id/T/TI/TIMB/DBI-%{V_dbi}.tar.gz
  102. Source1: http://www.cpan.org/authors/id/R/RE/REHSACK/SQL-Statement-%{V_sql_statement}.tar.gz
  103. Source2: http://www.cpan.org/authors/id/R/RI/RIBASUSHI/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: http://download.openpkg.org/components/orphaned/SQL-Builder-%{V_sql_builder}.tar.gz
  106. Source5: http://www.cpan.org/authors/id/M/MA/MARKSTOS/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/authors/id/D/DR/DROLSKY/DBD-Mock-%{V_dbd_mock}.tar.gz
  109. Source8: http://www.cpan.org/authors/id/R/RE/REHSACK/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/authors/id/T/TU/TURNERJW/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/authors/id/C/CA/CAPTTOFU/DBD-mysql-%{V_dbd_mysql}.tar.gz
  114. Source13: http://www.cpan.org/authors/id/T/TU/TURNSTEP/DBD-Pg-%{V_dbd_pgsql}.tar.gz
  115. Source14: http://www.cpan.org/authors/id/T/TI/TIMB/DBD-Oracle-%{V_dbd_oracle}.tar.gz
  116. Source15: http://www.cpan.org/authors/id/M/MJ/MJEVANS/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/authors/id/G/GR/GRUBER/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. BuildPreReq: OpenPKG, openpkg >= 20100101, perl >= %{V_perl}, perl-openpkg >= %{V_perl}-20040126, pkgconfig
  123. PreReq: OpenPKG, openpkg >= 20100101, perl >= %{V_perl}
  124. BuildPreReq: perl-module, perl-util, perl-net, perl-locale, perl-text, perl-parse, perl-crypto
  125. PreReq: perl-module, perl-util, perl-net, perl-locale, perl-text, perl-parse, perl-crypto
  126. %if "%{with_sqlite}" == "yes"
  127. BuildPreReq: sqlite, perl-locale >= %{V_perl}-20060921
  128. PreReq: sqlite, perl-locale >= %{V_perl}-20060921
  129. %endif
  130. %if "%{with_mysql}" == "yes"
  131. BuildPreReq: mysql
  132. PreReq: mysql
  133. %endif
  134. %if "%{with_pgsql}" == "yes"
  135. BuildPreReq: postgresql
  136. PreReq: postgresql
  137. %endif
  138. %if "%{with_oracle}" == "yes"
  139. BuildPreReq: oracle
  140. PreReq: oracle
  141. %endif
  142. %if "%{with_sybase}" == "yes"
  143. BuildPreReq: freetds, libiconv
  144. PreReq: freetds, libiconv
  145. %endif
  146. %if "%{with_odbc}" == "yes"
  147. BuildPreReq: ODBC
  148. PreReq: ODBC
  149. %endif
  150. %if "%{with_cego}" == "yes"
  151. BuildPreReq: cego
  152. PreReq: cego
  153. %endif
  154. %description
  155. Various modules for using the DBI API of Perl:
  156. - DBI (%{V_dbi})
  157. - SQL::Statement (%{V_sql_statement})
  158. - SQL::Abstract (%{V_sql_abstract})
  159. - SQL::Routine (%{V_sql_routine})
  160. - SQL::Builder (%{V_sql_builder})
  161. - SQL::Interpolate (%{V_sql_interpolate})
  162. - SQL::Translator (%{V_sql_translator})
  163. - DBD::Mock (%{V_dbd_mock})
  164. - DBD::AnyData (%{V_dbd_anydata})
  165. - DBD::CSV (%{V_dbd_csv})
  166. - DBD::Sprite (%{V_dbd_sprite})
  167. - DBD::SQLite (%{V_dbd_sqlite}) [%{with_sqlite}]
  168. - DBD::PgLite (%{V_dbd_pglite}) [%{with_sqlite}]
  169. - DBD::mysql (%{V_dbd_mysql}) [%{with_mysql}]
  170. - DBD::Pg (%{V_dbd_pgsql}) [%{with_pgsql}]
  171. - DBD::Oracle (%{V_dbd_oracle}) [%{with_oracle}]
  172. - DBD::Sybase (%{V_dbd_sybase}) [%{with_sybase}]
  173. - DBD::ODBC (%{V_dbd_odbc}) [%{with_odbc}]
  174. - DBD::Cego (%{V_dbd_cego}) [%{with_cego}]
  175. %track
  176. prog perl-dbi:DBI = {
  177. version = %{V_dbi}
  178. url = http://www.cpan.org/authors/id/T/TI/TIMB/
  179. regex = DBI-(\d+\.\d+)\.tar\.gz
  180. }
  181. prog perl-dbi:SQL-Statement = {
  182. version = %{V_sql_statement}
  183. url = http://www.cpan.org/authors/id/R/RE/REHSACK/
  184. regex = SQL-Statement-(__VER__)\.tar\.gz
  185. }
  186. prog perl-dbi:SQL-Abstract = {
  187. version = %{V_sql_abstract}
  188. url = http://www.cpan.org/authors/id/R/RI/RIBASUSHI/
  189. regex = SQL-Abstract-(__VER__)\.tar\.gz
  190. }
  191. prog perl-dbi:SQL-Routine = {
  192. version = %{V_sql_routine}
  193. url = http://www.darrenduncan.net/d/perl/archives/
  194. regex = SQL-Routine-v(__VER__)\.tar\.gz
  195. }
  196. prog perl-dbi:SQL-Builder = {
  197. disabled
  198. comment = "rse: disappeared from CPAN"
  199. version = %{V_sql_builder}
  200. url = http://download.openpkg.org/components/orphaned/
  201. regex = SQL-Builder-(__VER__)\.tar\.gz
  202. }
  203. prog perl-dbi:SQL-Interpolate = {
  204. version = %{V_sql_interpolate}
  205. url = http://www.cpan.org/authors/id/M/MA/MARKSTOS/
  206. regex = SQL-Interpolate-(__VER__)\.tar\.gz
  207. }
  208. prog perl-dbi:SQL-Translator = {
  209. version = %{V_sql_translator}
  210. url = http://www.cpan.org/authors/id/J/JR/JROBINSON/
  211. regex = SQL-Translator-(__VER__)\.tar\.gz
  212. }
  213. prog perl-dbi:DBD-Mock = {
  214. version = %{V_dbd_mock}
  215. url = http://www.cpan.org/authors/id/D/DR/DROLSKY/
  216. regex = DBD-Mock-(__VER__)\.tar\.gz
  217. }
  218. prog perl-dbi:DBD-AnyData = {
  219. version = %{V_dbd_anydata}
  220. url = http://www.cpan.org/authors/id/R/RE/REHSACK/
  221. regex = DBD-AnyData-(__VER__)\.tar\.gz
  222. }
  223. prog perl-dbi:DBD-CSV = {
  224. version = %{V_dbd_csv}
  225. url = http://www.cpan.org/modules/by-module/DBD/
  226. regex = DBD-CSV-(\d+\.\d\d)\.tar\.gz
  227. }
  228. prog perl-dbi:DBD-mysql = {
  229. version = %{V_dbd_mysql}
  230. url = http://www.cpan.org/authors/id/C/CA/CAPTTOFU/
  231. regex = DBD-mysql-(__VER__)\.tar\.gz
  232. }
  233. prog perl-dbi:DBD-ODBC = {
  234. version = %{V_dbd_odbc}
  235. url = http://www.cpan.org/authors/id/M/MJ/MJEVANS/
  236. regex = DBD-ODBC-(__VER__)\.tar\.gz
  237. }
  238. prog perl-dbi:DBD-Oracle = {
  239. version = %{V_dbd_oracle}
  240. url = http://www.cpan.org/authors/id/T/TI/TIMB/
  241. regex = DBD-Oracle-(__VER__)\.tar\.gz
  242. }
  243. prog perl-dbi:DBD-Pg = {
  244. version = %{V_dbd_pgsql}
  245. url = http://www.cpan.org/authors/id/T/TU/TURNSTEP/
  246. regex = DBD-Pg-(__VER__)\.tar\.gz
  247. }
  248. prog perl-dbi:DBD-Sprite = {
  249. version = %{V_dbd_sprite}
  250. url = http://www.cpan.org/authors/id/T/TU/TURNERJW/
  251. regex = DBD-Sprite-(__VER__)\.tar\.gz
  252. }
  253. prog perl-dbi:DBD-SQLite = {
  254. version = %{V_dbd_sqlite}
  255. url = http://www.cpan.org/authors/id/A/AD/ADAMK/
  256. regex = DBD-SQLite-(__VER__)\.tar\.gz
  257. }
  258. prog perl-dbi:DBD-PgLite = {
  259. version = %{V_dbd_pglite}
  260. url = http://www.cpan.org/authors/id/G/GR/GRUBER/
  261. regex = DBD-PgLite-(__VER__)\.tar\.gz
  262. }
  263. prog perl-dbi:DBD-Sybase = {
  264. version = %{V_dbd_sybase}
  265. url = http://www.peppler.org/downloads/
  266. regex = DBD-Sybase-(__VER__)\.tar\.gz
  267. }
  268. prog perl-dbi:DBD-cego = {
  269. version = %{V_dbd_cego}
  270. url = http://www.lemke-it.com/opensource.html
  271. regex = DBD-cego-(__VER__)\.tar\.gz
  272. }
  273. %prep
  274. %setup -q -c
  275. %setup -q -T -D -a 1
  276. %setup -q -T -D -a 2
  277. %setup -q -T -D -a 3
  278. %setup -q -T -D -a 4
  279. %setup -q -T -D -a 5
  280. %setup -q -T -D -a 6
  281. %setup -q -T -D -a 7
  282. %setup -q -T -D -a 8
  283. %setup -q -T -D -a 9
  284. %setup -q -T -D -a 10
  285. %setup -q -T -D -a 11
  286. %setup -q -T -D -a 12
  287. %setup -q -T -D -a 13
  288. %setup -q -T -D -a 14
  289. %setup -q -T -D -a 15
  290. %setup -q -T -D -a 16
  291. %setup -q -T -D -a 17
  292. %setup -q -T -D -a 18
  293. %patch -p0
  294. chmod u+w SQL-Translator-*/*
  295. %build
  296. %install
  297. %{l_prefix}/bin/perl-openpkg prepare
  298. # build and install individual modules
  299. %{l_prefix}/bin/perl-openpkg -d %{SOURCE0} configure build install
  300. %{l_prefix}/bin/perl-openpkg -d %{SOURCE1} configure build install
  301. %{l_prefix}/bin/perl-openpkg -d %{SOURCE2} configure build install
  302. %{l_prefix}/bin/perl-openpkg -d %{SOURCE3} configure build install
  303. %{l_prefix}/bin/perl-openpkg -d %{SOURCE4} configure build install
  304. %{l_prefix}/bin/perl-openpkg -d %{SOURCE5} configure build install
  305. %{l_prefix}/bin/perl-openpkg -d %{SOURCE6} configure build install
  306. %{l_prefix}/bin/perl-openpkg -d %{SOURCE7} configure build install
  307. %{l_prefix}/bin/perl-openpkg -d %{SOURCE8} configure build install
  308. %{l_prefix}/bin/perl-openpkg -d %{SOURCE9} configure build install
  309. %{l_prefix}/bin/perl-openpkg -d %{SOURCE10} configure build install
  310. %if "%{with_sqlite}" == "yes"
  311. # build DBD::SQLite
  312. ( cd DBD-SQLite-%{V_dbd_sqlite}
  313. # remove local SQLite sources (we use external one)
  314. # in order to not confuse ExtUtils::MakeMaker
  315. mv ppport.h dbdimp.[ch] SQLiteXS.h ..
  316. for file in `echo *.[ch] getsqlite.pl`; do
  317. sed -e "s;^ *$file *$;;" <MANIFEST >MANIFEST.NEW && mv MANIFEST.NEW MANIFEST
  318. rm -f $file
  319. done
  320. mv ../ppport.h ../dbdimp.[ch] ../SQLiteXS.h .
  321. # substitute paths in patched Makefile.PL
  322. %{l_shtool} subst %{l_value -s -a} Makefile.PL
  323. # perform regular build and install
  324. %{l_prefix}/bin/perl-openpkg configure -A SQLITE_LOCATION=%{l_prefix} build install
  325. ) || exit $?
  326. # build DBD::PgLite
  327. %{l_prefix}/bin/perl-openpkg -d DBD-PgLite-%{V_dbd_pglite} configure build install
  328. %endif
  329. %if "%{with_mysql}" == "yes"
  330. # build DBD::mysql
  331. ( cd DBD-mysql-%{V_dbd_mysql}
  332. # (determines MySQL header/lib paths via mysql_config in $PATH)
  333. %{l_prefix}/bin/perl-openpkg configure build install
  334. ) || exit $?
  335. %endif
  336. %if "%{with_pgsql}" == "yes"
  337. # build DBD::Pg
  338. ( cd DBD-Pg-%{V_dbd_pgsql}
  339. %{l_shtool} subst \
  340. -e 's;POSTGRES_LIB -lpq;POSTGRES_LIB -lpq -lssl -lcrypto -lcrypt;' \
  341. Makefile.PL
  342. POSTGRES_HOME=%{l_prefix}
  343. POSTGRES_INCLUDE=%{l_prefix}/include/postgresql
  344. POSTGRES_LIB=%{l_prefix}/lib
  345. export POSTGRES_HOME POSTGRES_INCLUDE POSTGRES_LIB
  346. %{l_prefix}/bin/perl-openpkg configure build install
  347. ) || exit $?
  348. %endif
  349. %if "%{with_oracle}" == "yes"
  350. # build DBD::oracle
  351. ( cd DBD-Oracle-%{V_dbd_oracle}
  352. ORACLE_HOME="`%{l_rc} --query oracle_home`"
  353. export ORACLE_HOME
  354. case "%{l_platform -t}" in
  355. i?86-linux* )
  356. ;;
  357. sun*-sunos* | ix86-sunos* )
  358. # OpenPKG builds with gcc in 32-bit mode by default
  359. %{l_shtool} subst \
  360. -e 's;demo_rdbms\.mk;demo_rdbms32.mk;g' \
  361. Makefile.PL
  362. ;;
  363. * )
  364. echo "Platform \"%{l_platform -t}\" not supported" 1>&2
  365. exit 1
  366. ;;
  367. esac
  368. %{l_prefix}/bin/perl-openpkg configure build install
  369. ) || exit $?
  370. %endif
  371. %if "%{with_sybase}" == "yes"
  372. # build DBD::Sybase
  373. ( cd DBD-Sybase-%{V_dbd_sybase}
  374. SYBASE="%{l_prefix}"
  375. export SYBASE
  376. %{l_shtool} subst \
  377. -e 's;\([^s(]/lib\);\1/freetds;g' \
  378. -e 's;-lct;%{l_ldflags} -lct -liconv;g' \
  379. Makefile.PL
  380. %{l_prefix}/bin/perl-openpkg configure build install
  381. ) || exit $?
  382. %endif
  383. %if "%{with_odbc}" == "yes"
  384. # build DBD::odbc
  385. ( cd DBD-ODBC-%{V_dbd_odbc}
  386. ODBCHOME="%{l_prefix}"
  387. DBROOT=
  388. export ODBCHOME DBROOT
  389. %{l_prefix}/bin/perl-openpkg configure build install
  390. ) || exit $?
  391. %endif
  392. %if "%{with_cego}" == "yes"
  393. # build DBD::Cego
  394. ( cd DBD-cego
  395. rm -f ._* >/dev/null 2>&1 || true
  396. %{l_prefix}/bin/perl-openpkg --args=--prefix=%{l_prefix} configure build install
  397. ) || exit $?
  398. %endif
  399. # determine installation files
  400. %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
  401. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} `cat perl-openpkg-files`
  402. %files -f files
  403. %clean