perl-curses.spec 6.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171
  1. ##
  2. ## perl-curses.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2009 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ##
  5. ## Permission to use, copy, modify, and distribute this software for
  6. ## any purpose with or without fee is hereby granted, provided that
  7. ## the above copyright notice and this permission notice appear in all
  8. ## copies.
  9. ##
  10. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  11. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  12. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  13. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  14. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  15. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  16. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  17. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  18. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  19. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  20. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  21. ## SUCH DAMAGE.
  22. ##
  23. # versions of individual parts
  24. %define V_perl 5.10
  25. %define V_curses 1.27
  26. %define V_curses_ui 0.9607
  27. %define V_curses_ui_dtv 0.10
  28. %define V_curses_widgets 1.997
  29. %define V_curses_forms 1.997
  30. %define V_cdk_perl 20031210
  31. # package information
  32. Name: perl-curses
  33. Summary: Perl Modules for use with Curses
  34. URL: http://www.cpan.org/
  35. Vendor: Perl Community
  36. Packager: OpenPKG Foundation e.V.
  37. Distribution: OpenPKG Community
  38. Class: BASE
  39. Group: Perl
  40. License: GPL/Artistic
  41. Version: %{V_perl}
  42. Release: 20090904
  43. # list of sources
  44. Source0: http://www.cpan.org/modules/by-module/Curses/Curses-%{V_curses}.tgz
  45. Source1: http://www.cpan.org/modules/by-module/Curses/Curses-UI-%{V_curses_ui}.tar.gz
  46. Source2: http://www.cpan.org/modules/by-module/Curses/Curses-UI-DelimitedTextViewer-%{V_curses_ui_dtv}.tar.gz
  47. Source3: http://www.cpan.org/modules/by-module/Curses/CursesWidgets-%{V_curses_widgets}.tar.gz
  48. Source4: http://www.cpan.org/modules/by-module/Curses/CursesForms-%{V_curses_forms}.tar.gz
  49. Source5: ftp://invisible-island.net/cdk/cdk-perl-%{V_cdk_perl}.tgz
  50. # build information
  51. Prefix: %{l_prefix}
  52. BuildRoot: %{l_buildroot}
  53. BuildPreReq: OpenPKG, openpkg >= 20040130, perl >= %{V_perl}, perl-openpkg >= %{V_perl}-20040126
  54. PreReq: OpenPKG, openpkg >= 20040130, perl >= %{V_perl}
  55. BuildPreReq: ncurses, cdk >= 4.9.11.20031210, perl-term
  56. PreReq: ncurses, cdk >= 4.9.11.20031210, perl-term
  57. AutoReq: no
  58. AutoReqProv: no
  59. %description
  60. Various modules for using the Curses library from within the Perl
  61. language plus additional widgets:
  62. - Curses (%{V_curses})
  63. - Curses::UI (%{V_curses_ui})
  64. - Curses::UI::DelimitedTextViewer (%{V_curses_ui_dtv})
  65. - Curses::Widgets (%{V_curses_widgets})
  66. - Curses::Forms (%{V_curses_forms})
  67. - Cdk (%{V_cdk_perl})
  68. %track
  69. prog perl-curses:cdk-perl = {
  70. version = %{V_cdk_perl}
  71. url = ftp://invisible-island.net/cdk/
  72. regex = cdk-perl-(__VER__)\.tgz
  73. }
  74. prog perl-curses:Curses = {
  75. version = %{V_curses}
  76. url = http://www.cpan.org/modules/by-module/Curses/
  77. regex = Curses-(__VER__)\.tgz
  78. }
  79. prog perl-curses:Curses-UI = {
  80. version = %{V_curses_ui}
  81. url = http://www.cpan.org/modules/by-module/Curses/
  82. regex = Curses-UI-(__VER__)\.tar\.gz
  83. }
  84. prog perl-curses:Curses-UI-DelimitedTextViewer = {
  85. version = %{V_curses_ui_dtv}
  86. url = http://www.cpan.org/modules/by-module/Curses/
  87. regex = Curses-UI-DelimitedTextViewer-(__VER__)\.tar\.gz
  88. }
  89. prog perl-curses:CursesForms = {
  90. version = %{V_curses_forms}
  91. url = http://www.cpan.org/modules/by-module/Curses/
  92. regex = CursesForms-(__VER__)\.tar\.gz
  93. }
  94. prog perl-curses:CursesWidgets = {
  95. version = %{V_curses_widgets}
  96. url = http://www.cpan.org/modules/by-module/Curses/
  97. regex = CursesWidgets-(__VER__)\.tar\.gz
  98. }
  99. %prep
  100. %setup -q -c
  101. %setup -q -T -D -a 1
  102. %setup -q -T -D -a 2
  103. %setup -q -T -D -a 3
  104. %setup -q -T -D -a 4
  105. %setup -q -T -D -a 5
  106. %build
  107. %install
  108. rm -rf $RPM_BUILD_ROOT
  109. %{l_prefix}/bin/perl-openpkg prepare
  110. # build Curses
  111. ( cd Curses-%{V_curses}
  112. hint="unknown"
  113. case "%{l_platform -t}" in
  114. *-freebsd* ) hint="freebsd.ncurses" ;;
  115. *-linux* ) hint="linux.ncurses" ;;
  116. *-sunos* ) hint="solaris" ;;
  117. esac
  118. if [ -f hints/c-$hint.h ]; then
  119. cp hints/c-$hint.h c-config.h
  120. fi
  121. ) || exit $?
  122. CURSES_CFLAGS="%{l_cppflags ncurses}" \
  123. CURSES_LDFLAGS="%{l_ldflags} -lncurses" \
  124. CURSES_PANEL_CFLAGS="%{l_cppflags ncurses}" \
  125. CURSES_PANEL_LDFLAGS="%{l_ldflags} -lncurses" \
  126. CURSES_MENU_CFLAGS="%{l_cppflags ncurses}" \
  127. CURSES_MENU_LDFLAGS="%{l_ldflags} -lncurses" \
  128. CURSES_FORM_CFLAGS="%{l_cppflags ncurses}" \
  129. CURSES_FORM_LDFLAGS="%{l_ldflags} -lncurses" \
  130. %{l_prefix}/bin/perl-openpkg -d Curses-%{V_curses} \
  131. --args "PANELS MENUS FORMS" \
  132. configure build install
  133. %{l_prefix}/bin/perl-openpkg -d Curses-UI-%{V_curses_ui} \
  134. configure build install
  135. %{l_prefix}/bin/perl-openpkg -d Curses-UI-DelimitedTextViewer-%{V_curses_ui_dtv} \
  136. configure build install
  137. %{l_prefix}/bin/perl-openpkg -d CursesWidgets-%{V_curses_widgets} \
  138. configure build install
  139. %{l_prefix}/bin/perl-openpkg -d CursesForms-%{V_curses_forms} \
  140. configure build install
  141. # build Cdk
  142. ( cd cdk-perl-%{V_cdk_perl}
  143. %{l_shtool} subst \
  144. -e 's;-L/usr/local/lib;%{l_ldflags};' \
  145. -e 's;-I/usr/include/ncurses;%{l_cppflags ncurses};' \
  146. -e 's;-I/usr/local/include/cdk;%{l_cppflags cdk};' \
  147. Makefile.PL
  148. ) || exit $?
  149. %{l_prefix}/bin/perl-openpkg -d cdk-perl-%{V_cdk_perl} configure build install
  150. %{l_prefix}/bin/perl-openpkg -F perl-openpkg-files fixate cleanup
  151. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std} `cat perl-openpkg-files`
  152. %files -f files
  153. %clean
  154. rm -rf $RPM_BUILD_ROOT