diff --git a/README.devel b/README.devel index 072faa9..699d8d3 100644 --- a/README.devel +++ b/README.devel @@ -5,63 +5,68 @@ There are several Ncurses Libraries which can be used for building with an terminal based application. The standard Ncurses Libraries is given with ABI 5.6 + /usr/include/ncurses/*.h /usr/lib/libncurses.so or /usr/lib64/libncurses.so /usr/lib/libform.so or /usr/lib64/libform.so /usr/lib/libmenu.so or /usr/lib64/libmenu.so /usr/lib/libpanel.so or /usr/lib64/libpanel.so -and its header are installed in /usr/include/ e.g. (n)curses.h. -Nothing has to be added in the CFLAGS nor in the LDFLAGS. -Use the outout of +and its header are installed in /usr/include/ncurses/ e.g. +ncurses.h. For backward compatibility with simply older +programs the headers curses.h, ncurses.h, and term.h +will be also found in /usr/include/. Use the output of ncurses5-config --cflags for CFLAGS ncurses5-config --libs for LDFLAGS +to extend the CFLAGS and the LDFLAGS. For a version with wide character support please use the libraries with old ABI 5.6 + /usr/include/ncursesw/*.h /usr/lib/libncursesw.so or /usr/lib64/libncursesw.so /usr/lib/libformw.so or /usr/lib64/libformw.so /usr/lib/libmenuw.so or /usr/lib64/libmenuw.so /usr/lib/libpanelw.so or /usr/lib64/libpanelw.so -together with the header files found at /usr/include/ncursesw/. -This can be done with `-I/usr/include/ncursesw' within the -CFLAGS and e.g. `-lncursesw' in the LDFLAGS. -Use the outout of +Use the output of ncursesw5-config --cflags for CFLAGS ncursesw5-config --libs for LDFLAGS -For a thread safe version (also known as `reentrant' please +to extend the CFLAGS and the LDFLAGS. +For a thread safe version (also known as `reentrant') please use the libraries with ABI 6.0 + /usr/include/ncurses6/ncurses/*.h /usr/lib/ncurses6/libncurses.so or /usr/lib64/ncurses6/libncurses.so /usr/lib/ncurses6/libform.so or /usr/lib64/ncurses6/libform.so /usr/lib/ncurses6/libmenu.so or /usr/lib64/ncurses6/libmenu.so /usr/lib/ncurses6/libpanel.so or /usr/lib64/ncurses6/libpanel.so -together with the header files found at /usr/include/ncursest/. -This can be done with `-I/usr/include/ncursest' within the -CFLAGS and e.g. `-lncursest' in the LDFLAGS. -Use the outout of +together with the header files found at /usr/include/ncurses6/ncurses/ +e.g. ncurses.h. For backward compatibility with simply older programs +the headers curses.h, ncurses.h, and term.h will be also found in +/usr/include/ncurses6/. Use the output of ncurses6-config --cflags for CFLAGS ncurses6-config --libs for LDFLAGS +to extend the CFLAGS and the LDFLAGS. For a version with both wide character support and thread safe please use the libraries with ABI 6.0 + /usr/include/ncurses6/ncursesw/*.h /usr/lib/ncurses6/libncursesw.so or /usr/lib64/ncurses6/libncursesw.so /usr/lib/ncurses6/libformw.so or /usr/lib64/ncurses6/libformw.so /usr/lib/ncurses6/libmenuw.so or /usr/lib64/ncurses6/libmenuw.so - /usr/lib/ncurses6/libpanetw.so or /usr/lib64/ncurses6/libpanelw.so + /usr/lib/ncurses6/libpanelw.so or /usr/lib64/ncurses6/libpanelw.so -together with the header files found at /usr/include/ncursestw/. -This can be done with `-I/usr/include/ncursestw' within the -CFLAGS and e.g. `-lncursestw' in the LDFLAGS. -Use the outout of +Use the output of ncursesw6-config --cflags for CFLAGS ncursesw6-config --libs for LDFLAGS +to extend the CFLAGS and the LDFLAGS. It should be noted that the ABI 6.0 +is not only thread safe but also includes extended mouse support and in +case of the wide character version also extended color support. diff --git a/baselibs.conf b/baselibs.conf index 65fdf73..c948836 100644 --- a/baselibs.conf +++ b/baselibs.conf @@ -4,7 +4,7 @@ libncurses5 obsoletes "ncurses- <= " libncurses6 targettype x86 provides "baselibs-x86:/lib/libncurses.so.6" - provides "ncurses- = 6.0" + provides "libncurses6- = 6.0" ncurses-devel requires -ncurses- requires "libncurses5- = " diff --git a/edit.sed b/edit.sed new file mode 100644 index 0000000..42f1e41 --- /dev/null +++ b/edit.sed @@ -0,0 +1,38 @@ +#!/bin/sh + +while test "${1::2}" = "--" ; do + case "$1" in + --cflags=*) + cflags="${1#*=}" + shift + ;; + --cflags) + cflags="$2" + shift 2 + ;; + --libs=*) + libs="${1#*=}" + shift + ;; + --libs) + libs="$2" + shift 2 + ;; + esac +done + +sed -ri -e " +/^[[:blank:]]*--cflags\)/,/;;/ { + /;;/ a\\ + --cflags)\\ + echo $cflags\\ + ;; + d +} +/^[[:blank:]]*--libs\)/,/;;/ { + /;;/ a\\ + --libs)\\ + echo $libs\\ + ;; + d +}" ${1+"$@"} diff --git a/ncurses.changes b/ncurses.changes index 7400791..1653662 100644 --- a/ncurses.changes +++ b/ncurses.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Mon Aug 18 16:17:24 CEST 2008 - werner@suse.de + +- Use include directories more restrictive that is + * /usr/include/ncurses/*.h for standard version + * /usr/include/ncursesw/*.h for wide version + * /usr/include/ncurses6/ncurses/*.h for ABI 6.0 standard version + * /usr/include/ncurses6/ncursesw/*.h for ABI 6.0 wide version +- Make thread support using weak symbols that is be thread safe + only for applications using the libpthread. + ------------------------------------------------------------------- Thu Aug 14 17:26:53 CEST 2008 - werner@suse.de diff --git a/ncurses.spec b/ncurses.spec index 4b3f0b5..208be7b 100644 --- a/ncurses.spec +++ b/ncurses.spec @@ -27,7 +27,7 @@ License: X11/MIT Group: System/Base AutoReqProv: on Version: 5.6 -Release: 85 +Release: 86 Summary: New curses Libraries Url: http://invisible-island.net/ncurses/ncurses.html Source0: ncurses-5.6.tar.bz2 @@ -36,6 +36,7 @@ Source2: handle.linux Source3: README.devel Source4: ncurses-rpmlintrc Source5: tack-1.06.tar.bz2 +Source6: edit.sed Patch0: ncurses-%{version}.dif Patch1: ncurses-5.3-printw.dif Patch2: ncurses-5.6-pthread.dif @@ -280,6 +281,12 @@ ln -sf tack-* tack fi rm -f ./test64 # + # For security of some configure and install scripts + # + TMPDIR=$(mktemp -d /tmp/ncurses.XXXXXXXX) || exit 1 + trap 'rm -rf ${TMPDIR}' EXIT + export TMPDIR + # # No --enable-tcap-names because we may have to recompile # programs or foreign programs won't work # @@ -370,7 +377,11 @@ ln -sf tack-* tack # Now rebuild libncurses and do the rest of this job # make - make install DESTDIR=%{root} includedir=%{_incdir} + lib=%{_libdir} + inc=%{_incdir}/ncurses + make install DESTDIR=%{root} includedir=${inc} libdir=${lib} + ln -sf ${inc##*/}/{curses,ncurses,term}.h %{root}${inc%%/*}/ + sh %{S:6} --cflags "-I${inc}" --libs "-lncurses" %{root}%{_bindir}/ncurses5-config # # Check for tack program on base of above ncurses # @@ -387,18 +398,12 @@ ln -sf tack-* tack # Now use --with-pthread for reentrant pthread support (abi > 5). # eval ./${c#*./} --with-pthread --enable-ext-mouse --disable-widec --disable-ext-colors --without-progs - inc=%{_incdir}/ncurses6 + make lib=%{_libdir}/ncurses6 - make && make install.libs install.includes DESTDIR=%{root} includedir=${inc} libdir=${lib} - for h in %{root}${inc}/*.h ; do - test -e "$h" || continue - h=${h##*/} - for t in %{root}${inc}/*.h ; do - test -e "$t" || continue - test ! -L $t || continue - sed -ri "s;(#include[[:blank:]]+<)(${h}>);\1${inc##*/}/\2;" $t - done - done + inc=%{_incdir}/ncurses6/ncurses + make install.libs install.includes DESTDIR=%{root} includedir=${inc} libdir=${lib} + ln -sf ${inc##*/}/{curses,ncurses,term}.h %{root}${inc%%/*}/ + sh %{S:6} --cflags "-I${inc%%/*} -I${inc}" --libs "-L${lib} -lncurses" %{root}%{_bindir}/ncurses6-config %endif # # Now use --enable-widec for UTF8/wide character support. @@ -410,33 +415,21 @@ ln -sf tack-* tack %else eval ./${c#*./} --disable-ext-mouse --enable-widec --disable-ext-colors --without-progs %endif - make && make install.libs install.includes DESTDIR=%{root} includedir=%{_incdir}/ncursesw - for h in %{root}%{_incdir}/ncursesw/*.h ; do - test -e "$h" || continue - h=${h##*/} - for t in %{root}%{_incdir}/ncursesw/*.h ; do - test -e "$t" || continue - test ! -L $t || continue - sed -ri "s;(#include[[:blank:]]+<)(${h}>);\1ncursesw/\2;" $t - done - done + make + lib=%{_libdir} + inc=%{_incdir}/ncursesw + make install.libs install.includes DESTDIR=%{root} includedir=${inc} libdir=${lib} + sh %{S:6} --cflags "-I${inc}" --libs "-lncursesw" %{root}%{_bindir}/ncursesw5-config %if %abi < 6 # # Do both --enable-widec and --with-pthread (abi > 5). # eval ./${c#*./} --with-pthread --enable-ext-mouse --enable-widec --enable-ext-colors --without-progs - inc=%{_incdir}/ncursesw6 + make lib=%{_libdir}/ncurses6 - make && make install.libs install.includes DESTDIR=%{root} includedir=${inc} libdir=${lib} - for h in %{root}${inc}/*.h ; do - test -e "$h" || continue - h=${h##*/} - for t in %{root}${inc}/*.h ; do - test -e "$t" || continue - test ! -L $t || continue - sed -ri "s;(#include[[:blank:]]+<)(${h}>);\1${inc##*/}/\2;" $t - done - done + inc=%{_incdir}/ncurses6/ncursesw + make install.libs install.includes DESTDIR=%{root} includedir=${inc} libdir=${lib} + sh %{S:6} --cflags "-I${inc%%/*} -I${inc}" --libs "-L${lib} -lncursesw" %{root}%{_bindir}/ncursesw6-config %endif %install @@ -457,7 +450,7 @@ ln -sf tack-* tack done chmod 0755 %{buildroot}/%{_lib}/lib*.so.* chmod 0755 %{buildroot}/%{_libdir}/lib*.so.* - chmod a-x %{buildroot}/%{_libdir}/lib*.a + chmod a-x %{buildroot}/%{_libdir}/lib*.a if test -d %{buildroot}%{_libdir}/ncurses6 ; then mv %{buildroot}%{_libdir}/ncurses6/*.so.6* %{buildroot}/%{_libdir}/ for lib in %{buildroot}%{_libdir}/ncurses6/*.so @@ -480,13 +473,7 @@ ln -sf tack-* tack done chmod 0755 %{buildroot}/%{_lib}/lib*.so.6* chmod 0755 %{buildroot}/%{_libdir}/lib*.so.6* - chmod a-x %{buildroot}/%{_libdir}/ncurses6/lib*.a - sed -ri -e 's|(THIS=).*|\1"ncurses6"|' \ - -e 's|(-L.*/lib)|\1/ncurses6|' \ - -e 's|-l\$\{THIS\}|-l\$\{THIS%%6\}|' %{buildroot}%{_bindir}/ncurses6-config - sed -ri -e 's|(THIS=).*|\1"ncursesw6"|' \ - -e 's|(-L.*/lib)|\1/ncurses6|' \ - -e 's|-l\$\{THIS\}|-l\$\{THIS%%6\}|' %{buildroot}%{_bindir}/ncursesw6-config + chmod a-x %{buildroot}/%{_libdir}/ncurses6/lib*.a fi test -n "%{buildroot}" || ldconfig -N mkdir -p %{buildroot}%{_defaultdocdir}/ncurses @@ -562,9 +549,7 @@ ln -sf tack-* tack grep -v -F -x -f default.list \ > extension.list rm -f %{buildroot}%{_prefix}/lib/terminfo - mkdir -p %{buildroot}%{_incdir}/ncurses - ln -sf ../ncurses.h %{buildroot}%{_incdir}/ncurses/ -%if %abi == 5 +%if %abi < 6 %post -n libncurses5 -p /sbin/ldconfig @@ -621,10 +606,12 @@ ln -sf tack-* tack %dir %{_incdir}/ncurses/ %dir %{_incdir}/ncursesw/ %dir %{_incdir}/ncurses6/ -%dir %{_incdir}/ncursesw6/ -%dir %{_libdir}/ncurses6/ +%dir %{_incdir}/ncurses6/ncurses/ +%dir %{_incdir}/ncurses6/ncursesw/ %{_incdir}/*.h %{_incdir}/ncurses*/*.h +%{_incdir}/ncurses*/*/*.h +%dir %{_libdir}/ncurses6/ %{_libdir}/lib*.a %{_libdir}/lib*.so %{_libdir}/ncurses6/lib*.a @@ -645,6 +632,14 @@ ln -sf tack-* tack %defattr(-,root,root) %changelog +* Mon Aug 18 2008 werner@suse.de +- Use include directories more restrictive that is + * /usr/include/ncurses/*.h for standard version + * /usr/include/ncursesw/*.h for wide version + * /usr/include/ncurses6/ncurses/*.h for ABI 6.0 standard version + * /usr/include/ncurses6/ncursesw/*.h for ABI 6.0 wide version +- Make thread support using weak symbols that is be thread safe + only for applications using the libpthread. * Thu Aug 14 2008 werner@suse.de - Update to test version 5.6.20080804 * fix memory leaks in test/demo_menus