perl-db.spec 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  1. ##
  2. ## perl-db.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_berkeleydb 0.18
  27. %define V_db_file 1.803
  28. %define V_db_file_lock 0.04
  29. %define V_dbi 1.21
  30. %define V_dbd_mysql 2.1017
  31. %define V_dbd_oracle 1.12
  32. # package information
  33. Name: perl-db
  34. Summary: Perl Modules for use with Berkeley-DB
  35. URL: http://www.cpan.org/
  36. Vendor: Perl Community
  37. Packager: The OpenPKG Project
  38. Distribution: OpenPKG [EXP]
  39. Group: Language
  40. License: GPL/Artistic
  41. Version: 20020521
  42. Release: 20020521
  43. # list of sources
  44. Source0: http://www.cpan.org/modules/by-module/BerkeleyDB/BerkeleyDB-%{V_berkeleydb}.tar.gz
  45. Source1: http://www.cpan.org/modules/by-module/DB_File/DB_File-%{V_db_file}.tar.gz
  46. Source2: http://www.cpan.org/modules/by-module/DB_File/DB_File-Lock-%{V_db_file_lock}.tar.gz
  47. Source3: http://www.cpan.org/modules/by-module/DBI/DBI-%{V_dbi}.tar.gz
  48. Source4: http://www.cpan.org/modules/by-module/DBD/DBD-mysql-%{V_dbd_mysql}.tar.gz
  49. Source5: http://www.cpan.org/modules/by-module/DBD/DBD-Oracle-%{V_dbd_oracle}.tar.gz
  50. # build information
  51. Prefix: %{l_prefix}
  52. BuildRoot: %{l_buildroot}
  53. BuildPreReq: OpenPKG, openpkg >= 20020206, perl, db
  54. PreReq: OpenPKG, openpkg >= 20020206, perl, db
  55. AutoReq: no
  56. AutoReqProv: no
  57. %description
  58. Various modules for using the Berkeley-DB library from within Perl:
  59. - BerkeleyDB (%{V_berkeleydb})
  60. - DB_File (%{V_db_file})
  61. - DB_File::Lock (%{V_db_file_lock})
  62. - DBI::Shell (%{V_dbi})
  63. - DBD::ADO (%{V_dbi})
  64. - DBD::Proxy (%{V_dbi})
  65. - DBI::ProxyServer (%{V_dbi})
  66. - DBD::mysql (%{V_dbd_mysql})
  67. - DBD::oracle (%{V_dbd_oracle})
  68. %prep
  69. %setup0 -q -c -n %{name}-%{version}
  70. %setup1 -q -T -D -a 1
  71. %setup2 -q -T -D -a 2
  72. %setup3 -q -T -D -a 3
  73. %setup4 -q -T -D -a 4
  74. %setup5 -q -T -D -a 5
  75. %build
  76. %install
  77. rm -rf $RPM_BUILD_ROOT
  78. %{l_shtool} mkdir -f -p -m 755 \
  79. $RPM_BUILD_ROOT%{l_prefix}/lib/perl5 \
  80. $RPM_BUILD_ROOT%{l_prefix}/man/man3
  81. # create a wrapper script which finds the includes
  82. eval `%{l_prefix}/bin/perl -V:version -V:archname`
  83. perl=$RPM_BUILD_ROOT/perl
  84. echo "#!/bin/sh" >$perl
  85. echo "exec %{l_prefix}/bin/perl \\" >>$perl
  86. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/${version} \\" >>$perl
  87. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/${version}/${archname} \\" >>$perl
  88. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/site_perl \\" >>$perl
  89. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/site_perl/${version} \\" >>$perl
  90. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/site_perl/${version}/${archname} \\" >>$perl
  91. echo " \"\$@\"" >>$perl
  92. chmod a+x $perl
  93. # determine general tools and arguments
  94. perlargs="PREFIX=$RPM_BUILD_ROOT%{l_prefix} PERL=$perl FULLPERL=$perl"
  95. make="%{l_make} %{l_mflags}"
  96. makeargs="PERL=$perl FULLPERL=$perl"
  97. # make sure our Perl is used
  98. %{l_shtool} subst \
  99. -e "s:\$^X:'$perl':g" \
  100. `find . -name Makefile.PL -print`
  101. # build BerkeleyDB
  102. ( cd BerkeleyDB-%{V_berkeleydb}
  103. ( echo "INCLUDE = %{l_prefix}/include"
  104. echo "LIB = %{l_prefix}/lib"
  105. ) >config.in
  106. $perl Makefile.PL $perlargs
  107. $make $makeargs all
  108. $make $makeargs install
  109. %{l_prefix}/bin/pod2man BerkeleyDB.pod \
  110. >$RPM_BUILD_ROOT%{l_prefix}/man/man3/BerkeleyDB.3
  111. )
  112. # build DB_File
  113. ( cd DB_File-%{V_db_file}
  114. ( echo "PREFIX = size_t"
  115. echo "HASH = u_int32_t"
  116. echo "INCLUDE = %{l_prefix}/include"
  117. echo "LIB = %{l_prefix}/lib"
  118. ) >config.in
  119. $perl Makefile.PL $perlargs
  120. $make $makeargs all
  121. $make $makeargs install
  122. %{l_prefix}/bin/pod2man DB_File.pod \
  123. >$RPM_BUILD_ROOT%{l_prefix}/man/man3/DB_File.3
  124. )
  125. # build DB_File::Lock
  126. ( cd DB_File-Lock-%{V_db_file_lock}
  127. $perl Makefile.PL $perlargs
  128. $make $makeargs all
  129. $make $makeargs install
  130. )
  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 DBD::mysql
  138. ( cd DBD-%{V_dbd_mysql}
  139. $perl Makefile.PL $perlargs
  140. $make $makeargs all
  141. $make $makeargs install
  142. )
  143. # build DBD::oracle
  144. ( cd DBD-%{V_dbd_oracle}
  145. $perl Makefile.PL $perlargs
  146. $make $makeargs all
  147. $make $makeargs install
  148. )
  149. # strip down installation tree
  150. find $RPM_BUILD_ROOT%{l_prefix} -name perllocal.pod -print | xargs rm -f
  151. find $RPM_BUILD_ROOT%{l_prefix} -name .packlist -print | xargs rm -f
  152. find $RPM_BUILD_ROOT%{l_prefix} -type d -depth -print | (xargs rmdir >/dev/null 2>&1 || true)
  153. # determine installed files
  154. eval `$perl -V:installarchlib -V:installprivlib -V:installsitearch -V:installsitelib`
  155. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  156. %{l_files_std} \
  157. '%not %dir %{l_prefix}/lib/perl5' \
  158. '%not %dir %{l_prefix}/lib/perl5/*' \
  159. "%not %dir $installarchlib" \
  160. "%not %dir $installprivlib" \
  161. "%not %dir $installsitearch" \
  162. "%not %dir $installsitelib" \
  163. "%not %dir $installarchlib/auto" \
  164. "%not %dir $installprivlib/auto" \
  165. "%not %dir $installsitearch/auto" \
  166. "%not %dir $installsitelib/auto"
  167. %files -f files
  168. %clean
  169. rm -rf $RPM_BUILD_ROOT