ncurses.spec 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170
  1. ##
  2. ## ncurses.spec -- OpenPKG RPM Package Specification
  3. ## Copyright (c) 2000-2008 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. # package versions
  24. %define V_base 5.6
  25. %define V_patch1 20071201
  26. %define V_patch2 20071215
  27. %define V_patch3 20071222
  28. %define V_patch4 20080105
  29. %define V_patch5 20080112
  30. %define V_patch6 20080119
  31. %define V_patch7 20080203
  32. %define V_patch8 20080209
  33. %define V_patchB %{V_patch1}
  34. %define V_patchL %{V_patch8}
  35. %define V_patches 8
  36. # package information
  37. Name: ncurses
  38. Summary: Terminal Capability and Display Library
  39. URL: http://www.gnu.org/software/ncurses/
  40. Vendor: Free Software Foundation
  41. Packager: OpenPKG Foundation e.V.
  42. Distribution: OpenPKG Community
  43. Class: CORE
  44. Group: Terminal
  45. License: MIT-style
  46. Version: %{V_base}.%{V_patchL}
  47. Release: 20080210
  48. # list of sources
  49. Source0: ftp://invisible-island.net/ncurses/ncurses-%{V_base}.tar.gz
  50. Patch1: ftp://invisible-island.net/ncurses/%{V_base}/ncurses-%{V_base}-%{V_patch1}-patch.sh.bz2
  51. Patch2: ftp://invisible-island.net/ncurses/%{V_base}/ncurses-%{V_base}-%{V_patch2}.patch.gz
  52. Patch3: ftp://invisible-island.net/ncurses/%{V_base}/ncurses-%{V_base}-%{V_patch3}.patch.gz
  53. Patch4: ftp://invisible-island.net/ncurses/%{V_base}/ncurses-%{V_base}-%{V_patch4}.patch.gz
  54. Patch5: ftp://invisible-island.net/ncurses/%{V_base}/ncurses-%{V_base}-%{V_patch5}.patch.gz
  55. Patch6: ftp://invisible-island.net/ncurses/%{V_base}/ncurses-%{V_base}-%{V_patch6}.patch.gz
  56. Patch7: ftp://invisible-island.net/ncurses/%{V_base}/ncurses-%{V_base}-%{V_patch7}.patch.gz
  57. Patch8: ftp://invisible-island.net/ncurses/%{V_base}/ncurses-%{V_base}-%{V_patch8}.patch.gz
  58. Patch100: ncurses.patch
  59. # build information
  60. Prefix: %{l_prefix}
  61. BuildRoot: %{l_buildroot}
  62. BuildPreReq: OpenPKG, openpkg >= 20040130
  63. PreReq: OpenPKG, openpkg >= 20040130
  64. AutoReq: no
  65. AutoReqProv: no
  66. %description
  67. NCurses is the GNU re-implementation of the popular SVR4 Curses
  68. terminal screen handling library. Its API is base-level conformant
  69. with the X/OPEN curses specification XSI Curses. It uses the
  70. Terminfo database format, supports pads and color and multiple
  71. highlights and forms characters and function-key mapping, and has
  72. all the other SVR4-Curses enhancements over original BSD Curses.
  73. Additionally, it provides full emulations of the SVR4 panels
  74. (supporting a stack of windows), forms (supporting data collection
  75. through on-screen forms) and menu (supporting a uniform interface
  76. for menu programming) companion libraries.
  77. %track
  78. prog ncurses = {
  79. version = %{V_base}
  80. url = ftp://invisible-island.net/ncurses/
  81. regex = ncurses-(__VER__)\.tar\.gz
  82. }
  83. prog ncurses:patchbase = {
  84. disabled
  85. version = %{V_patchB}
  86. url = ftp://invisible-island.net/ncurses/
  87. regex = (\d+\.\d+)
  88. url = ftp://invisible-island.net/ncurses/__NEWVER__/
  89. regex = ncurses-__NEWVER__-(\d+)-patch\.sh\.bz2
  90. }
  91. prog ncurses:patchset = {
  92. version = %{V_patchL}
  93. url = ftp://invisible-island.net/ncurses/
  94. regex = (\d+\.\d+)
  95. url = ftp://invisible-island.net/ncurses/__NEWVER__/
  96. regex = ncurses-__NEWVER__-(\d+)\.patch\.gz
  97. }
  98. %prep
  99. %setup -q -n ncurses-%{V_base}
  100. for patchfile in \
  101. %{expand:%(i=1; while [ $i -le %{V_patches} ]; do %{l_shtool} echo -n " %%{PATCH$i}"; i=`expr $i + 1`; done)}
  102. do
  103. case "$patchfile" in
  104. *-patch.sh.bz2 ) %{l_bzip2} -d -c $patchfile | %{l_patch} -p1 || true ;;
  105. *-patch.sh.gz ) %{l_bzip2} -d -c $patchfile | %{l_patch} -p1 || true ;;
  106. *.sh.bz2 ) %{l_bzip2} -d -c $patchfile | sed -e 's;gzip -dc;%{l_gzip} -dc;' -e 's;patch -p1;%{l_patch} -p1;' | sh - || true ;;
  107. *.sh.gz ) %{l_gzip} -d -c $patchfile | sed -e 's;gzip -dc;%{l_gzip} -dc;' -e 's;patch -p1;%{l_patch} -p1;' | sh - || true ;;
  108. *.patch.bz2 ) %{l_bzip2} -d -c $patchfile | %{l_patch} -p1 || true ;;
  109. *.patch.gz ) %{l_gzip} -d -c $patchfile | %{l_patch} -p1 || true ;;
  110. * )
  111. echo "Unknown patch format" | %{l_rpmtool} msg -b -t error 1>&2
  112. exit 1
  113. ;;
  114. esac
  115. done
  116. %patch -p0 -P 100
  117. %build
  118. CC="%{l_cc}" \
  119. CPPFLAGS="%{l_cppflags}" \
  120. CFLAGS="%{l_cflags}" \
  121. ./configure \
  122. --prefix=%{l_prefix} \
  123. --includedir=%{l_prefix}/include/ncurses \
  124. --datadir=%{l_prefix}/share/ncurses \
  125. --enable-hashmap \
  126. --enable-safe-sprintf \
  127. --without-debug \
  128. --with-manpage-format=normal \
  129. --disable-getcap-cache \
  130. --without-cxx-binding \
  131. --without-cxx \
  132. --without-gpm \
  133. --enable-termcap \
  134. --disable-overwrite
  135. %{l_make} %{l_mflags}
  136. %install
  137. rm -rf $RPM_BUILD_ROOT
  138. %{l_shtool} subst -e "s;ln -s;ln;g" edit_man.sh
  139. %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
  140. ( cd $RPM_BUILD_ROOT%{l_prefix}/man
  141. for dir in man1 man3; do
  142. cd $dir
  143. for file in *.[13][a-z]*; do
  144. if [ ".$file" = ".*.[13][a-z]*" ]; then
  145. break
  146. fi
  147. eval `echo "$file" | sed -e 's;^\(.*\.[13]\)[a-z]*$;base=\1;'`
  148. mv $file ncurses_$base
  149. done
  150. cd ..
  151. done
  152. ) || exit $?
  153. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* 2>/dev/null || true
  154. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  155. %files -f files
  156. %clean
  157. rm -rf $RPM_BUILD_ROOT