perl-time.spec 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. ##
  2. ## perl-time.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_time_date 1.1301
  27. %define V_time_hires 1.37
  28. %define V_date_manip 5.40
  29. %define V_date_calc 5.2
  30. %define V_class_date 1.1.1
  31. %define V_benchmark_timer 0.5
  32. # package information
  33. Name: perl-time
  34. Summary: Perl Modules for Date/Time Handling
  35. URL: http://www.cpan.org/
  36. Vendor: Perl Community
  37. Packager: The OpenPKG Project
  38. Distribution: OpenPKG [BASE]
  39. Group: Language
  40. License: GPL/Artistic
  41. Version: 20020924
  42. Release: 20020924
  43. # list of sources
  44. Source0: http://www.cpan.org/modules/by-module/Date/TimeDate-%{V_time_date}.tar.gz
  45. Source1: http://www.cpan.org/modules/by-module/Time/Time-HiRes-%{V_time_hires}.tar.gz
  46. Source2: http://www.cpan.org/modules/by-module/Date/DateManip-%{V_date_manip}.tar.gz
  47. Source3: http://www.cpan.org/modules/by-module/Date/Date-Calc-%{V_date_calc}.tar.gz
  48. Source4: http://hacks.dlux.hu/Class-Date/download/Class-Date-%{V_class_date}.tar.gz
  49. Source5: http://www.cpan.org/authors/id/A/AN/ANDREWHO/Benchmark-Timer-%{V_benchmark_timer}.tar.gz
  50. # build information
  51. Prefix: %{l_prefix}
  52. BuildRoot: %{l_buildroot}
  53. BuildPreReq: OpenPKG, openpkg >= 20020206, perl, perl-ds
  54. PreReq: OpenPKG, openpkg >= 20020206, perl, perl-ds
  55. AutoReq: no
  56. AutoReqProv: no
  57. %description
  58. Various Perl modules for Date and Time handling:
  59. - Time::Date (%{V_time_date})
  60. - Time::HiRes (%{V_time_hires})
  61. - Date::Manip (%{V_date_manip})
  62. - Date::Calc (%{V_date_calc})
  63. - Class::Date (%{V_class_date})
  64. - Benchmark::Timer (%{V_benchmark_timer})
  65. %prep
  66. %setup0 -q -c -n %{name}-%{version}
  67. %setup1 -q -T -D -a 1
  68. %setup2 -q -T -D -a 2
  69. %setup3 -q -T -D -a 3
  70. %setup4 -q -T -D -a 4
  71. %setup5 -q -T -D -a 5
  72. %build
  73. %install
  74. rm -rf $RPM_BUILD_ROOT
  75. %{l_shtool} mkdir -f -p -m 755 \
  76. $RPM_BUILD_ROOT%{l_prefix}/lib/perl5 \
  77. $RPM_BUILD_ROOT%{l_prefix}/man/man3
  78. # create a wrapper script which finds the includes
  79. eval `%{l_prefix}/bin/perl -V:version -V:archname`
  80. perl=$RPM_BUILD_ROOT/perl
  81. echo "#!/bin/sh" >$perl
  82. echo "exec %{l_prefix}/bin/perl \\" >>$perl
  83. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/${version} \\" >>$perl
  84. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/${version}/${archname} \\" >>$perl
  85. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/site_perl \\" >>$perl
  86. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/site_perl/${version} \\" >>$perl
  87. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/site_perl/${version}/${archname} \\" >>$perl
  88. echo " \"\$@\"" >>$perl
  89. chmod a+x $perl
  90. # determine general tools and arguments
  91. perlargs="PREFIX=$RPM_BUILD_ROOT%{l_prefix} PERL=$perl FULLPERL=$perl"
  92. make="%{l_make} %{l_mflags}"
  93. makeargs="PERL=$perl FULLPERL=$perl"
  94. # build Time::Date
  95. ( cd TimeDate-%{V_time_date}
  96. $perl Makefile.PL $perlargs
  97. $make $makeargs all
  98. $make $makeargs install
  99. )
  100. # build Time::HiRes
  101. ( cd Time-HiRes-%{V_time_hires}
  102. $perl Makefile.PL $perlargs
  103. $make $makeargs all
  104. $make $makeargs install
  105. )
  106. # build Date::Manip
  107. ( cd DateManip-%{V_date_manip}
  108. $perl Makefile.PL $perlargs
  109. $make $makeargs all
  110. $make $makeargs install
  111. )
  112. # build Date::Calc
  113. ( cd Date-Calc-%{V_date_calc}
  114. $perl Makefile.PL $perlargs
  115. $make $makeargs all
  116. $make $makeargs install
  117. )
  118. # build Class::Date
  119. ( cd Class-Date-%{V_class_date}
  120. $perl Makefile.PL $perlargs
  121. $make $makeargs all
  122. $make $makeargs install
  123. )
  124. # build Benchmark::Timer
  125. ( cd Benchmark-Timer-%{V_benchmark_timer}
  126. $perl Makefile.PL $perlargs
  127. $make $makeargs all
  128. $make $makeargs install
  129. )
  130. # hack out the Date::Calc doc conflicts
  131. rm -f $RPM_BUILD_ROOT%{l_prefix}/man/man3/Carp::Clan.3
  132. rm -rf $RPM_BUILD_ROOT%{l_prefix}/lib/perl5/site_perl/5.6.1/*/Carp
  133. # strip down installation tree
  134. find $RPM_BUILD_ROOT%{l_prefix} -name perllocal.pod -print | xargs rm -f
  135. find $RPM_BUILD_ROOT%{l_prefix} -name .packlist -print | xargs rm -f
  136. find $RPM_BUILD_ROOT%{l_prefix} -type d -depth -print | (xargs rmdir >/dev/null 2>&1 || true)
  137. # determine installed files
  138. eval `$perl -V:installarchlib -V:installprivlib -V:installsitearch -V:installsitelib`
  139. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  140. %{l_files_std} \
  141. '%not %dir %{l_prefix}/lib/perl5' \
  142. '%not %dir %{l_prefix}/lib/perl5/*' \
  143. "%not %dir $installarchlib" \
  144. "%not %dir $installprivlib" \
  145. "%not %dir $installsitearch" \
  146. "%not %dir $installsitelib" \
  147. "%not %dir $installarchlib/auto" \
  148. "%not %dir $installprivlib/auto" \
  149. "%not %dir $installsitearch/auto" \
  150. "%not %dir $installsitelib/auto"
  151. %files -f files
  152. %clean
  153. rm -rf $RPM_BUILD_ROOT