perl-term.spec 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190
  1. ##
  2. ## perl-term.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_term_readkey 2.19
  27. %define V_term_inkey 1.02
  28. %define V_term_size 0.2
  29. %define V_term_query 2.0
  30. %define V_term_readline_gnu 1.12
  31. %define V_term_readline_perl 1.0202
  32. %define V_io_tty 1.02
  33. # package information
  34. Name: perl-term
  35. Summary: Perl Modules for use with Terminals
  36. URL: http://www.cpan.org/
  37. Vendor: Perl Community
  38. Packager: The OpenPKG Project
  39. Distribution: OpenPKG [EXP]
  40. Group: Language
  41. License: GPL/Artistic
  42. Version: 20020517
  43. Release: 20020517
  44. # list of sources
  45. Source0: http://www.cpan.org/modules/by-module/Term/TermReadKey-%{V_term_readkey}.tar.gz
  46. Source1: http://www.cpan.org/modules/by-module/Term/Term-InKey-%{V_term_inkey}.tar.gz
  47. Source2: http://www.cpan.org/modules/by-module/Term/Term-Size-%{V_term_size}.tar.gz
  48. Source3: http://www.cpan.org/modules/by-module/Term/Term-Query-%{V_term_query}.tar.gz
  49. Source4: http://www.cpan.org/modules/by-module/Term/Term-ReadLine-Gnu-%{V_term_readline_gnu}.tar.gz
  50. Source5: http://www.cpan.org/modules/by-module/Term/Term-ReadLine-Perl-%{V_term_readline_perl}.tar.gz
  51. Source6: http://www.cpan.org/modules/by-module/IO/IO-Tty-%{V_io_tty}.tar.gz
  52. # build information
  53. Prefix: %{l_prefix}
  54. BuildRoot: %{l_buildroot}
  55. BuildPreReq: OpenPKG, openpkg >= 20020206, perl, readline
  56. PreReq: OpenPKG, openpkg >= 20020206, perl
  57. AutoReq: no
  58. AutoReqProv: no
  59. %description
  60. Various Perl modules for use on Terminals:
  61. - Term::ReadKey (%{V_term_readkey})
  62. - Term::InKey (%{V_term_inkey})
  63. - Term::Size (%{V_term_size})
  64. - Term::Query (%{V_term_query})
  65. - Term::ReadLine::Gnu (%{V_term_readline_gnu})
  66. - Term::ReadLine::Perl (%{V_term_readline_perl})
  67. - IO::Tty (%{V_io_tty})
  68. - IO::Pty (%{V_io_tty})
  69. %prep
  70. %setup0 -q -c -n %{name}-%{version}
  71. %setup1 -q -T -D -a 1
  72. %setup2 -q -T -D -a 2
  73. %setup3 -q -T -D -a 3
  74. %setup4 -q -T -D -a 4
  75. %setup5 -q -T -D -a 5
  76. %setup6 -q -T -D -a 6
  77. %build
  78. %install
  79. rm -rf $RPM_BUILD_ROOT
  80. %{l_shtool} mkdir -f -p -m 755 \
  81. $RPM_BUILD_ROOT%{l_prefix}/lib/perl5 \
  82. $RPM_BUILD_ROOT%{l_prefix}/man/man3
  83. # create a wrapper script which finds the includes
  84. eval `%{l_prefix}/bin/perl -V:version -V:archname`
  85. perl=$RPM_BUILD_ROOT/perl
  86. echo "#!/bin/sh" >$perl
  87. echo "exec %{l_prefix}/bin/perl \\" >>$perl
  88. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/${version} \\" >>$perl
  89. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/${version}/${archname} \\" >>$perl
  90. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/site_perl \\" >>$perl
  91. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/site_perl/${version} \\" >>$perl
  92. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/site_perl/${version}/${archname} \\" >>$perl
  93. echo " \"\$@\"" >>$perl
  94. chmod a+x $perl
  95. # determine general tools and arguments
  96. perlargs="PREFIX=$RPM_BUILD_ROOT%{l_prefix} PERL=$perl FULLPERL=$perl"
  97. make="%{l_make} %{l_mflags}"
  98. makeargs="PERL=$perl FULLPERL=$perl"
  99. # make sure our Perl is used
  100. chmod -R u+w .
  101. %{l_shtool} subst \
  102. -e "s:\$^X:'$perl':g" \
  103. `find . -name Makefile.PL -print`
  104. # build Term::ReadKey
  105. ( cd TermReadKey-%{V_term_readkey}
  106. $perl Makefile.PL $perlargs
  107. $make $makeargs all
  108. $make $makeargs install
  109. )
  110. # build Term::InKey
  111. ( cd Term-InKey-%{V_term_inkey}
  112. $perl Makefile.PL $perlargs
  113. $make $makeargs all
  114. $make $makeargs install
  115. )
  116. # build Term::Size
  117. ( cd Term-Size-%{V_term_size}
  118. $perl Makefile.PL $perlargs
  119. $make $makeargs all
  120. $make $makeargs install
  121. )
  122. # build Term::Query
  123. ( cd Term-Query-%{V_term_query}
  124. $perl Makefile.PL $perlargs
  125. $make $makeargs all
  126. $make $makeargs install
  127. )
  128. # build Term::ReadLine::Gnu
  129. ( cd Term-ReadLine-Gnu-%{V_term_readline_gnu}
  130. $perl Makefile.PL $perlargs --includedir=%{l_prefix}/include/readline --libdir=%{l_prefix}/lib
  131. $make $makeargs all
  132. $make $makeargs install
  133. )
  134. # build Term::ReadLine::Perl
  135. ( cd Term-ReadLine-Perl-%{V_term_readline_perl}
  136. $perl Makefile.PL $perlargs
  137. $make $makeargs all
  138. $make $makeargs install
  139. )
  140. # build IO::Tty and IO::Pty
  141. ( cd IO-Tty-%{V_io_tty}
  142. $perl Makefile.PL $perlargs
  143. $make $makeargs all
  144. $make $makeargs install
  145. )
  146. # strip down installation tree
  147. find $RPM_BUILD_ROOT%{l_prefix} -name perllocal.pod -print | xargs rm -f
  148. find $RPM_BUILD_ROOT%{l_prefix} -name .packlist -print | xargs rm -f
  149. find $RPM_BUILD_ROOT%{l_prefix} -type d -depth -print | (xargs rmdir >/dev/null 2>&1 || true)
  150. # determine installed files
  151. eval `$perl -V:installarchlib -V:installprivlib -V:installsitearch -V:installsitelib`
  152. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  153. %{l_files_std} \
  154. '%not %dir %{l_prefix}/lib/perl5' \
  155. '%not %dir %{l_prefix}/lib/perl5/*' \
  156. "%not %dir $installarchlib" \
  157. "%not %dir $installprivlib" \
  158. "%not %dir $installsitearch" \
  159. "%not %dir $installsitelib" \
  160. "%not %dir $installarchlib/auto" \
  161. "%not %dir $installprivlib/auto" \
  162. "%not %dir $installsitearch/auto" \
  163. "%not %dir $installsitelib/auto"
  164. %files -f files
  165. %clean
  166. rm -rf $RPM_BUILD_ROOT