perl-db.spec 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155
  1. ##
  2. ## perl-db.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2001 Cable & Wireless Deutschland GmbH
  4. ## Copyright (c) 2000-2001 The OpenPKG Project <http://www.openpkg.org/>
  5. ## Copyright (c) 2000-2001 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.17
  27. %define V_db_file 1.801
  28. %define V_db_file_lock 0.04
  29. # package information
  30. Name: perl-db
  31. Summary: Perl Modules for use with Berkeley-DB
  32. URL: http://www.cpan.org/
  33. Vendor: Perl Community
  34. Packager: The OpenPKG Project
  35. Distribution: OpenPKG [EXP]
  36. Group: Language
  37. License: GPL/Artistic
  38. Version: 20011227
  39. Release: 20011227
  40. # list of sources
  41. Source0: http://www.cpan.org/modules/by-module/BerkeleyDB/BerkeleyDB-%{V_berkeleydb}.tar.gz
  42. Source1: http://www.cpan.org/modules/by-module/DB_File/DB_File-%{V_db_file}.tar.gz
  43. Source2: http://www.cpan.org/modules/by-module/DB_File/DB_File-Lock-%{V_db_file_lock}.tar.gz
  44. # build information
  45. Prefix: %{l_prefix}
  46. BuildRoot: %{l_buildroot}
  47. BuildPreReq: OpenPKG, openpkg >= 20011227, perl, db, gcc
  48. PreReq: OpenPKG, openpkg >= 20011227, perl, db
  49. AutoReq: no
  50. AutoReqProv: no
  51. %description
  52. Various modules for using the GD library from within the Perl
  53. language plus additional functionality for drawing various types of
  54. charts and graphs.
  55. %prep
  56. %setup0 -q -c -n %{name}-%{version}
  57. %setup1 -q -T -D -a 1
  58. %setup2 -q -T -D -a 2
  59. %build
  60. %install
  61. rm -rf $RPM_BUILD_ROOT
  62. %{l_shtool} mkdir -f -p -m 755 \
  63. $RPM_BUILD_ROOT%{l_prefix}/lib/perl5 \
  64. $RPM_BUILD_ROOT%{l_prefix}/man/man3
  65. # create a wrapper script which finds the includes
  66. eval `$perl -V:archname`
  67. perl=$RPM_BUILD_ROOT/perl
  68. echo "#!/bin/sh" >$perl
  69. echo "exec %{l_prefix}/bin/perl \\" >>$perl
  70. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/%{version} \\" >>$perl
  71. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/%{version}/${archname} \\" >>$perl
  72. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/site_perl \\" >>$perl
  73. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/site_perl/%{version} \\" >>$perl
  74. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/site_perl/%{version}/${archname} \\" >>$perl
  75. echo " \"\$@\"" >>$perl
  76. chmod a+x $perl
  77. # determine general tools and arguments
  78. perlargs="PREFIX=$RPM_BUILD_ROOT%{l_prefix} PERL=$perl FULLPERL=$perl"
  79. make="%{l_make} %{l_mflags}"
  80. makeargs="PERL=$perl FULLPERL=$perl"
  81. # make sure our Perl is used
  82. %{l_rpmtool} subst \
  83. "s:\$^X:'$perl':g" \
  84. -- `find . -name Makefile.PL -print`
  85. # build BerkeleyDB
  86. ( cd BerkeleyDB-%{V_berkeleydb}
  87. ( echo "INCLUDE = %{l_prefix}/include"
  88. echo "LIB = %{l_prefix}/lib"
  89. ) >config.in
  90. $perl Makefile.PL $perlargs
  91. $make $makeargs all
  92. $make $makeargs install
  93. %{l_prefix}/bin/pod2man BerkeleyDB.pod \
  94. >$RPM_BUILD_ROOT%{l_prefix}/man/man3/BerkeleyDB.3
  95. )
  96. # build DB_File
  97. ( cd DB_File-%{V_db_file}
  98. ( echo "PREFIX = size_t"
  99. echo "HASH = u_int32_t"
  100. echo "INCLUDE = %{l_prefix}/include"
  101. echo "LIB = %{l_prefix}/lib"
  102. ) >config.in
  103. $perl Makefile.PL $perlargs
  104. $make $makeargs all
  105. $make $makeargs install
  106. %{l_prefix}/bin/pod2man DB_File.pod \
  107. >$RPM_BUILD_ROOT%{l_prefix}/man/man3/DB_File.3
  108. )
  109. # build DB_File::Lock
  110. ( cd DB_File-Lock-%{V_db_file_lock}
  111. $perl Makefile.PL $perlargs
  112. $make $makeargs all
  113. $make $makeargs install
  114. )
  115. # strip down installation tree
  116. find $RPM_BUILD_ROOT%{l_prefix} -name perllocal.pod -print | xargs rm -f
  117. find $RPM_BUILD_ROOT%{l_prefix} -name .packlist -print | xargs rm -f
  118. find $RPM_BUILD_ROOT%{l_prefix} -type d -depth -print | (xargs rmdir >/dev/null 2>&1 || true)
  119. # determine installed files
  120. eval `$perl -V:installarchlib -V:installprivlib -V:installsitearch -V:installsitelib`
  121. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  122. %{l_files_std} \
  123. '%not %dir %{l_prefix}/lib/perl5' \
  124. '%not %dir %{l_prefix}/lib/perl5/*' \
  125. "%not %dir $installarchlib" \
  126. "%not %dir $installprivlib" \
  127. "%not %dir $installsitearch" \
  128. "%not %dir $installsitelib" \
  129. "%not %dir $installarchlib/auto" \
  130. "%not %dir $installprivlib/auto" \
  131. "%not %dir $installsitearch/auto" \
  132. "%not %dir $installsitelib/auto"
  133. %files -f files
  134. %clean
  135. rm -rf $RPM_BUILD_ROOT