ncurses.spec 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156
  1. ##
  2. ## ncurses.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2006 OpenPKG Foundation e.V. <http://openpkg.net/>
  4. ## Copyright (c) 2000-2006 Ralf S. Engelschall <http://engelschall.com/>
  5. ##
  6. ## Permission to use, copy, modify, and distribute this software for
  7. ## any purpose with or without fee is hereby granted, provided that
  8. ## the above copyright notice and this permission notice appear in all
  9. ## copies.
  10. ##
  11. ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
  12. ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
  13. ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
  14. ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR
  15. ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  16. ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  17. ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
  18. ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
  19. ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  20. ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
  21. ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  22. ## SUCH DAMAGE.
  23. ##
  24. # package versions
  25. %define V_base 5.6
  26. %define V_patch1 20061223
  27. %define V_patch2 20061230
  28. %define V_patchB %{V_patch1}
  29. %define V_patchL %{V_patch2}
  30. %define V_patches 2
  31. # package information
  32. Name: ncurses
  33. Summary: Terminal Capability and Display Library
  34. URL: http://www.gnu.org/software/ncurses/
  35. Vendor: Free Software Foundation
  36. Packager: OpenPKG Foundation e.V.
  37. Distribution: OpenPKG Community
  38. Class: BASE
  39. Group: Terminal
  40. License: MIT-style
  41. Version: %{V_base}.%{V_patchL}
  42. Release: 20061231
  43. # list of sources
  44. Source0: ftp://invisible-island.net/ncurses/ncurses-%{V_base}.tar.gz
  45. Patch1: ftp://invisible-island.net/ncurses/%{V_base}/ncurses-%{V_base}-%{V_patch1}.patch.gz
  46. Patch2: ftp://invisible-island.net/ncurses/%{V_base}/ncurses-%{V_base}-%{V_patch2}.patch.gz
  47. Patch100: ncurses.patch
  48. # build information
  49. Prefix: %{l_prefix}
  50. BuildRoot: %{l_buildroot}
  51. BuildPreReq: OpenPKG, openpkg >= 20040130, sharutils
  52. PreReq: OpenPKG, openpkg >= 20040130
  53. AutoReq: no
  54. AutoReqProv: no
  55. %description
  56. NCurses is the GNU re-implementation of the popular SVR4 Curses
  57. terminal screen handling library. Its API is base-level conformant
  58. with the X/OPEN curses specification XSI Curses. It uses the
  59. Terminfo database format, supports pads and color and multiple
  60. highlights and forms characters and function-key mapping, and has
  61. all the other SVR4-Curses enhancements over original BSD Curses.
  62. Additionally, it provides full emulations of the SVR4 panels
  63. (supporting a stack of windows), forms (supporting data collection
  64. through on-screen forms) and menu (supporting a uniform interface
  65. for menu programming) companion libraries.
  66. %track
  67. prog ncurses = {
  68. version = %{V_base}
  69. url = ftp://invisible-island.net/ncurses/
  70. regex = ncurses-(__VER__)\.tar\.gz
  71. }
  72. prog ncurses:patchbase = {
  73. disabled
  74. version = %{V_patchB}
  75. url = ftp://invisible-island.net/ncurses/
  76. regex = (\d+\.\d+)
  77. url = ftp://invisible-island.net/ncurses/__NEWVER__/
  78. regex = ncurses-__NEWVER__-(\d+)-patch\.sh\.bz2
  79. }
  80. prog ncurses:patchset = {
  81. version = %{V_patchL}
  82. url = ftp://invisible-island.net/ncurses/
  83. regex = (\d+\.\d+)
  84. url = ftp://invisible-island.net/ncurses/__NEWVER__/
  85. regex = ncurses-__NEWVER__-(\d+)\.patch\.gz
  86. }
  87. %prep
  88. %setup -q -n ncurses-%{V_base}
  89. for patchfile in \
  90. %{expand:%(i=1; while [ $i -le %{V_patches} ]; do %{l_shtool} echo -n " %%{PATCH$i}"; i=`expr $i + 1`; done)}
  91. do
  92. case "$patchfile" in
  93. *.sh.bz2 ) %{l_bzip2} -d -c $patchfile | sed -e 's;gzip -dc;%{l_gzip} -dc;' -e 's;patch -p1;%{l_patch} -p1;' | sh - || true ;;
  94. *.sh.gz ) %{l_gzip} -d -c $patchfile | sed -e 's;gzip -dc;%{l_gzip} -dc;' -e 's;patch -p1;%{l_patch} -p1;' | sh - || true ;;
  95. *.patch.bz2 ) %{l_bzip2} -d -c $patchfile | %{l_patch} -p1 || true ;;
  96. *.patch.gz ) %{l_gzip} -d -c $patchfile | %{l_patch} -p1 || true ;;
  97. * )
  98. echo "Unknown patch format" | %{l_rpmtool} msg -b -t error 1>&2
  99. exit 1
  100. ;;
  101. esac
  102. done
  103. %patch -p0 -P 100
  104. %build
  105. CC="%{l_cc}" \
  106. CFLAGS="%{l_cflags}" \
  107. ./configure \
  108. --prefix=%{l_prefix} \
  109. --includedir=%{l_prefix}/include/ncurses \
  110. --datadir=%{l_prefix}/share/ncurses \
  111. --enable-hashmap \
  112. --enable-safe-sprintf \
  113. --without-debug \
  114. --with-manpage-format=normal \
  115. --disable-getcap-cache \
  116. --without-cxx-binding \
  117. --without-cxx \
  118. --without-gpm \
  119. --enable-termcap \
  120. --disable-overwrite
  121. %{l_make} %{l_mflags}
  122. %install
  123. rm -rf $RPM_BUILD_ROOT
  124. %{l_shtool} subst -e "s;ln -s;ln;g" edit_man.sh
  125. %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
  126. ( cd $RPM_BUILD_ROOT%{l_prefix}/man
  127. for dir in man1 man3; do
  128. cd $dir
  129. for file in *.[13][a-z]*; do
  130. if [ ".$file" = ".*.[13][a-z]*" ]; then
  131. break
  132. fi
  133. eval `echo "$file" | sed -e 's;^\(.*\.[13]\)[a-z]*$;base=\1;'`
  134. mv $file ncurses_$base
  135. done
  136. cd ..
  137. done
  138. ) || exit $?
  139. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* 2>/dev/null || true
  140. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  141. %files -f files
  142. %clean
  143. rm -rf $RPM_BUILD_ROOT