perl-curses.spec 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. ##
  2. ## perl-curses.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_curses 1.06
  27. %define V_curses_ui 0.63
  28. %define V_curses_widgets 1.992
  29. %define V_cdk_perl 20010421
  30. # package information
  31. Name: perl-curses
  32. Summary: Perl Modules for use with Curses
  33. URL: http://www.cpan.org/
  34. Vendor: Perl Community
  35. Packager: The OpenPKG Project
  36. Distribution: OpenPKG [EXP]
  37. Group: Language
  38. License: GPL/Artistic
  39. Version: 20020117
  40. Release: 20020206
  41. # list of sources
  42. Source0: http://www.cpan.org/modules/by-module/Curses/Curses-%{V_curses}.tar.gz
  43. Source1: http://www.cpan.org/modules/by-module/Curses/Curses-UI-%{V_curses_ui}.tar.gz
  44. Source2: http://www.cpan.org/modules/by-module/Curses/CursesWidgets-%{V_curses_widgets}.tar.gz
  45. Source3: ftp://invisible-island.net/cdk/cdk-perl-%{V_cdk_perl}.tgz
  46. # build information
  47. Prefix: %{l_prefix}
  48. BuildRoot: %{l_buildroot}
  49. BuildPreReq: OpenPKG, openpkg >= 20020206, perl, ncurses, cdk, perl-term
  50. PreReq: OpenPKG, openpkg >= 20020206, perl, ncurses, cdk
  51. AutoReq: no
  52. AutoReqProv: no
  53. %description
  54. Various modules for using the Curses library from within the Perl
  55. language plus additional widgets:
  56. - Curses (%{V_curses})
  57. - Curses::UI (%{V_curses_ui})
  58. - Curses::Widgets (%{V_curses_widgets})
  59. - Cdk (%{V_cdk_perl})
  60. %prep
  61. %setup0 -q -c -n %{name}-%{version}
  62. %setup1 -q -T -D -a 1
  63. %setup2 -q -T -D -a 2
  64. %setup3 -q -T -D -a 3
  65. %build
  66. %install
  67. rm -rf $RPM_BUILD_ROOT
  68. %{l_shtool} mkdir -f -p -m 755 \
  69. $RPM_BUILD_ROOT%{l_prefix}/lib/perl5 \
  70. $RPM_BUILD_ROOT%{l_prefix}/man/man3
  71. # create a wrapper script which finds the includes
  72. eval `$perl -V:archname`
  73. perl=$RPM_BUILD_ROOT/perl
  74. echo "#!/bin/sh" >$perl
  75. echo "exec %{l_prefix}/bin/perl \\" >>$perl
  76. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/%{version} \\" >>$perl
  77. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/%{version}/${archname} \\" >>$perl
  78. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/site_perl \\" >>$perl
  79. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/site_perl/%{version} \\" >>$perl
  80. echo " -I$RPM_BUILD_ROOT%{l_prefix}/lib/perl5/site_perl/%{version}/${archname} \\" >>$perl
  81. echo " \"\$@\"" >>$perl
  82. chmod a+x $perl
  83. # determine general tools and arguments
  84. perlargs="PREFIX=$RPM_BUILD_ROOT%{l_prefix} PERL=$perl FULLPERL=$perl"
  85. make="%{l_make} %{l_mflags}"
  86. makeargs="PERL=$perl FULLPERL=$perl"
  87. # make sure our Perl is used
  88. chmod -R u+w .
  89. %{l_shtool} subst \
  90. -e "s:\$^X:'$perl':g" \
  91. `find . -name Makefile.PL -print`
  92. # build Curses
  93. ( cd Curses-%{V_curses}
  94. hint="unknown"
  95. case "%{l_target}" in
  96. *-freebsd* ) hint="freebsd.ncurses" ;;
  97. *-linux* ) hint="linux.ncurses" ;;
  98. *-solaris* ) hint="solaris" ;;
  99. esac
  100. if [ -f hints/c-$hint.h ]; then
  101. cp hints/c-$hint.h c-config.h
  102. fi
  103. %{l_shtool} subst \
  104. -e 's:my $inc;:my $inc = "-I%{l_prefix}/include -I%{l_prefix}/include/ncurses";:' \
  105. -e 's:my $libs;:my $libs = "-L%{l_prefix}/lib -lpanel -lmenu -lform -lncurses";:' \
  106. Makefile.PL
  107. $perl Makefile.PL $perlargs PANELS MENUS FORMS
  108. $make $makeargs all
  109. $make $makeargs install
  110. )
  111. # build Curses::UI
  112. ( cd Curses-UI-%{V_curses_ui}
  113. $perl Makefile.PL $perlargs
  114. $make $makeargs all
  115. $make $makeargs install
  116. )
  117. # build Curses::Widgets
  118. ( cd CursesWidgets-%{V_curses_widgets}
  119. $perl Makefile.PL $perlargs
  120. $make $makeargs all
  121. $make $makeargs install
  122. )
  123. # build Cdk
  124. ( cd cdk-perl-%{V_cdk_perl}
  125. %{l_shtool} subst \
  126. -e 's;-L/usr/local/lib;-L%{l_prefix}/lib;' \
  127. -e 's;-I/usr/include/ncurses;-I%{l_prefix}/include/ncurses;' \
  128. -e 's;-I/usr/local/include/cdk;-I%{l_prefix}/include/cdk;' \
  129. Makefile.PL
  130. $perl Makefile.PL $perlargs
  131. $make $makeargs all
  132. $make $makeargs install
  133. )
  134. # strip down installation tree
  135. find $RPM_BUILD_ROOT%{l_prefix} -name perllocal.pod -print | xargs rm -f
  136. find $RPM_BUILD_ROOT%{l_prefix} -name .packlist -print | xargs rm -f
  137. find $RPM_BUILD_ROOT%{l_prefix} -type d -depth -print | (xargs rmdir >/dev/null 2>&1 || true)
  138. # determine installed files
  139. eval `$perl -V:installarchlib -V:installprivlib -V:installsitearch -V:installsitelib`
  140. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \
  141. %{l_files_std} \
  142. '%not %dir %{l_prefix}/lib/perl5' \
  143. '%not %dir %{l_prefix}/lib/perl5/*' \
  144. "%not %dir $installarchlib" \
  145. "%not %dir $installprivlib" \
  146. "%not %dir $installsitearch" \
  147. "%not %dir $installsitelib" \
  148. "%not %dir $installarchlib/auto" \
  149. "%not %dir $installprivlib/auto" \
  150. "%not %dir $installsitearch/auto" \
  151. "%not %dir $installsitelib/auto"
  152. %files -f files
  153. %clean
  154. rm -rf $RPM_BUILD_ROOT