ncurses.spec 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. ##
  2. ## ncurses.spec -- OpenPKG RPM Specification
  3. ## Copyright (c) 2000-2004 The OpenPKG Project <http://www.openpkg.org/>
  4. ## Copyright (c) 2000-2004 Ralf S. Engelschall <rse@engelschall.com>
  5. ## Copyright (c) 2000-2004 Cable & Wireless <http://www.cw.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. # FIXME: before 2.0 release, remove crap
  26. # package versions
  27. %define V_base 5.4
  28. %define V_patch0 20040110
  29. %define V_patch1 20040207
  30. %define V_patchL %{V_patch1}
  31. %define V_patches 1
  32. # package information
  33. Name: ncurses
  34. Summary: Terminal Capability and Display Library
  35. URL: http://www.gnu.org/software/ncurses/
  36. Vendor: Free Software Foundation
  37. Packager: The OpenPKG Project
  38. Distribution: OpenPKG
  39. Class: BASE
  40. Group: Terminal
  41. License: GPL
  42. # Version: %{V_base}.%{V_patchL}
  43. Version: %{V_base}
  44. Release: 20040212
  45. # list of sources
  46. Source0: ftp://invisible-island.net/ncurses/ncurses-%{V_base}.tar.gz
  47. # Patch0: ftp://invisible-island.net/ncurses/%{V_base}/patch-%{V_base}-%{V_patch0}.sh
  48. # Patch1: ftp://invisible-island.net/ncurses/%{V_base}/ncurses-%{V_base}-%{V_patch1}.patch.gz
  49. Patch100: ncurses.patch
  50. # build information
  51. Prefix: %{l_prefix}
  52. BuildRoot: %{l_buildroot}
  53. BuildPreReq: OpenPKG, openpkg >= 20040130, sharutils
  54. PreReq: OpenPKG, openpkg >= 20040130
  55. AutoReq: no
  56. AutoReqProv: no
  57. %description
  58. NCurses is the GNU re-implementation of the popular Curses
  59. terminal screen handling library.
  60. %track
  61. prog ncurses = {
  62. version = %{V_base}
  63. url = ftp://invisible-island.net/ncurses/
  64. regex = ncurses-(__VER__)\.tar\.gz
  65. }
  66. prog ncurses:patchbase = {
  67. version = %{V_patch0}
  68. url = ftp://invisible-island.net/ncurses/
  69. regex = (\d+\.\d+)
  70. url = ftp://invisible-island.net/ncurses/__NEWVER__/
  71. regex = patch-__NEWVER__-(\d+)\.sh(\.gz)?
  72. }
  73. prog ncurses:patchset = {
  74. version = %{V_patchL}
  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\.gz
  79. }
  80. %prep
  81. %setup -q -n ncurses-%{V_base}
  82. %if 0
  83. ( cat %{PATCH0} >patchbase.sh
  84. %{l_shtool} subst \
  85. -e 's;gzip -dc;%{l_gzip} -dc;' \
  86. -e 's;patch -p1;%{l_patch} -p1;' \
  87. patchbase.sh
  88. sh patchbase.sh
  89. ) || exit $?
  90. for patchfile in \
  91. %{expand:%(i=1; while [ $i -le %{V_patches} ]; do %{l_shtool} echo -n " %%{PATCH$i}"; i=`expr $i + 1`; done)}
  92. do
  93. %{l_gzip} -d -c $patchfile | %{l_patch} -p1 || true
  94. done
  95. %endif
  96. %patch -p0 -P 100
  97. %build
  98. CC="%{l_cc}" \
  99. CFLAGS="%{l_cflags}" \
  100. ./configure \
  101. --prefix=%{l_prefix} \
  102. --includedir=%{l_prefix}/include/ncurses \
  103. --datadir=%{l_prefix}/share/ncurses \
  104. --enable-hashmap \
  105. --enable-safe-sprintf \
  106. --without-debug \
  107. --with-manpage-format=normal \
  108. --disable-getcap-cache \
  109. --without-cxx-binding \
  110. --without-cxx \
  111. --enable-termcap \
  112. --disable-overwrite
  113. %{l_make} %{l_mflags}
  114. %install
  115. rm -rf $RPM_BUILD_ROOT
  116. %{l_shtool} subst -e "s;ln -s;ln;g" man/edit_man.sh
  117. %{l_make} %{l_mflags} install DESTDIR=$RPM_BUILD_ROOT
  118. ( cd $RPM_BUILD_ROOT%{l_prefix}/man
  119. for dir in man1 man3; do
  120. cd $dir
  121. for file in *.[13][a-z]*; do
  122. if [ ".$file" = ".*.[13][a-z]*" ]; then
  123. break
  124. fi
  125. eval `echo "$file" | sed -e 's;^\(.*\.[13]\)[a-z]*$;base=\1;'`
  126. mv $file ncurses_$base
  127. done
  128. cd ..
  129. done
  130. ) || exit $?
  131. strip $RPM_BUILD_ROOT%{l_prefix}/bin/* 2>/dev/null || true
  132. %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT %{l_files_std}
  133. %files -f files
  134. %clean
  135. rm -rf $RPM_BUILD_ROOT