1 |
%define major 5 |
2 |
%define majorminor 5.9 |
3 |
%define utf8libname %mklibname %{name}w %{major} |
4 |
%define libname %mklibname %{name} %{major} |
5 |
%define develname %mklibname -d %{name} |
6 |
%define utf8develname %mklibname -d %{name}w |
7 |
|
8 |
Summary: A CRT screen handling and optimization package |
9 |
Name: ncurses |
10 |
Version: 5.9 |
11 |
%define subrel 1 |
12 |
Release: %mkrel 21 |
13 |
License: MIT |
14 |
Group: System/Libraries |
15 |
Url: http://www.gnu.org/software/ncurses/ncurses.html |
16 |
Source0: ftp://ftp.gnu.org/gnu/ncurses/%{name}-%{version}.tar.gz |
17 |
Source4: ncurses-resetall.sh |
18 |
Source5: ncurses-usefull-terms |
19 |
Patch1: ncurses-5.9-20140308-patch.sh.bz2 |
20 |
Patch2: ncurses-5.9-20140315-20140323.patch.xz |
21 |
Patch7: ncurses-5.6-xterm-debian.patch |
22 |
Patch8: ncurses-5.9-bsc1046853_1046858.patch |
23 |
#to support rxvt-unicode 256 colors (bug 6835) |
24 |
Patch11: ncurses-5.9-urxvt.patch |
25 |
BuildRequires: gpm-devel |
26 |
BuildRequires: sharutils |
27 |
Conflicts: %{name}-extraterms < 5.6-1.20070721.1 |
28 |
Obsoletes: termcap <= 11.0.1-21.mga3 |
29 |
Provides: termcap = %{version}-%{release} |
30 |
|
31 |
%description |
32 |
The curses library routines are a terminal-independent method of updating |
33 |
character screens with reasonalble optimization. The ncurses (new curses) |
34 |
library is a freely distributable replacement for the discontinued 4.4BSD |
35 |
classic curses library. |
36 |
|
37 |
%package -n %{libname} |
38 |
Summary: The development files for applications which use ncurses |
39 |
Group: System/Libraries |
40 |
Requires(pre): filesystem >= 2.1.9-18 |
41 |
Requires: ncurses = %{version}-%{release} |
42 |
|
43 |
%description -n %{libname} |
44 |
The curses library routines are a terminal-independent method of updating |
45 |
character screens with reasonalble optimization. The ncurses (new curses) |
46 |
library is a freely distributable replacement for the discontinued 4.4BSD |
47 |
classic curses library. |
48 |
|
49 |
%package -n %{utf8libname} |
50 |
Summary: Ncurses libraries which support UTF8 |
51 |
Group: System/Libraries |
52 |
Requires(pre): filesystem >= 2.1.9-18 |
53 |
Requires: ncurses = %{version}-%{release} |
54 |
|
55 |
%description -n %{utf8libname} |
56 |
The curses library routines are a terminal-independent method of updating |
57 |
character screens with reasonalble optimization. The ncurses (new curses) |
58 |
library is a freely distributable replacement for the discontinued 4.4BSD |
59 |
classic curses library. |
60 |
|
61 |
This package contains ncurses libraries which support wide char (UTF8), |
62 |
and is not compatible with those without. |
63 |
|
64 |
%package extraterms |
65 |
Summary: Some exotic terminal descriptions |
66 |
Group: System/Libraries |
67 |
Requires: ncurses = %{version}-%{release} |
68 |
|
69 |
%description extraterms |
70 |
Install the ncurses-extraterms package if you use some exotic terminals. |
71 |
|
72 |
%package -n %{develname} |
73 |
Summary: The development files for applications which use ncurses |
74 |
Group: Development/C |
75 |
Requires(pre): filesystem >= 2.1.9-18 |
76 |
Requires: %{libname} = %{version}-%{release} |
77 |
Provides: lib%{name}-devel = %{version}-%{release} |
78 |
Provides: %{name}-devel = %{version}-%{release} |
79 |
Obsoletes: %mklibname -d %name 5 |
80 |
Obsoletes: %{mklibname -d termcap} <= 2.0.8-53.mga3 |
81 |
Provides: %{mklibname -d termcap} = %{version}-%{release} |
82 |
Provides: termcap-devel = %{version}-%{release} |
83 |
# (cg) NB Manual replication of the automatically extracted requires here |
84 |
# because we replace the .so symlinks with files... |
85 |
%ifarch x86_64 |
86 |
Provides: libtermcap-devel = %{version}-%{release} |
87 |
Provides: devel(libncurses(64bit)) |
88 |
Provides: devel(libtermcap(64bit)) |
89 |
%else |
90 |
Provides: devel(libncurses) |
91 |
Provides: devel(libtermcap) |
92 |
%endif |
93 |
|
94 |
%description -n %{develname} |
95 |
The header files and libraries for developing applications that use |
96 |
the ncurses CRT screen handling and optimization package. |
97 |
|
98 |
Install the ncurses-devel package if you want to develop applications |
99 |
which will use ncurses. |
100 |
|
101 |
%package -n %{utf8develname} |
102 |
Summary: The development files for applications which use ncurses |
103 |
Group: Development/C |
104 |
Requires(pre): filesystem >= 2.1.9-18 |
105 |
Requires: %{develname} = %{version}-%{release} |
106 |
Requires: %{utf8libname} = %{version}-%{release} |
107 |
Provides: lib%{name}w-devel = %{version}-%{release} |
108 |
Provides: ncursesw-devel = %{version}-%{release} |
109 |
Obsoletes: %mklibname -d %{name}w 5 |
110 |
Conflicts: %{_lib}ncurses-devel < 5.7-3.20091128.2 |
111 |
# (cg) NB Manual replication of the automatically extracted requires here |
112 |
# because we replace the .so symlinks with files... |
113 |
%ifarch x86_64 |
114 |
Provides: devel(libncursesw(64bit)) |
115 |
%else |
116 |
Provides: devel(libncursesw) |
117 |
%endif |
118 |
|
119 |
%description -n %{utf8develname} |
120 |
The libraries for developing applications that use ncurses CRT screen |
121 |
handling and optimization package. Install it if you want to develop |
122 |
applications which will use ncurses. |
123 |
|
124 |
Note that the libraries included here supports wide char (UTF-8), |
125 |
and is not compatible with those without. When linking programs with |
126 |
these libraries, you will have to append a "w" to the library names, |
127 |
i.e. -lformw, -lmenuw, -lncursesw, -lpanelw. |
128 |
|
129 |
%prep |
130 |
%setup -q |
131 |
|
132 |
%patch1 -p1 |
133 |
%patch2 -p1 |
134 |
%patch8 -p0 |
135 |
%patch11 -p1 -b .urxvt |
136 |
|
137 |
# regenerating configure needs patched autoconf, so modify configure |
138 |
# directly |
139 |
%patch7 -p1 -b .deb |
140 |
|
141 |
find . -name "*.orig" | xargs rm -f |
142 |
# fix some permissions |
143 |
chmod 755 c++/edit_cfg.sh test/listused.sh test/configure test/tracemunch |
144 |
|
145 |
%build |
146 |
export PKG_CONFIG_LIBDIR=%{_libdir}/pkgconfig |
147 |
|
148 |
%global ncurses_options \\\ |
149 |
--without-libtool \\\ |
150 |
--with-shared \\\ |
151 |
--with-cxx-shared \\\ |
152 |
--with-normal \\\ |
153 |
--without-debug \\\ |
154 |
--enable-overwrite \\\ |
155 |
--without-profile \\\ |
156 |
--with-gpm \\\ |
157 |
--enable-getcap \\\ |
158 |
--enable-const \\\ |
159 |
--enable-hard-tabs \\\ |
160 |
--enable-hash-map \\\ |
161 |
--enable-no-padding \\\ |
162 |
--enable-sigwinch \\\ |
163 |
--without-ada \\\ |
164 |
--enable-xmc-glitch \\\ |
165 |
--enable-colorfgbg \\\ |
166 |
--enable-pc-files \\\ |
167 |
--with-pkg-config-libdir=%{_libdir}/pkgconfig \\\ |
168 |
--with-termlib=tinfo \\\ |
169 |
--with-chtype=long \\\ |
170 |
--with-ospeed=unsigned \\\ |
171 |
--with-xterm-kbs=DEL |
172 |
|
173 |
mkdir -p ncurses-normal |
174 |
pushd ncurses-normal |
175 |
CONFIGURE_TOP=.. |
176 |
%configure2_5x \ |
177 |
%{ncurses_options} \ |
178 |
--disable-widec \ |
179 |
--with-ticlib |
180 |
|
181 |
%make -j1 |
182 |
popd |
183 |
|
184 |
mkdir -p ncurses-utf8 |
185 |
pushd ncurses-utf8 |
186 |
CONFIGURE_TOP=.. |
187 |
%configure2_5x \ |
188 |
%{ncurses_options} \ |
189 |
--enable-widec \ |
190 |
--without-progs |
191 |
|
192 |
%make -j1 |
193 |
popd |
194 |
|
195 |
%install |
196 |
make -C ncurses-normal DESTDIR=%{buildroot} install.{libs,progs,data} |
197 |
rm -f %{buildroot}%{_libdir}/libtinfo.* |
198 |
make -C ncurses-utf8 DESTDIR=%{buildroot} install.{libs,includes,man} |
199 |
|
200 |
ln -sf ../l/linux %{buildroot}%{_datadir}/terminfo/c/console |
201 |
|
202 |
# the resetall script |
203 |
install -m 755 %{SOURCE4} %{buildroot}%{_bindir}/resetall |
204 |
# we don't want this in doc |
205 |
rm -f c++/demo |
206 |
|
207 |
# |
208 |
# FIXME |
209 |
# OK do not time to debbug it now |
210 |
# |
211 |
cp %{buildroot}%{_datadir}/terminfo/x/xterm %{buildroot}%{_datadir}/terminfo/x/xterm2 |
212 |
cp %{buildroot}%{_datadir}/terminfo/x/xterm-new %{buildroot}%{_datadir}/terminfo/x/xterm |
213 |
|
214 |
|
215 |
# We used to ship header files in ncurses subfolders, so replicate that structure |
216 |
# Can't replace directory with symlink (rpm bug), so symlink all headers instead |
217 |
mkdir -p %{buildroot}%{_includedir}/ncurses{,w} |
218 |
for l in %{buildroot}%{_includedir}/*.h; do |
219 |
ln -s ../$(basename $l) %{buildroot}%{_includedir}/ncurses |
220 |
ln -s ../$(basename $l) %{buildroot}%{_includedir}/ncursesw |
221 |
done |
222 |
|
223 |
# |
224 |
# remove unneeded/unwanted files |
225 |
# have to be done before find commands below |
226 |
# |
227 |
rm -f %{buildroot}%{_libdir}/terminfo |
228 |
|
229 |
# fwang: avoid conflict with kon package |
230 |
rm -f %{buildroot}%{_datadir}/terminfo/k/kon |
231 |
|
232 |
# as libtinfo is now build as a separate library, some symbols used to be in |
233 |
# libncurses are now in libtinfo => drop private req and expose tinfo to linker |
234 |
sed -i -e 's,Requires.private,Requires,g' %{buildroot}%{_libdir}/pkgconfig/ncurses*.pc |
235 |
|
236 |
# |
237 |
# FIXME |
238 |
# |
239 |
(cd %{buildroot} ; find usr/share/terminfo -type d | perl -pe 's||%%dir /|') > %{name}.list |
240 |
(cd %{buildroot} ; find usr/share/terminfo -not -type d | perl -pe 's||/|') > %{name}-extraterms.list |
241 |
perl -pe 's||%{_datadir}/terminfo/|' %{SOURCE5} >> %{name}.list |
242 |
|
243 |
perl -ni -e 'BEGIN { open F, "%{name}.list"; /^%/ or $s{$_} = 1 foreach <F>; } print unless $s{$_}' %{name}-extraterms.list |
244 |
|
245 |
%multiarch_includes %{buildroot}%{_includedir}/curses.h |
246 |
|
247 |
# Don't require -ltinfo when linking with --no-add-needed |
248 |
# This requires us to manually add the devel() provides that would normally |
249 |
# be automatic but it's likely the lesser of two evils |
250 |
for l in %{buildroot}%{_libdir}/libncurses{,w}.so; do |
251 |
soname=$(basename $(readlink $l)) |
252 |
rm -f $l |
253 |
echo "INPUT($soname -ltinfo)" > $l |
254 |
done |
255 |
|
256 |
rm -f %{buildroot}%{_libdir}/libcurses{,w}.so |
257 |
echo "INPUT(-lncurses)" > %{buildroot}%{_libdir}/libcurses.so |
258 |
echo "INPUT(-lncursesw)" > %{buildroot}%{_libdir}/libcursesw.so |
259 |
|
260 |
echo "INPUT(-ltinfo)" > %{buildroot}%{_libdir}/libtermcap.so |
261 |
|
262 |
%files -f %{name}.list |
263 |
%doc README ANNOUNCE |
264 |
%{_datadir}/tabset |
265 |
%{_bindir}/* |
266 |
%{_mandir}/man1/* |
267 |
%{_mandir}/man5/* |
268 |
%{_mandir}/man7/* |
269 |
|
270 |
%files -n %{libname} |
271 |
%{_libdir}/libform.so.* |
272 |
%{_libdir}/libmenu.so.* |
273 |
%{_libdir}/libncurses.so.* |
274 |
%{_libdir}/libncurses++.so.* |
275 |
%{_libdir}/libpanel.so.* |
276 |
%{_libdir}/libtic.so.* |
277 |
%{_libdir}/libtinfo.so.* |
278 |
|
279 |
%files -n %{utf8libname} |
280 |
%{_libdir}/lib*w.so.* |
281 |
|
282 |
%files extraterms -f %{name}-extraterms.list |
283 |
%doc README |
284 |
|
285 |
%files -n %{develname} |
286 |
%doc doc c++ test |
287 |
%{_libdir}/libcurses.a |
288 |
%{_libdir}/libcurses.so |
289 |
%{_libdir}/libform.a |
290 |
%{_libdir}/libform.so |
291 |
%{_libdir}/libmenu.a |
292 |
%{_libdir}/libmenu.so |
293 |
%{_libdir}/libncurses++.a |
294 |
%{_libdir}/libncurses++.so |
295 |
%{_libdir}/libncurses.a |
296 |
%{_libdir}/libncurses.so |
297 |
%{_libdir}/libpanel.a |
298 |
%{_libdir}/libpanel.so |
299 |
%{_libdir}/libtermcap.so |
300 |
%{_libdir}/libtic.a |
301 |
%{_libdir}/libtic.so |
302 |
%{_libdir}/libtinfo.a |
303 |
%{_libdir}/libtinfo.so |
304 |
%{_libdir}/pkgconfig/form.pc |
305 |
%{_libdir}/pkgconfig/menu.pc |
306 |
%{_libdir}/pkgconfig/ncurses++.pc |
307 |
%{_libdir}/pkgconfig/ncurses.pc |
308 |
%{_libdir}/pkgconfig/panel.pc |
309 |
%{_libdir}/pkgconfig/tic.pc |
310 |
%{_libdir}/pkgconfig/tinfo.pc |
311 |
%{_includedir}/*.h |
312 |
%{_includedir}/ncurses |
313 |
%multiarch %{multiarch_includedir}/curses.h |
314 |
%{_mandir}/man3/* |
315 |
|
316 |
%files -n %{utf8develname} |
317 |
%{_includedir}/ncursesw |
318 |
%{_libdir}/pkgconfig/*w.pc |
319 |
%{_libdir}/lib*w.so |
320 |
%{_libdir}/lib*w.a |