perl-dbi.spec 14 KB

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