perl-dbi.spec 13 KB

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