File guile.spec of Package guile.3359

#
# spec file for package guile
#
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
#
# 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 http://bugs.opensuse.org/
#


# define the name used for versioning libs and directories.
%define guilemaj    2
%define guilemin    0
%define guilevers   %{guilemaj}.%{guilemin}
%define libgver     22
%define gsuff       %{guilemaj}_%{guilemin}-%{libgver}
%define libgreadver 18
%define greadsuff   v-%{libgreadver}-%{libgreadver}

Name:           guile
BuildRequires:  gc-devel
BuildRequires:  gmp-devel
BuildRequires:  libffi-devel
BuildRequires:  libltdl-devel
BuildRequires:  libunistring-devel
BuildRequires:  pkg-config
BuildRequires:  readline-devel
Version:        %{guilevers}.9
Release:        0
Summary:        GNU's Ubiquitous Intelligent Language for Extension
License:        GFDL-1.3 and GPL-3.0+ and LGPL-3.0+
Group:          Development/Languages/Scheme
Url:            http://www.gnu.org/software/guile/
Source0:        %{name}-%{version}.tar.gz
Source1:        guile-rpmlintrc
Patch1:         %{name}-64bit.patch
Patch2:         %{name}-1.6.10-mktemp.patch
Patch3:         %{name}-threads-test.patch
Patch4:         %{name}-net-db-test.patch
Patch5:         guile-CVE-2016-8605.patch
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
PreReq:         fileutils sh-utils
PreReq:         %install_info_prereq
Conflicts:      slib < 3a5

%description
This is Guile, a portable, embeddable Scheme implementation written in
C. Guile provides a machine independent execution platform that can be
linked in as a library when building extensible programs.

%package -n libguile-%{gsuff}
Summary:        GNU's Ubiquitous Intelligent Language for Extension
License:        GFDL-1.3 and GPL-3.0+ and LGPL-3.0+
Group:          Development/Languages/Scheme
Requires:       %{name}-modules-%{guilemaj}_%{guilemin} >= %{version}

%description -n libguile-%{gsuff}
This is Guile, a portable, embeddable Scheme implementation written in
C. Guile provides a machine independent execution platform that can be
linked in as a library when building extensible programs. This package
contains the shared libraries.

%package modules-%{guilemaj}_%{guilemin}
Summary:        GNU's Ubiquitous Intelligent Language for Extension
License:        GFDL-1.3 and GPL-3.0+ and LGPL-3.0+
Group:          Development/Languages/Scheme

%description modules-%{guilemaj}_%{guilemin}
This is Guile, a portable, embeddable Scheme implementation written in
C. Guile provides a machine independent execution platform that can be
linked in as a library when building extensible programs. This package
contains guile modules.

%package -n libguilereadline-%{greadsuff}
Summary:        GNU's Ubiquitous Intelligent Language for Extension
License:        GFDL-1.3 and GPL-3.0+ and LGPL-3.0+
Group:          Development/Languages/Scheme

%description -n libguilereadline-%{greadsuff}
This is Guile, a portable, embeddable Scheme implementation written in
C. Guile provides a machine independent execution platform that can be
linked in as a library when building extensible programs. This package
contains the shared libraries.

%package devel
Summary:        GNU's Ubiquitous Intelligent Language for Extension
License:        LGPL-2.1+
Group:          Development/Languages/Scheme
Requires:       gc-devel
Requires:       gmp-devel
Requires:       libffi-devel
Requires:       libunistring-devel
Requires:       ncurses-devel
Requires:       readline-devel
# following Requires needed because /usr/bin/guile-config needs /usr/bin/guile
Requires:       guile = %{version}
Requires:       libguile-%{gsuff} = %{version}
Requires:       libguilereadline-%{greadsuff} = %{version}

%description devel
This is Guile, a portable, embeddable Scheme implementation written in
C. Guile provides a machine independent execution platform that can be
linked in as a library when building extensible programs.

%prep
%setup -q
%patch1
%patch2
%patch3 -p1
%patch4 -p1
%patch5 -p1
# force rebuild with non-broken makeinfo
#rm -f doc/*/*.info

%build
# FIXME: Following files are apparently compiled without RPM_OPT_FLAGS:
# gen-scmconfig.c,c-tokenize.c

%configure --disable-static --with-pic \
	--with-threads --disable-silent-rules
make

%check
LD_LIBRARY_PATH="." make check

%install
make install DESTDIR=$RPM_BUILD_ROOT
mkdir -p $RPM_BUILD_ROOT%{_datadir}/guile/site
find %{buildroot}%{_libdir} -type f -name '*.la' -delete -print

%post devel
%install_info --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz
%install_info --info-dir=%{_infodir} %{_infodir}/r5rs.info.gz

%postun devel
%install_info_delete --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz
%install_info_delete --info-dir=%{_infodir} %{_infodir}/r5rs.info.gz

%pre
# Remove obsolete files (< SuSE Linux 10.2)
rm -f var/adm/SuSEconfig/md5/usr/share/guile/*/slibcat
rm -f usr/share/guile/site/slibcat.SuSEconfig

%post -n libguile-%{gsuff} -p /sbin/ldconfig

%postun -n libguile-%{gsuff} -p /sbin/ldconfig

%post -n libguilereadline-%{greadsuff} -p /sbin/ldconfig

%postun -n libguilereadline-%{greadsuff} -p /sbin/ldconfig

%files
%defattr(-,root,root)
%doc ABOUT-NLS AUTHORS COPYING* ChangeLog GUILE-VERSION HACKING
%doc LICENSE NEWS README THANKS
%{_bindir}/guile-tools
%{_bindir}/guild
%{_bindir}/guile
%{_mandir}/man1/guile.1.gz

%files -n libguile-%{gsuff}
%defattr(-,root,root)
%{_libdir}/libguile-%{guilevers}.so.%{libgver}*

%files modules-%{guilemaj}_%{guilemin}
%defattr(-,root,root)
%{_libdir}/%{name}
# Own usr/share/guile/site; side effect of not doing so is slib failing to install correctly.
%{_datadir}/%{name}

%files  -n libguilereadline-%{greadsuff}
%defattr(-,root,root)
# please leave .so file here [bnc#765436]
%{_libdir}/libguilereadline-v-%{libgreadver}.so
%{_libdir}/libguilereadline-v-%{libgreadver}.so.%{libgreadver}*

%files devel
%defattr(-,root,root)
%{_bindir}/guile-snarf
%{_bindir}/guile-config
%dir %{_includedir}/%{name}
%dir %{_includedir}/%{name}/%{guilevers}
%{_includedir}/%{name}/%{guilevers}/*
%{_datadir}/aclocal/guile.m4
%doc %{_infodir}/%{name}.info.gz
%doc %{_infodir}/%{name}.info-[0-9].gz
%doc %{_infodir}/%{name}.info-1[0-9].gz
%doc %{_infodir}/r5rs.info.gz
%{_libdir}/libguile-%{guilevers}.so
%{_libdir}/pkgconfig/guile-%{guilevers}.pc

%changelog
openSUSE Build Service is sponsored by