SHA256
8
0
forked from pool/newt

Accepting request 813142 from home:favogt:branches:devel:libraries:c_c++

This avoids depending on docbook and texlive during newt build.

- Split doc build into separate spec file
- As the example scripts are "pointless", just don't install them

OBS-URL: https://build.opensuse.org/request/show/813142
OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/newt?expand=0&rev=51
This commit is contained in:
Lars Vogdt
2020-06-10 18:14:38 +00:00
committed by Git OBS Bridge
parent 2a6319cf0b
commit a0ade439aa
4 changed files with 71 additions and 55 deletions

4
newt-doc.changes Normal file
View File

@@ -0,0 +1,4 @@
-------------------------------------------------------------------
Wed Jun 10 07:39:31 UTC 2020 - Fabian Vogt <fvogt@suse.com>
- Initial commit of split doc package

59
newt-doc.spec Normal file
View File

@@ -0,0 +1,59 @@
#
# spec file for package newt-doc
#
# Copyright (c) 2020 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.
# Please submit bugfixes or comments via https://bugs.opensuse.org/
#
Name: newt-doc
Version: 0.52.21
Release: 0
Summary: Tutorial for Nifty Erik's Windowing Toolkit
License: LGPL-2.1-or-later
Group: Documentation/Howto
URL: https://pagure.io/newt
Source: https://fedorahosted.org/releases/n/e/newt/newt-%{version}.tar.gz
# needed for tutorial.pdf
BuildRequires: docbook-toys
BuildRequires: texlive-courier
BuildRequires: texlive-dvips
BuildRequires: texlive-ec
BuildRequires: texlive-helvetic
BuildRequires: texlive-jadetex
BuildRequires: texlive-times
Recommends: newt = %{version}
BuildArch: noarch
%description
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.
%prep
%autosetup -p1 -n newt-%{version}
%build
# create tutorial.pdf documentation
db2pdf tutorial.sgml
%install
%files
%defattr(-,root,root)
%doc tutorial.{sgml,pdf,tex}
%changelog

View File

@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Wed Jun 10 07:39:52 UTC 2020 - Fabian Vogt <fvogt@suse.com>
- Split doc build into separate spec file
- As the example scripts are "pointless", just don't install them
------------------------------------------------------------------- -------------------------------------------------------------------
Thu Apr 23 08:18:18 UTC 2020 - Martin Pluskal <mpluskal@suse.com> Thu Apr 23 08:18:18 UTC 2020 - Martin Pluskal <mpluskal@suse.com>

View File

@@ -31,19 +31,11 @@ Source: https://fedorahosted.org/releases/n/e/newt/%{name}-%{version}.ta
Source2: baselibs.conf Source2: baselibs.conf
Source10: %{name}-rpmlintrc Source10: %{name}-rpmlintrc
Patch0: newt-0.52.20-implicit-pointer-decl.patch Patch0: newt-0.52.20-implicit-pointer-decl.patch
# needed for tutorial.pdf
BuildRequires: docbook-toys
BuildRequires: fdupes BuildRequires: fdupes
BuildRequires: pkgconfig BuildRequires: pkgconfig
BuildRequires: popt-devel BuildRequires: popt-devel
BuildRequires: python3-devel BuildRequires: python3-devel
BuildRequires: slang-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} %if %{with python2}
BuildRequires: python-devel BuildRequires: python-devel
%endif %endif
@@ -90,22 +82,6 @@ Newt is a development library for text mode user interfaces.
Install newt-devel if you want to develop applications which depend on Install newt-devel if you want to develop applications which depend on
newt. newt.
%package doc
Summary: Tutorial for Nifty Erik's Windowing Toolkit
# the examples need the main package:
License: LGPL-2.1-or-later
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 %package static
# Please keep the static package as this is requested by another # Please keep the static package as this is requested by another
# vendor for his tool. It shouldn't be a problem to keep this # vendor for his tool. It shouldn't be a problem to keep this
@@ -150,8 +126,7 @@ The python3-newt package contains the Python 3 bindings for the newt library
providing a python API for creating text mode interfaces. providing a python API for creating text mode interfaces.
%prep %prep
%setup -q %autosetup -p1
%patch0 -p1
%build %build
%global _lto_cflags %{_lto_cflags} -ffat-lto-objects %global _lto_cflags %{_lto_cflags} -ffat-lto-objects
@@ -160,7 +135,6 @@ providing a python API for creating text mode interfaces.
%configure --without-tcl %configure --without-tcl
## make depend ## make depend
make CPPFLAGS="%{optflags} -fPIC" %{?_smp_mflags} all make CPPFLAGS="%{optflags} -fPIC" %{?_smp_mflags} all
#docbook2txt tutorial.sgml
chmod 0644 peanuts.py popcorn.py chmod 0644 peanuts.py popcorn.py
%install %install
@@ -176,22 +150,6 @@ for lang in ast bal sr@latin wo; do
rm -rf %{buildroot}%{_datadir}/locale/$lang rm -rf %{buildroot}%{_datadir}/locale/$lang
done 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} %find_lang %{name}
%if %{with python2} %if %{with python2}
@@ -201,20 +159,13 @@ popd 1>/dev/null
%py3_compile %{buildroot}/%{python3_sitearch} %py3_compile %{buildroot}/%{python3_sitearch}
%py3_compile -O %{buildroot}/%{python3_sitearch} %py3_compile -O %{buildroot}/%{python3_sitearch}
%fdupes %{buildroot}/%{python3_sitearch} %fdupes %{buildroot}/%{python3_sitearch}
# pointless examples
rm %{buildroot}%{_defaultdocdir}/%{name}/examples/*.py
%post -n %{libsoname} -p /sbin/ldconfig %post -n %{libsoname} -p /sbin/ldconfig
%postun -n %{libsoname} -p /sbin/ldconfig %postun -n %{libsoname} -p /sbin/ldconfig
%files -f %{name}.lang %files -f %{name}.lang
%defattr(-,root,root) %defattr(-,root,root)
%dir %{_defaultdocdir}/%{name} %license COPYING
%if 0%{?suse_version} >= 01500
%license %{_defaultdocdir}/%{name}/COPYING
%else
%license %{_defaultdocdir}/%{name}/COPYING
%endif
%{_bindir}/whiptail %{_bindir}/whiptail
%{_mandir}/man1/whiptail.1%{?ext_man} %{_mandir}/man1/whiptail.1%{?ext_man}
@@ -228,10 +179,6 @@ rm %{buildroot}%{_defaultdocdir}/%{name}/examples/*.py
%{_libdir}/%{libname}.so %{_libdir}/%{libname}.so
%{_libdir}/pkgconfig/*.pc %{_libdir}/pkgconfig/*.pc
%files doc
%defattr(-,root,root)
%doc %{_defaultdocdir}/%{name}/tutorial.*
%files static %files static
%defattr(-,root,root) %defattr(-,root,root)
%{_libdir}/%{libname}.a %{_libdir}/%{libname}.a