perl-dbi.spec 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238
  1. ##
  2. ## perl-dbi.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2002 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2002 The OpenPKG Project <http://www.openpkg.org/>
  5. ## Copyright (c) 2000-2002 Ralf S. Engelschall <rse@engelschall.com>
  6. ##
  7. ## Permission to use, copy, modify, and distribute this software for
  8. ## any purpose with or without fee is hereby granted, provided that
  9. ## the above copyright notice and this permission notice appear in all
  10. ## copies.
  11. ##
  12. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  13. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  14. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  15. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  16. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  17. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  18. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  19. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  20. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  21. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  22. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  23. ## SUCH DAMAGE.
  24. ##
  25. # versions of individual parts
  26. %define V_dbi 1.28
  27. %define V_sql_statement 1.004
  28. %define V_dbd_anydata 0.05
  29. %define V_dbd_sprite 0.35
  30. %define V_dbd_sqlite 0.15
  31. %define V_dbd_mysql 2.1017
  32. %define V_dbd_pg 1.13
  33. %define V_dbd_oracle 1.12
  34. # package options
  35. %ifndef with_dbd_mysql
  36. %define with_dbd_mysql no
  37. %endif
  38. %ifndef with_dbd_pg
  39. %define with_dbd_pg no
  40. %endif
  41. %ifndef with_dbd_oracle
  42. %define with_dbd_oracle no
  43. %endif
  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: The OpenPKG Project
  50. Distribution: OpenPKG [EXP]
  51. Group: Language
  52. License: GPL/Artistic
  53. Version: 20020614
  54. Release: 20020614
  55. # list of sources
  56. Source0: http://www.cpan.org/modules/by-module/DBI/DBI-%{V_dbi}.tar.gz
  57. Source1: http://www.cpan.org/modules/by-module/SQL/SQL-Statement-%{V_sql_statement}.tar.gz
  58. Source2: http://www.cpan.org/modules/by-module/DBD/DBD-AnyData-%{V_dbd_anydata}.tar.gz
  59. Source3: http://www.cpan.org/modules/by-module/DBD/DBD-Sprite-%{V_dbd_sprite}.tar.gz
  60. Source4: http://www.cpan.org/modules/by-module/DBD/DBD-SQLite-%{V_dbd_sqlite}.tar.gz
  61. Source5: http://www.cpan.org/modules/by-module/DBD/DBD-mysql-%{V_dbd_mysql}.tar.gz
  62. Source6: http://www.cpan.org/modules/by-module/DBD/DBD-Pg-%{V_dbd_pg}.tar.gz
  63. Source7: http://www.cpan.org/modules/by-module/DBD/DBD-Oracle-%{V_dbd_oracle}.tar.gz
  64. # build information
  65. Prefix: %{l_prefix}
  66. BuildRoot: %{l_buildroot}
  67. BuildPreReq: OpenPKG, openpkg >= 20020206, perl
  68. PreReq: OpenPKG, openpkg >= 20020206, perl
  69. %if "%{with_dbd_mysql}" == "yes"
  70. BuildPreReq: mysql
  71. PreReq: mysql
  72. %endif
  73. %if "%{with_dbd_pg}" == "yes"
  74. BuildPreReq: postgresql
  75. PreReq: postgresql
  76. %endif
  77. AutoReq: no
  78. AutoReqProv: no
  79. %description
  80. Various modules for using the DBI API of Perl:
  81. - DBI (%{V_dbi})
  82. - SQL::Statement (%{V_sql_statement})
  83. - DBD::AnyData (%{V_dbd_anydata})
  84. - DBD::Sprite (%{V_dbd_csv})
  85. - DBD::SQLite (%{V_dbd_sqlite})
  86. - DBD::mysql (%{V_dbd_mysql}) [with_dbd_mysql=%{V_with_dbd_mysql}]
  87. - DBD::Pg (%{V_dbd_pg}) [with_dbd_pg=%{V_with_dbd_pg}]
  88. - DBD::Oracle (%{V_dbd_oracle}) [with_dbd_oracle=%{V_with_dbd_oracle}]
  89. %prep
  90. %setup0 -q -c -n %{name}-%{version}
  91. %setup1 -q -T -D -a 1
  92. %setup2 -q -T -D -a 2
  93. %setup3 -q -T -D -a 3
  94. %setup4 -q -T -D -a 4
  95. %if "%{with_dbd_mysql}" == "yes"
  96. %setup5 -q -T -D -a 5
  97. %endif
  98. %if "%{with_dbd_pg}" == "yes"
  99. %setup6 -q -T -D -a 6
  100. %endif
  101. %if "%{with_dbd_oracle}" == "yes"
  102. %setup7 -q -T -D -a 7
  103. %endif
  104. %build
  105. # no-op
  106. %install
  107. rm -rf $RPM_BUILD_ROOT
  108. %{l_shtool} mkdir -f -p -m 755 $RPM_BUILD_ROOT%{l_prefix}/lib/perl5
  109. # create a wrapper script which finds the includes
  110. eval `%{l_prefix}/bin/perl -V:version -V:archname`
  111. perl=$RPM_BUILD_ROOT/perl
  112. echo "#!/bin/sh" >$perl
  113. echo "exec %{l_prefix}/bin/perl \\" >>$perl
  114. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/${version} \\" >>$perl
  115. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/${version}/${archname} \\" >>$perl
  116. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/site_perl \\" >>$perl
  117. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/site_perl/${version} \\" >>$perl
  118. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/site_perl/${version}/${archname} \\" >>$perl
  119. echo " \"\$@\"" >>$perl
  120. chmod a+x $perl
  121. # determine general tools and arguments
  122. perlargs="PREFIX=$RPM_BUILD_ROOT%{l_prefix} PERL=$perl FULLPERL=$perl"
  123. make="%{l_make} %{l_mflags}"
  124. makeargs="PERL=$perl FULLPERL=$perl"
  125. # ensure we can write where we want to
  126. find . -exec chmod ug+w {} \;
  127. # make sure our Perl is used
  128. %{l_shtool} subst \
  129. -e "s:\$^X:'$perl':g" \
  130. `find . -name Makefile.PL -print`
  131. # build DBI modules
  132. ( cd DBI-%{V_dbi}
  133. $perl Makefile.PL $perlargs
  134. $make $makeargs all
  135. $make $makeargs install
  136. )
  137. # build SQL::Statement
  138. ( cd SQL-Statement-%{V_sql_statement}
  139. $perl Makefile.PL $perlargs
  140. $make $makeargs all
  141. $make $makeargs install
  142. )
  143. # build DBD::AnyData
  144. ( cd DBD-AnyData-%{V_dbd_anydata}
  145. $perl Makefile.PL $perlargs
  146. $make $makeargs all
  147. $make $makeargs install
  148. )
  149. # build DBD::Sprite
  150. ( cd DBD-Sprite-%{V_dbd_sprite}
  151. $perl Makefile.PL $perlargs
  152. $make $makeargs all
  153. $make $makeargs install
  154. )
  155. # build DBD::SQLite
  156. ( cd DBD-SQLite-%{V_dbd_sqlite}
  157. # (contains a copy of SQLite, so does not depend on "sqlite" package)
  158. $perl Makefile.PL $perlargs
  159. $make $makeargs all
  160. $make $makeargs install
  161. )
  162. %if "%{with_dbd_mysql}" == "yes"
  163. # build DBD::mysql
  164. ( cd DBD-mysql-%{V_dbd_mysql}
  165. # (determines MySQL header/lib paths via mysql_config in $PATH)
  166. $perl Makefile.PL $perlargs
  167. $make $makeargs all
  168. $make $makeargs install
  169. )
  170. %endif
  171. %if "%{with_dbd_pg}" == "yes"
  172. # build DBD::Pg
  173. ( cd DBD-Pg-%{V_dbd_pg}
  174. POSTGRES_HOME=%{l_prefix}
  175. export POSTGRES_HOME
  176. $perl Makefile.PL $perlargs
  177. $make $makeargs all
  178. $make $makeargs install
  179. )
  180. %endif
  181. %if "%{with_dbd_oracle}" == "yes"
  182. # build DBD::oracle
  183. ( cd DBD-Oracle-%{V_dbd_oracle}
  184. ORACLE_HOME=${ORACLE_HOME-%{l_prefix}}
  185. export ORACLE_HOME
  186. $perl Makefile.PL $perlargs
  187. $make $makeargs all
  188. $make $makeargs install
  189. )
  190. %endif
  191. # clean up
  192. find $RPM_BUILD_ROOT%{l_prefix} -name perllocal.pod -print | xargs rm -f
  193. find $RPM_BUILD_ROOT%{l_prefix} -name .packlist -print | xargs rm -f
  194. find $RPM_BUILD_ROOT%{l_prefix} -type d -depth -print | (xargs rmdir >/dev/null 2>&1 || true)
  195. # avoid conflicts
  196. eval `$perl -V:installarchlib -V:installprivlib -V:installsitearch -V:installsitelib`
  197. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  198. %{l_files_std} \
  199. '%not %dir %{l_prefix}/lib/perl5' \
  200. '%not %dir %{l_prefix}/lib/perl5/*' \
  201. "%not %dir $installarchlib" \
  202. "%not %dir $installprivlib" \
  203. "%not %dir $installsitearch" \
  204. "%not %dir $installsitelib" \
  205. "%not %dir $installarchlib/auto" \
  206. "%not %dir $installprivlib/auto" \
  207. "%not %dir $installsitearch/auto" \
  208. "%not %dir $installsitelib/auto"
  209. %files -f files
  210. %clean
  211. rm -rf $RPM_BUILD_ROOT