2 Summary: Ncurses support utilities
7 URL: http://invisible-island.net/ncurses/ncurses.html
8 Source0: http://ftp.gnu.org/pub/gnu/ncurses/ncurses-%{version}.tar.gz
9 Source101: ncurses-rpmlintrc
10 Source1001: packaging/ncurses.manifest
11 Patch0: 01-use-d-reentrant.patch
12 Patch1: 02-debian-backspace.patch
13 Patch2: 03-linux-use-fsuid.patch
14 Patch3: 05-emdebian-wchar.patch
15 Patch4: 06-kfreebsd.patch
16 Patch5: 08-pkg-config-libdir.patch
17 BuildRequires: pkgconfig
20 The curses library routines are a terminal-independent method of
21 updating character screens with reasonable optimization. The ncurses
22 (new curses) library is a freely distributable replacement for the
23 discontinued 4.4 BSD classic curses library.
25 This package contains support utilities, including a terminfo compiler
26 tic, a decompiler infocmp, clear, tput, tset, and a termcap conversion
31 %package -n ncurses-libs
32 Summary: Ncurses libraries
33 Group: System/Libraries
34 Requires: %{name} = %{version}-%{release}
35 Requires: ncurses-base = %{version}-%{release}
36 Requires(post): /sbin/ldconfig
37 Requires(postun): /sbin/ldconfig
39 %description -n ncurses-libs
40 The curses library routines are a terminal-independent method of
41 updating character screens with reasonable optimization. The ncurses
42 (new curses) library is a freely distributable replacement for the
43 discontinued 4.4 BSD classic curses library.
45 This package contains the ncurses libraries.
49 Summary: Terminal descriptions
51 Requires: %{name} = %{version}-%{release}
52 Requires: ncurses-base = %{version}-%{release}
55 This package contains additional terminal descriptions not found in
56 the ncurses-base package.
60 Summary: Descriptions of common terminals
62 Requires: %{name} = %{version}-%{release}
63 Conflicts: ncurses < 5.6-13
66 This package contains descriptions of common terminals. Other terminal
67 descriptions are included in the ncurses-term package.
70 %package -n ncurses-devel
71 Summary: Development files for the ncurses library
72 Group: Development/Libraries
73 Requires: %{name} = %{version}-%{release}
74 Requires: ncurses-libs = %{version}-%{release}
76 %description -n ncurses-devel
77 The header files and libraries for developing applications that use
78 the ncurses terminal handling library.
80 Install the ncurses-devel package if you want to develop applications
81 which will use ncurses.
86 %setup -q -n %{name}-%{version}
101 %define rootdatadir /lib
102 export PKG_CONFIG_LIBDIR=%{_libdir}/pkgconfig
104 %configure --prefix=/usr \
106 --mandir=/usr/share/man \
107 --without-profile --without-debug \
108 --disable-rpath --enable-echo \
114 --with-chtype='long' \
115 --with-mmask-t='long' \
117 --with-default-terminfo-dir=/usr/share/terminfo \
118 --with-terminfo-dirs="/etc/terminfo:/lib/terminfo:/usr/share/terminfo" \
121 make %{?_smp_mflags} libs
122 make %{?_smp_mflags} -C progs
128 make DESTDIR=$RPM_BUILD_ROOT install.{libs,progs,data}
130 chmod 755 ${RPM_BUILD_ROOT}%{_libdir}/lib*.so.*.*
132 # move lib{ncurses{,w},tinfo}.so.* to /lib*
133 #mkdir $RPM_BUILD_ROOT/%{_lib}
134 #mv $RPM_BUILD_ROOT%{_libdir}/lib{ncurses{,w},tinfo}.so.* $RPM_BUILD_ROOT/%{_lib}
135 #for l in $RPM_BUILD_ROOT%{_libdir}/lib{ncurses{,w},tinfo}.so; do
136 #ln -sf $(echo %{_libdir} | \
137 #sed 's,\(^/\|\)[^/][^/]*,..,g')/%{_lib}/$(readlink $l) $l
140 mkdir -p $RPM_BUILD_ROOT{%{rootdatadir},%{_sysconfdir}}/terminfo
142 # move few basic terminfo entries to /lib
145 ansi dumb linux vt100 vt100-nav vt102 vt220 vt52
147 for t in $(find $RPM_BUILD_ROOT%{_datadir}/terminfo \
148 -samefile $RPM_BUILD_ROOT%{_datadir}/terminfo/${termname::1}/$termname)
150 baseterms="$baseterms $(basename $t)"
153 for termname in $baseterms; do
154 termpath=terminfo/${termname::1}/$termname
155 mkdir $RPM_BUILD_ROOT%{rootdatadir}/terminfo/${termname::1} &> /dev/null || :
156 mv $RPM_BUILD_ROOT%{_datadir}/$termpath $RPM_BUILD_ROOT%{rootdatadir}/$termpath
157 ln -s $(dirname %{_datadir}/$termpath | \
158 sed 's,\(^/\|\)[^/][^/]*,..,g')%{rootdatadir}/$termpath \
159 $RPM_BUILD_ROOT%{_datadir}/$termpath
162 # prepare -base and -term file lists
164 Eterm\* aterm cons25 cygwin eterm\* gnome gnome-256color hurd jfbterm \
165 konsole konsole-256color mach\* mlterm mrxvt nsterm putty\* pcansi \
166 rxvt rxvt-\* screen screen-\* screen.\* sun teraterm teraterm2.3 \
167 wsvt25\* xfce xterm xterm-\*
169 for i in $RPM_BUILD_ROOT%{_datadir}/terminfo/?/$termname; do
170 for t in $(find $RPM_BUILD_ROOT%{_datadir}/terminfo -samefile $i); do
171 baseterms="$baseterms $(basename $t)"
175 for t in $baseterms; do
176 echo "%dir %{_datadir}/terminfo/${t::1}"
177 echo %{_datadir}/terminfo/${t::1}/$t
178 done 2> /dev/null | sort -u > terms.base
179 find $RPM_BUILD_ROOT%{_datadir}/terminfo \! -type d | \
180 sed "s|^$RPM_BUILD_ROOT||" | while read t
182 echo "%dir $(dirname $t)"
184 done 2> /dev/null | sort -u | comm -2 -3 - terms.base > terms.term
186 # can't replace directory with symlink (rpm bug), symlink all headers
187 mkdir $RPM_BUILD_ROOT%{_includedir}/ncurses{,w}
188 for l in $RPM_BUILD_ROOT%{_includedir}/*.h; do
189 ln -s ../$(basename $l) $RPM_BUILD_ROOT%{_includedir}/ncurses
190 ln -s ../$(basename $l) $RPM_BUILD_ROOT%{_includedir}/ncursesw
193 rm -f $RPM_BUILD_ROOT%{_libdir}/libcurses{,w}.so
194 echo "INPUT(-lncurses)" > $RPM_BUILD_ROOT%{_libdir}/libcurses.so
195 echo "INPUT(-lncursesw)" > $RPM_BUILD_ROOT%{_libdir}/libcursesw.so
197 echo "INPUT(-ltinfo)" > $RPM_BUILD_ROOT%{_libdir}/libtermcap.so
199 rm -f $RPM_BUILD_ROOT%{_libdir}/terminfo
200 rm -f $RPM_BUILD_ROOT%{_libdir}/pkgconfig/{*_g,ncurses++*}.pc
202 rm -f $RPM_BUILD_ROOT%{_libdir}/*.a
205 %post -n ncurses-libs -p /sbin/ldconfig
207 %postun -n ncurses-libs -p /sbin/ldconfig
210 %manifest ncurses.manifest
214 %files -n ncurses-libs
215 %manifest ncurses.manifest
218 %files term -f terms.term
219 %manifest ncurses.manifest
221 %files base -f terms.base
222 %manifest ncurses.manifest
223 %dir %{_sysconfdir}/terminfo
224 %{rootdatadir}/terminfo
226 %dir %{_datadir}/terminfo
228 %files -n ncurses-devel
229 %manifest ncurses.manifest
230 %{_bindir}/ncurses*-config
232 %{_libdir}/pkgconfig/*.pc
233 %dir %{_includedir}/ncurses
234 %dir %{_includedir}/ncursesw
235 %{_includedir}/ncurses/*.h
236 %{_includedir}/ncursesw/*.h