commit 38211e4022360163270744bbc52a7d26ec4fded6 Author: zyppe <210hcl@gmail.com> Date: Wed Feb 28 21:44:25 2024 +0800 Initialize for newt diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6ac2674 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +newt-0.52.20.tar.gz diff --git a/.newt.metadata b/.newt.metadata new file mode 100644 index 0000000..fbc11f6 --- /dev/null +++ b/.newt.metadata @@ -0,0 +1 @@ +6cc49d3e9d280a1a2454fcba4ee920f440fa024d902097f97a6b8248e1ba14ee newt-0.52.20.tar.gz diff --git a/baselibs.conf b/baselibs.conf new file mode 100644 index 0000000..0906858 --- /dev/null +++ b/baselibs.conf @@ -0,0 +1 @@ +libnewt0_52 diff --git a/newt-rpmlintrc b/newt-rpmlintrc new file mode 100644 index 0000000..8e2ba8b --- /dev/null +++ b/newt-rpmlintrc @@ -0,0 +1,4 @@ +# newt-devel just needs the lib package +addFilter("no-dependency-on newt") +# newt-devel should require python-devel +addFilter("useless-explicit-requires python") diff --git a/newt.changes b/newt.changes new file mode 100644 index 0000000..bbdd9ce --- /dev/null +++ b/newt.changes @@ -0,0 +1,308 @@ +* Wed Jan 3 2018 tchvatal@suse.com +- Build without py2 if needed +- Fix upstream url +* Wed Nov 8 2017 mpluskal@suse.com +- Use current factory dependencies +- Always build python3 bindings +- Small cleanup with spec-clenaer +* Mon Oct 2 2017 jengelh@inai.de +- Rectify RPM groups. +* Sun Sep 24 2017 mc@suse.com +- build python3 subpackage +* Mon Jul 3 2017 lars@linux-schulserver.de +- update to 0.52.20: + + improve handling of long strings in whiptail menu (#1353792) + + support screen resize as hotkey in form (#1432926) + from 0.52.19: + + support --notags in whiptail checklist and radiolist (#1319794) + + don't hard-code -I/usr/include/slang in CPPFLAGS (Alex Suykov) + + use $(CC) instead of $(CPP) to generate .depend files (Samuel Martin) + + update translations from Zanata +* Sun Mar 1 2015 jengelh@inai.de +- Set RPM groups +* Sun Mar 1 2015 mpluskal@suse.com +- Cleanup spec file with spec-cleaner +- Use url for source +- Remove conditions dealing with unsupported releases of SLES +- Update to 0.52.18 + * fix widget key collision in snack on 64-bit archs (#1151455) + * handle NEWT_EXIT_ERROR in snack + * fix preprocessor warnings in snack + * optimize textbox reflowing + * remove newtListitem declarations (#1074092) +* Wed Nov 6 2013 lars@linux-schulserver.de +- update to 0.52.16 + + add newtComponentGetSize and newtComponentGetPosition + + modify Makefile to use SOEXT + + free gpm socket name and unlink gpm socket on form exit + + fix memory leaks in whiptail + + add missing whiptail options to help and man page + + fix errors found by gcc-with-cpychecker + + fix building with tcl8.6 + + add fallback to python-config + + replace tabs in snack.py + + compile snackmodule.c with flag -fPIC (Kang Kai) + + include new translations from transifex + + allow newtWinMenu and newtWinEntries with no buttons or items + + don't draw scale when not mapped + + build with large-file support for stat64 + + remove unused variables in test code + + update FSF address + + remove obsolete macros + + make some dependencies arch-specific +- removed upstream newt-0.52.14-incorrect-fsf-address.patch +* Tue Mar 5 2013 coolo@suse.com +- update license to new format +* Mon Jul 30 2012 werner@suse.de +- Use suse-version not sles-version +* Tue Jul 10 2012 werner@suse.de +- Make it build with latest TeXLive 2012 with new package layout +* Wed Feb 1 2012 lars@linux-schulserver.de +- update to 0.52.14: + + fix returning strings in whiptail and whiptcl (rh#752818) + + fix configure to work with multiple python versions (rh#737998) +- removed newt-0.52.13-python_version.patch : fixed upstream +- compile with fPIC - fixes problems with _snackmodule.so + thanks to Joerg Steffens (bnc#734171) +- newt-doc recommends the main package as the examples need it +- added newt-0.52.14-incorrect-fsf-address.patch +* Sun Jan 29 2012 jengelh@medozas.de +- Remove redundant tags/sections per specfile guideline suggestions +* Mon Aug 8 2011 lars@linux-schulserver.de +- update to 0.52.13: + + add support for changing colors in individual labels, scrollbars, entries, + textboxes and scales, add custom colorsets + + add support for NEWT_COLORS and NEWT_COLORS_FILE variables (rh#689903) + + allow resizing of form + + fix errors found by coverity + + fix va_list usage (Gwenole Beauchesne) + + fix building and installing on Mac OS X (rh#652479) + + check for slang.h header, support DESTDIR variable, add --without-python + option (Otavio Salvador) + + add Persian, Low German translations +- added newt-0.52.13-python_version.patch to fix detection of + python version in configure script +* Thu Mar 17 2011 chris@computersalat.de +- add comment to keep static lib +* Tue Mar 8 2011 chris@computersalat.de +- fix baselibs.conf + o newt > libnewt0_52 +- fix naming + o define libname libnewt + o define libsoname {libname}0_52 +- fix deps + o add pkg-config + o move {py_requires} to subpkg python-newt +- remove Author from description +* Fri Feb 4 2011 lars@linux-schulserver.de +- update to 0.52.12: + + fix whiptail --gauge and its description in man page (#620083) + + remove space after \n in whiptail texts (#620083) + + remove NLS code from snack (#599608) + + expose more keys to python as shortcuts in dialogs (Jakob Kemi) + + release python global-thread-lock during dialog displays (Jakob Kemi) + + fix warnings in whiptcl.c and include Tcl_PkgProvide() call (Mikhail T.) + + don't NULL deref when an invalid array is specified in checkboxtree + (Arnaldo Carvalho de Melo) +- build on older distributions by owning locale/as +* Mon Feb 1 2010 jengelh@medozas.de +- package baselibs.conf +* Sat Jan 9 2010 chris@computersalat.de +- update to 0.52.11 + * fix buffer overflow in textbox when reflowing (#523955, CVE-2009-2905) + * use full textbox width when reflowing and allow minimal width 1 + * fix writing lines longer than width in textbox + * don't use va_list in newtvwindow more than once (#523696) + * bind \E[Z to back-tab in built-in keymap (#468046) + * terminate string after reading file in whiptail + * add newtRadioSetCurrent function (Thomas Jarosch) + * add pkgconfig support (Thomas Jarosch) + * add Malay, Malayalam, Assamese, Gujarati, Bengali India, Kannada, Telugu + translations + * include tutorial in txt format + * include debian patches + - fix crash in textbox SetText when topLines != 0 + - don't link modules with libraries already linked with libnewt + - add Asturian and Marathi translations +- cleanup spec + * sorted TAGS + * macros __make, __install, ... + name -> {name} + version -> {version} + buildroot -> {buildroot} + _defaultdocdir -> {_defaultdocdir} + .... +- removed obsolete newt-CVE-2009-2905.patch +* Wed Sep 23 2009 lrupp@suse.de +- fix heap-based buffer overflow in function doReflow in textbox.c + (fix bnc#540930 and CVE-2009-2905 : newt-CVE-2009-2905.patch) +* Mon Sep 1 2008 lrupp@suse.de +- update to 0.52.10: + + added support for help + + added cusor on/off stuff +- rename newt-python to python-newt to follow the naming policy +* Thu Apr 10 2008 ro@suse.de +- added baselibs.conf file to build xxbit packages + for multilib support +* Mon Apr 7 2008 lrupp@suse.de +- update to 0.52.9: + + handle component destruction (patch by Richard W.M. Jones) + + fix newtWinEntry definition + + don't use uninitialized values in newtWinMenu + + remove workarounds for old bug in SLsmg_write_nstring + + improve SIGWINCH handling in form + + don't abort from whiptail gauge on SIGWINCH + + redisplay also last line + + update Polish translation + + enable slang utf8 mode (rh#425992) + + support --disable-nls option (patch by Natanael Copa) + + redraw screen when using entry in euc encodings +- removed upstreamed patches +- devel package should require poptd-, python- and slang-devel and + recommend the main package (not really needed) +- updated rpmlintrc +* Mon Dec 17 2007 lrupp@suse.de +- split libnewt0_52 to follow the shared library packaging policy +- build on older distributions +- build parallel +* Thu Oct 11 2007 lrupp@suse.de +- split python module to -python subpackage +- add back support for list of Entries in EntryWindow prompts in + snack (RH#248878) (newt-0.52.7-snack.patch) +- fix segfault in whiptail when no entry is selected in radiolist + (newt-0.52.7-whiptail.patch) +- fix handling of UTF-8 characters (#289291) + (newt-0.52.7-utf8.patch) +* Tue Sep 11 2007 cthiel@suse.de +- removed bogus Provides: snack (to avoid name clash with package snack) +* Tue Jun 26 2007 lrupp@suse.de +- update to 0.52.7: + + add support to snack for multiple selection and border in listbox + and cursorAtEnd in entry (patch by Shawn Starr) + + fix scrollbar positioning in listbox + + cope with backward system time jumps (RH#240691) + + free helplines and windows in newtFinished, check for overflow (RH#239992) +- remove included patches +- created doc package for tutorial (N#287087) +* Wed Jun 13 2007 lrupp@suse.de +- included patches from Miroslav Lichvar: + + fix cursor positioning when setting entry or checkbox flags + (newt-0.52.6-cursor.patch) + + fix counting of items in checkboxtree + (newt-0.52.6-countitems.patch) + + fix some memory leaks + (newt-0.52.6-memleaks.patch) + + fix entry scrolling (RH#234829) and + + fix multibyte character handling in entry + (newt-0.52.6-entry.patch) +- disable gpm-support - seems to smash the stack +- remove libbz2-1 from buildreq +- re-arange buildrequires +* Tue Jun 5 2007 ro@suse.de +- buildreq: libbz2 -> libbz2-1 +* Sun Apr 1 2007 lrupp@suse.de +- added distribution specfic parts for build service +- added libbz2 to BuildRequires for suse_version > 1020 +* Wed Mar 7 2007 lrupp@suse.de +- update to 0.52.6: + + add newtSetColor() to allow changing individual colors + + add newtPopWindowNoRefresh() (patch by Forest Bond) +- branched newt-static package containing static library +* Wed Feb 14 2007 lrupp@suse.de +- update to 0.52.5 + + provide option to change text of buttons (rh#126768) + + don't add escape key to hot keys by default (rh#216157) + + fix cursor position in checkboxtree, radio button and checkbox + + don't force monochrome terminals to output colors + + highlight active compact button on monochrome terminals + + update translations from debian +- removed unnecessary ldconfig call in devel package +- removed obsolete newt-0.52.4-if1close.patch +* Thu Dec 21 2006 lrupp@suse.de +- new upstream version 0.52.4: patches included upstream + + fix entry corruption when reading multibyte characters + and double width character handling + + avoid overflow/crash in scale +- makefile, configure and spec cleanup +- package whiptail.1 and locale files +* Fri Sep 22 2006 lrupp@suse.de +- fix build with python 2.5 (thanks to aj) +- useful fixes from RH bugzilla included: + * #137957 : fix screen corruption + * #81352 : fix help dialog + * #83203 : make textbox with scrollbar focusable + * #86074 : turn off cursor when entry terminated form + * #186053 : better handling of listbox and checkboxtree focus + * #187545 : be more color friendly to 8-color terminals + * #189981 : fix handling windows larger than screen size + * fix checkboxtree positioning + * unfocus when displaying help + * fix double width character handling in checkboxtree and listbox +* Tue May 9 2006 lrupp@suse.de +- add "Provides: snack" to specfile +- do not build whiptcl to avoid dependency on tcl (RH #177346) + (whiptcl is currently not used by anything) +- Apply patch by Bill Nottingham (thanks) to improve scrollbar appearance + (RH #174771) +- Fix a crash in checkboxtree.c (RH #165347) +- draw correct dialog sizes on the screen (see RH #185950) - applying + patch from Tomas Mraz (thanks) +* Wed Jan 25 2006 mls@suse.de +- converted neededforbuild to BuildRequires +* Mon Dec 12 2005 lrupp@suse.de +- new version 0.52.2 +- include whiptcl.so +* Thu Nov 10 2005 lrupp@suse.de +- only do gpmclose if gpmopen succeeed + (see https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=118530) +- include example files (peanuts.py, popcorn.py) in devel package +- use "-fPIC -Wall -fno-strict-aliasing" in CFLAGS +* Mon Sep 26 2005 mls@suse.de +- make devel package require base package +* Mon Jul 25 2005 lrupp@suse.de 0.51.6 +- use of %%run_ldconfig +* Fri Jun 17 2005 lrupp@suse.de 0.51.6 +- use more macros: fix build on 64bit +* Fri Jun 17 2005 lrupp@suse.de 0.51.6 +- use $RPM_OPT_FLAGS +- delete /usr/lib/phyton in build to avoid errors from abuild + => we've a symlink to /usr/lib/python2.4 +* Thu Jun 16 2005 ro@suse.de +- fix files pagaged twice (real path and over symlink) +* Tue Feb 15 2005 ro@suse.de +- added python deps +* Mon Jan 24 2005 ro@suse.de +- fix lib64 build +* Tue Nov 30 2004 cwh@suse.de +- updated to 0.51.6 +* Wed Jun 2 2004 ro@suse.de +- get rid of some compiler warnings +* Thu Feb 26 2004 hmacht@suse.de +- building as non-root +* Tue Feb 24 2004 cwh@suse.de +- added soname link to package +* Mon Sep 15 2003 cwh@suse.de +- removed wrong "Provides: snack" from spec-file +* Wed Aug 20 2003 ro@suse.de +- expand filelist +- fix lib64 issues +* Wed Aug 20 2003 cwh@suse.de +- fixed to compile with tcl8.4 +* Tue Jan 16 2001 schwab@suse.de +- Fix missing -fPIC in Makefile. +- Fix use of varargs. +* Wed Nov 29 2000 ro@suse.de +- changed neededforbuild to +* Wed Nov 29 2000 smid@suse.cz +- subpackage renamed: newtd => newt-devel +* Fri Nov 24 2000 ro@suse.de +- fixes for 2.0-python +* Sun Oct 29 2000 kukuk@suse.de +- Add python-devel to need for build +* Mon May 22 2000 smid@suse.cz +- fixed to compile with tcl8.3 +* Wed May 10 2000 nadvornik@suse.cz +- update to 0.50.8 +- added BuildRoot +* Mon Jan 17 2000 nashif@suse.de +- Initial Release ( Version 0.50) diff --git a/newt.spec b/newt.spec new file mode 100644 index 0000000..3a24f59 --- /dev/null +++ b/newt.spec @@ -0,0 +1,223 @@ +# +# spec file for package newt +# +# Copyright (c) 2022-2023 ZhuningOS +# + + +%define libname lib%{name} +%define libsoname %{libname}0_52 +%bcond_without python2 +Name: newt +Version: 0.52.20 +Release: 150000.7.2.3 +Summary: A library for text mode user interfaces +License: LGPL-2.1+ +Group: Development/Libraries/C and C++ +Url: https://pagure.io/newt +Source: https://fedorahosted.org/releases/n/e/newt/%{name}-%{version}.tar.gz +Source2: baselibs.conf +Source10: %{name}-rpmlintrc +# needed for tutorial.pdf +BuildRequires: docbook-toys +BuildRequires: pkgconfig +BuildRequires: popt-devel +BuildRequires: python3-devel +BuildRequires: slang-devel +BuildRequires: texlive-courier +BuildRequires: texlive-dvips +BuildRequires: texlive-ec +BuildRequires: texlive-helvetic +BuildRequires: texlive-jadetex +BuildRequires: texlive-times +%if %{with python2} +BuildRequires: python-devel +%endif + +%description +Newt is a programming library for color text-mode, widget-based user +interfaces. Newt can be used to add stacked windows, entry widgets, +checkboxes, radio buttons, labels, plain text fields, scrollbars, etc., +to text mode user interfaces. + +This package also contains a Dialog replacement called whiptail. Newt +is based on the slang library. + +%package -n %{libsoname} +Summary: Shared libraries for Nifty Erik's Windowing Toolkit +License: LGPL-2.1+ +Group: System/Libraries + +%description -n %{libsoname} +This package contains the shared libraries needed by programs built +with newt. + +Newt is a programming library for color text-mode widget-based user +interfaces. Newt can be used to add stacked windows, entry widgets, +check boxes, radio buttons, labels, plain text fields, scrollbars, +etc., to text mode user interfaces. + +%package devel +Summary: Development files for the Newt windowing toolkit +License: LGPL-2.1+ +Group: Development/Libraries/C and C++ +Requires: %{libsoname} = %{version} +Requires: popt-devel +Requires: python3-devel +Requires: slang-devel +Recommends: %{name} = %{version} + +%description devel +This package contains the header files and libraries necessary for +developing applications which use newt. + +Newt is a development library for text mode user interfaces. + +Install newt-devel if you want to develop applications which depend on +newt. + +%package doc +Summary: Tutorial for Nifty Erik's Windowing Toolkit +# the examples need the main package: +License: LGPL-2.1+ +Group: Documentation/Howto +Recommends: %{name} = %{version} +BuildArch: noarch + +%description doc +This package contains a tutorial about the Newt windowing toolkit. + +Newt is a programming library for color text-mode, widget-based user +interfaces. Newt can be used to add stacked windows, entry widgets, +check boxes, radio buttons, labels, plain text fields, scrollbars, +etc., to text mode user interfaces. Newt is based on the slang library. + +%package static +# Please keep the static package as this is requested by another +# vendor for his tool. It shouldn't be a problem to keep this +# special package. (lrupp) +Summary: Static libraries of Nifty Erik's Windowing Toolkit +License: LGPL-2.1+ +Group: Development/Libraries/C and C++ +Requires: %{name}-devel = %{version} + +%description static +This package contains the static libraries needed to compile programs +based on newt which don't need the shared libraries. Install it if you +need to link statically with %{libname}. + +Newt is a programming library for color text-mode widget-based user +interfaces. Newt can be used to add stacked windows, entry widgets, +check boxes, radio buttons, labels, plain text fields, scrollbars, +etc., to text mode user interfaces. + +%package -n python2-%{name} +Summary: Python bindings for newt +License: GPL-2.0 AND GPL-2.0+ AND LGPL-2.1+ +Group: Development/Languages/Python +Requires: %{name} = %{version} +Provides: python-%{name} = %{version} +Obsoletes: python-%{name} < %{version} +Provides: %{name}-python = %{version} +Obsoletes: %{name}-python < %{version} + +%description -n python2-%{name} +The python-newt package contains the Python bindings for the newt +library providing a python API for creating text mode interfaces. + +%package -n python3-%{name} +Summary: Python 3 bindings for newt +License: LGPL-2.1+ +Group: Development/Languages/Python +Requires: %{name} = %{version}-%{release} + +%description -n python3-%{name} +The python3-newt package contains the Python 3 bindings for the newt library +providing a python API for creating text mode interfaces. + +%prep +%setup -q + +%build +# gpm support seems to smash the stack +# --with-gpm-support +%configure --without-tcl +## make depend +make CPPFLAGS="%{optflags} -fPIC" %{?_smp_mflags} all +#docbook2txt tutorial.sgml +chmod 0644 peanuts.py popcorn.py + +%install +%if %{with python2} +pyversions="python%{py_ver}" +%else +pyversions="" +%endif +pyversions="$pyversions python%{py3_ver}" +make PYTHONVERS="$pyversions" instroot=%{buildroot} DESTDIR=%{buildroot} install install-sh +# currently we don't support these languages +for lang in ast bal sr@latin wo; do + rm -rf %{buildroot}%{_datadir}/locale/$lang +done + +# prepare defaultdocdir with examples and scripts +# +install -d -m 755 %{buildroot}%{_defaultdocdir}/%{name}/examples +# install COPYING file +install -m 644 COPYING %{buildroot}%{_defaultdocdir}/%{name}/ +# install example scripts +install -m 755 peanuts.py %{buildroot}%{_defaultdocdir}/%{name}/examples/ +install -m 755 popcorn.py %{buildroot}%{_defaultdocdir}/%{name}/examples/ +# +# create tutorial.pdf documentation +# +install -m 644 tutorial.sgml %{buildroot}%{_defaultdocdir}/%{name}/ +pushd %{buildroot}%{_defaultdocdir}/%{name}/ 1>/dev/null +db2pdf tutorial.sgml +rm tutorial.{aux,log,out} CATALOG.* *.dsl +popd 1>/dev/null +%find_lang %{name} + +%if %{with python2} +%py_compile %{buildroot}/%{python_sitearch} +%py_compile -O %{buildroot}/%{python_sitearch} +%endif +%py3_compile %{buildroot}/%{python3_sitearch} +%py3_compile -O %{buildroot}/%{python3_sitearch} +# pointless examples +rm %{buildroot}%{_defaultdocdir}/%{name}/examples/*.py + +%post -n %{libsoname} -p /sbin/ldconfig +%postun -n %{libsoname} -p /sbin/ldconfig + +%files -f %{name}.lang +%dir %{_defaultdocdir}/%{name} +%doc %{_defaultdocdir}/%{name}/COPYING +%{_bindir}/whiptail +%{_mandir}/man1/whiptail.1* + +%files -n %{libsoname} +%{_libdir}/%{libname}.so.* + +%files devel +%{_includedir}/%{name}.h +%{_libdir}/%{libname}.so +%{_libdir}/pkgconfig/*.pc + +%files doc +%doc %{_defaultdocdir}/%{name}/tutorial.* + +%files static +%{_libdir}/%{libname}.a + +%if %{with python2} +%files -n python2-%{name} +%{python2_sitearch}/* +%endif + +%files -n python3-%{name} +%{python3_sitearch}/*.so +%{python3_sitearch}/*.py* +%{python3_sitearch}/__pycache__/*.py* + +%changelog