perl-dbi.spec 14 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395
  1. ##
  2. ## perl-dbi.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2008 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.602
  26. %define V_sql_statement 1.15
  27. %define V_sql_abstract 1.21
  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.09000
  32. %define V_dbd_mock 1.36
  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.14
  37. %define V_dbd_mysql 4.007
  38. %define V_dbd_pgsql 2.7.1
  39. %define V_dbd_oracle 1.21
  40. %define V_dbd_sybase 1.08
  41. %define V_dbd_odbc 1.15
  42. %define V_dbd_pglite 0.09
  43. %define V_dbd_cego 1.1.2
  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: 20080512
  56. # package options
  57. %option with_dbd_sqlite yes
  58. %option with_dbd_mysql no
  59. %option with_dbd_pgsql no
  60. %option with_dbd_oracle no
  61. %option with_dbd_sybase no
  62. %option with_dbd_odbc no
  63. %option with_dbd_cego no
  64. # list of sources
  65. Source0: http://www.cpan.org/modules/by-module/DBI/DBI-%{V_dbi}.tar.gz
  66. Source1: http://www.cpan.org/modules/by-module/SQL/SQL-Statement-%{V_sql_statement}.tar.gz
  67. Source2: http://www.cpan.org/modules/by-module/SQL/SQL-Abstract-%{V_sql_abstract}.tar.gz
  68. Source3: http://www.darrenduncan.net/d/perl/archives/SQL-Routine-v%{V_sql_routine}.tar.gz
  69. Source4: ftp://ftp.openpkg.org/sources/CPY/ORPHANED/perl/SQL-Builder-%{V_sql_builder}.tar.gz
  70. Source5: http://www.cpan.org/modules/by-module/SQL/SQL-Interpolate-%{V_sql_interpolate}.tar.gz
  71. Source6: http://www.cpan.org/authors/id/J/JR/JROBINSON/SQL-Translator-%{V_sql_translator}.tar.gz
  72. Source7: http://www.cpan.org/modules/by-module/DBD/DBD-Mock-%{V_dbd_mock}.tar.gz
  73. Source8: http://www.cpan.org/modules/by-module/DBD/DBD-AnyData-%{V_dbd_anydata}.tar.gz
  74. Source9: http://www.cpan.org/modules/by-module/DBD/DBD-CSV-%{V_dbd_csv}.tar.gz
  75. Source10: http://www.cpan.org/modules/by-module/DBD/DBD-Sprite-%{V_dbd_sprite}.tar.gz
  76. Source11: http://www.cpan.org/modules/by-module/DBD/DBD-SQLite-%{V_dbd_sqlite}.tar.gz
  77. Source12: http://www.cpan.org/modules/by-module/DBD/DBD-mysql-%{V_dbd_mysql}.tar.gz
  78. Source13: http://www.cpan.org/modules/by-module/DBD/DBD-Pg-%{V_dbd_pgsql}.tar.gz
  79. Source14: http://www.cpan.org/modules/by-module/DBD/DBD-Oracle-%{V_dbd_oracle}.tar.gz
  80. Source15: http://www.cpan.org/modules/by-module/DBD/DBD-ODBC-%{V_dbd_odbc}.tar.gz
  81. Source16: http://www.peppler.org/downloads/DBD-Sybase-%{V_dbd_sybase}.tar.gz
  82. Source17: http://www.cpan.org/modules/by-module/DBD/DBD-PgLite-%{V_dbd_pglite}.tar.gz
  83. Source18: http://www.lemke-it.com/DBD-cego-%{V_dbd_cego}.tar.gz
  84. Patch0: perl-dbi.patch
  85. # build information
  86. Prefix: %{l_prefix}
  87. BuildRoot: %{l_buildroot}
  88. BuildPreReq: OpenPKG, openpkg >= 20040130, perl >= %{V_perl}, perl-openpkg >= %{V_perl}-20040126, pkgconfig
  89. PreReq: OpenPKG, openpkg >= 20040130, perl >= %{V_perl}
  90. BuildPreReq: perl-module, perl-util, perl-net, perl-locale, perl-text, perl-parse
  91. PreReq: perl-module, perl-util, perl-net, perl-locale, perl-text, perl-parse
  92. %if "%{with_dbd_sqlite}" == "yes"
  93. BuildPreReq: sqlite, perl-locale >= %{V_perl}-20060921
  94. PreReq: sqlite, perl-locale >= %{V_perl}-20060921
  95. %endif
  96. %if "%{with_dbd_mysql}" == "yes"
  97. BuildPreReq: mysql
  98. PreReq: mysql
  99. %endif
  100. %if "%{with_dbd_pgsql}" == "yes"
  101. BuildPreReq: postgresql
  102. PreReq: postgresql
  103. %endif
  104. %if "%{with_dbd_oracle}" == "yes"
  105. BuildPreReq: oracle
  106. PreReq: oracle
  107. %endif
  108. %if "%{with_dbd_sybase}" == "yes"
  109. BuildPreReq: freetds, libiconv
  110. PreReq: freetds, libiconv
  111. %endif
  112. %if "%{with_dbd_odbc}" == "yes"
  113. BuildPreReq: ODBC
  114. PreReq: ODBC
  115. %endif
  116. %if "%{with_dbd_cego}" == "yes"
  117. BuildPreReq: cego
  118. PreReq: cego
  119. %endif
  120. AutoReq: no
  121. AutoReqProv: no
  122. %description
  123. Various modules for using the DBI API of Perl:
  124. - DBI (%{V_dbi})
  125. - SQL::Statement (%{V_sql_statement})
  126. - SQL::Abstract (%{V_sql_abstract})
  127. - SQL::Routine (%{V_sql_routine})
  128. - SQL::Builder (%{V_sql_builder})
  129. - SQL::Interpolate (%{V_sql_interpolate})
  130. - SQL::Translator (%{V_sql_translator})
  131. - DBD::Mock (%{V_dbd_mock})
  132. - DBD::AnyData (%{V_dbd_anydata})
  133. - DBD::CSV (%{V_dbd_csv})
  134. - DBD::Sprite (%{V_dbd_sprite})
  135. - DBD::SQLite (%{V_dbd_sqlite}) [%{with_dbd_sqlite}]
  136. - DBD::PgLite (%{V_dbd_pglite}) [%{with_dbd_sqlite}]
  137. - DBD::mysql (%{V_dbd_mysql}) [%{with_dbd_mysql}]
  138. - DBD::Pg (%{V_dbd_pgsql}) [%{with_dbd_pgsql}]
  139. - DBD::Oracle (%{V_dbd_oracle}) [%{with_dbd_oracle}]
  140. - DBD::Sybase (%{V_dbd_sybase}) [%{with_dbd_sybase}]
  141. - DBD::ODBC (%{V_dbd_odbc}) [%{with_dbd_odbc}]
  142. - DBD::Cego (%{V_dbd_cego}) [%{with_dbd_cego}]
  143. %track
  144. prog perl-dbi:DBI = {
  145. version = %{V_dbi}
  146. url = http://www.cpan.org/modules/by-module/DBI/
  147. regex = DBI-(\d+\.\d\d)\.tar\.gz
  148. }
  149. prog perl-dbi:SQL-Statement = {
  150. version = %{V_sql_statement}
  151. url = http://www.cpan.org/modules/by-module/SQL/
  152. regex = SQL-Statement-(__VER__)\.tar\.gz
  153. }
  154. prog perl-dbi:SQL-Abstract = {
  155. version = %{V_sql_abstract}
  156. url = http://www.cpan.org/modules/by-module/SQL/
  157. regex = SQL-Abstract-(__VER__)\.tar\.gz
  158. }
  159. prog perl-dbi:SQL-Routine = {
  160. version = %{V_sql_routine}
  161. url = http://www.darrenduncan.net/d/perl/archives/
  162. regex = SQL-Routine-v(__VER__)\.tar\.gz
  163. }
  164. prog perl-dbi:SQL-Builder = {
  165. disabled
  166. comment = "rse: disappeared from CPAN"
  167. version = %{V_sql_builder}
  168. url = ftp://ftp.openpkg.org/sources/CPY/ORPHANED/perl/
  169. regex = SQL-Builder-(__VER__)\.tar\.gz
  170. }
  171. prog perl-dbi:SQL-Interpolate = {
  172. version = %{V_sql_interpolate}
  173. url = http://www.cpan.org/modules/by-module/SQL/
  174. regex = SQL-Interpolate-(__VER__)\.tar\.gz
  175. }
  176. prog perl-dbi:SQL-Translator = {
  177. version = %{V_sql_translator}
  178. url = http://www.cpan.org/authors/id/J/JR/JROBINSON/
  179. regex = SQL-Translator-(__VER__)\.tar\.gz
  180. }
  181. prog perl-dbi:DBD-Mock = {
  182. version = %{V_dbd_mock}
  183. url = http://www.cpan.org/modules/by-module/DBD/
  184. regex = DBD-Mock-(__VER__)\.tar\.gz
  185. }
  186. prog perl-dbi:DBD-AnyData = {
  187. version = %{V_dbd_anydata}
  188. url = http://www.cpan.org/modules/by-module/DBD/
  189. regex = DBD-AnyData-(__VER__)\.tar\.gz
  190. }
  191. prog perl-dbi:DBD-CSV = {
  192. version = %{V_dbd_csv}
  193. url = http://www.cpan.org/modules/by-module/DBD/
  194. regex = DBD-CSV-(\d+\.\d\d)\.tar\.gz
  195. }
  196. prog perl-dbi:DBD-mysql = {
  197. version = %{V_dbd_mysql}
  198. url = http://www.cpan.org/modules/by-module/DBD/
  199. regex = DBD-mysql-(__VER__)\.tar\.gz
  200. }
  201. prog perl-dbi:DBD-ODBC = {
  202. version = %{V_dbd_odbc}
  203. url = http://www.cpan.org/modules/by-module/DBD/
  204. regex = DBD-ODBC-(__VER__)\.tar\.gz
  205. }
  206. prog perl-dbi:DBD-Oracle = {
  207. version = %{V_dbd_oracle}
  208. url = http://www.cpan.org/modules/by-module/DBD/
  209. regex = DBD-Oracle-(__VER__)\.tar\.gz
  210. }
  211. prog perl-dbi:DBD-Pg = {
  212. version = %{V_dbd_pgsql}
  213. url = http://www.cpan.org/modules/by-module/DBD/
  214. regex = DBD-Pg-(__VER__)\.tar\.gz
  215. }
  216. prog perl-dbi:DBD-Sprite = {
  217. version = %{V_dbd_sprite}
  218. url = http://www.cpan.org/modules/by-module/DBD/
  219. regex = DBD-Sprite-(__VER__)\.tar\.gz
  220. }
  221. prog perl-dbi:DBD-SQLite = {
  222. version = %{V_dbd_sqlite}
  223. url = http://www.cpan.org/modules/by-module/DBD/
  224. regex = DBD-SQLite-(__VER__)\.tar\.gz
  225. }
  226. prog perl-dbi:DBD-PgLite = {
  227. version = %{V_dbd_pglite}
  228. url = http://www.cpan.org/modules/by-module/DBD/
  229. regex = DBD-PgLite-(__VER__)\.tar\.gz
  230. }
  231. prog perl-dbi:DBD-Sybase = {
  232. version = %{V_dbd_sybase}
  233. url = http://www.peppler.org/downloads/
  234. regex = DBD-Sybase-(__VER__)\.tar\.gz
  235. }
  236. prog perl-dbi:DBD-cego = {
  237. version = %{V_dbd_cego}
  238. url = http://www.lemke-it.com/opensource.html
  239. regex = DBD-cego-(__VER__)\.tar\.gz
  240. }
  241. %prep
  242. %setup -q -c
  243. %setup -q -T -D -a 1
  244. %setup -q -T -D -a 2
  245. %setup -q -T -D -a 3
  246. %setup -q -T -D -a 4
  247. %setup -q -T -D -a 5
  248. %setup -q -T -D -a 6
  249. %setup -q -T -D -a 7
  250. %setup -q -T -D -a 8
  251. %setup -q -T -D -a 9
  252. %setup -q -T -D -a 10
  253. %setup -q -T -D -a 11
  254. %setup -q -T -D -a 12
  255. %setup -q -T -D -a 13
  256. %setup -q -T -D -a 14
  257. %setup -q -T -D -a 15
  258. %setup -q -T -D -a 16
  259. %setup -q -T -D -a 17
  260. %setup -q -T -D -a 18
  261. %patch -p0
  262. chmod u+w SQL-Translator-*/*
  263. %build
  264. %install
  265. rm -rf $RPM_BUILD_ROOT
  266. %{l_prefix}/bin/perl-openpkg prepare
  267. # build and install individual modules
  268. %{l_prefix}/bin/perl-openpkg -d %{SOURCE0} configure build install
  269. %{l_prefix}/bin/perl-openpkg -d %{SOURCE1} configure build install
  270. %{l_prefix}/bin/perl-openpkg -d %{SOURCE2} configure build install
  271. %{l_prefix}/bin/perl-openpkg -d %{SOURCE3} configure build install
  272. %{l_prefix}/bin/perl-openpkg -d %{SOURCE4} configure build install
  273. %{l_prefix}/bin/perl-openpkg -d %{SOURCE5} configure build install
  274. %{l_prefix}/bin/perl-openpkg -d %{SOURCE6} configure build install
  275. %{l_prefix}/bin/perl-openpkg -d %{SOURCE7} configure build install
  276. %{l_prefix}/bin/perl-openpkg -d %{SOURCE8} configure build install
  277. %{l_prefix}/bin/perl-openpkg -d %{SOURCE9} configure build install
  278. %{l_prefix}/bin/perl-openpkg -d %{SOURCE10} configure build install
  279. %if "%{with_dbd_sqlite}" == "yes"
  280. # build DBD::SQLite
  281. ( cd DBD-SQLite-%{V_dbd_sqlite}
  282. # remove local SQLite sources (we use external one)
  283. # in order to not confuse ExtUtils::MakeMaker
  284. mv ppport.h dbdimp.[ch] SQLiteXS.h ..
  285. for file in `echo *.[ch] getsqlite.pl`; do
  286. sed -e "s;^ *$file *$;;" <MANIFEST >MANIFEST.NEW && mv MANIFEST.NEW MANIFEST
  287. rm -f $file
  288. done
  289. mv ../ppport.h ../dbdimp.[ch] ../SQLiteXS.h .
  290. # substitute paths in patched Makefile.PL
  291. %{l_shtool} subst %{l_value -s -a} Makefile.PL
  292. # perform regular build and install
  293. %{l_prefix}/bin/perl-openpkg configure build install
  294. ) || exit $?
  295. %{l_prefix}/bin/perl-openpkg -d DBD-PgLite-%{V_dbd_pglite} configure build install
  296. %endif
  297. %if "%{with_dbd_mysql}" == "yes"
  298. # build DBD::mysql
  299. ( cd DBD-mysql-%{V_dbd_mysql}
  300. # (determines MySQL header/lib paths via mysql_config in $PATH)
  301. %{l_prefix}/bin/perl-openpkg configure build install
  302. ) || exit $?
  303. %endif
  304. %if "%{with_dbd_pgsql}" == "yes"
  305. # build DBD::Pg
  306. ( cd DBD-Pg-%{V_dbd_pgsql}
  307. %{l_shtool} subst \
  308. -e 's;POSTGRES_LIB -lpq;POSTGRES_LIB -lpq -lssl -lcrypto -lcrypt;' \
  309. Makefile.PL
  310. POSTGRES_HOME=%{l_prefix}
  311. POSTGRES_INCLUDE=%{l_prefix}/include/postgresql
  312. POSTGRES_LIB=%{l_prefix}/lib
  313. export POSTGRES_HOME POSTGRES_INCLUDE POSTGRES_LIB
  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