--- /dev/null
+--- linux-gpib-4.0.3/configure.ac.orig 2016-04-09 15:34:55.000000000 +0200
++++ linux-gpib-4.0.3/configure.ac 2016-07-06 17:55:18.567320365 +0200
+@@ -143,8 +143,10 @@
+ fi
+
+ dnl Checks for libraries.
++AC_CHECK_LIB([guile-2.0],[scm_c_define],[:],[
+ AC_CHECK_LIB([guile],[gh_define],[echo this prevents default actions from occurring > /dev/null],
+ [BIND_GUILE="no";AC_MSG_NOTICE([libguile not found, disabling guile binding])],[])
++])
+
+ AC_CHECK_LIB([readline], [readline],
+ [readline_lib=yes;AC_SUBST([LIB_READLINE_LDFLAGS], ["-lreadline -lncurses"])],
+--- linux-gpib-4.0.3/language/guile/gpib.h.orig 2016-04-09 15:33:09.000000000 +0200
++++ linux-gpib-4.0.3/language/guile/gpib.h 2016-07-06 20:44:07.355781339 +0200
+@@ -22,12 +22,12 @@
+ #ifndef SCM_GPIB_H
+ #define SCM_GPIB_H 1
+
+-#if defined (SCM_MINOR_VERSION) && (SCM_MINOR_VERSION >= 5) && \
+- defined (SCM_MAJOR_VERSION) && (SCM_MAJOR_VERSION >= 1)
++#if defined (SCM_MAJOR_VERSION) && ((SCM_MAJOR_VERSION > 1) || ((SCM_MAJOR_VERSION == 1) && \
++ defined (SCM_MINOR_VERSION) && (SCM_MINOR_VERSION >= 5)))
+ #define SCM_VERSION_15X 1
+ #endif
+-#if defined (SCM_MINOR_VERSION) && (SCM_MINOR_VERSION >= 7) && \
+- defined (SCM_MAJOR_VERSION) && (SCM_MAJOR_VERSION >= 1)
++#if defined (SCM_MAJOR_VERSION) && ((SCM_MAJOR_VERSION > 1) || ((SCM_MAJOR_VERSION == 1) && \
++ defined (SCM_MINOR_VERSION) && (SCM_MINOR_VERSION >= 7)))
+ #define SCM_VERSION_17X 1
+ #endif
+
+--- linux-gpib-4.0.3/language/guile/gpib.c.orig 2016-04-09 15:33:09.000000000 +0200
++++ linux-gpib-4.0.3/language/guile/gpib.c 2016-07-06 18:07:48.129926301 +0200
+@@ -23,7 +23,7 @@
+ #include <stdlib.h>
+ #include <string.h>
+
+-#include <guile/gh.h>
++#include <libguile.h>
+ #include <gpib/ib.h>
+
+ #include "gpib.h"
# TODO:
# - where to get firmware from?
-# - guile 2 support
# - PHP 7 support
#
# Conditional build:
%bcond_without docs # documentation build
%bcond_with hotplug # legacy hotplug support
%bcond_without static_libs # static library
-%bcond_with guile # guile binding
+%bcond_without guile # guile binding
%bcond_without perl # Perl binding
%bcond_without php # PHP binding
%bcond_without python # Python binding
Patch2: %{name}-python.patch
Patch3: %{name}-perl.patch
Patch4: %{name}-firmwaredir.patch
+Patch5: %{name}-guile2.patch
URL: http://linux-gpib.sourceforge.net/
BuildRequires: autoconf >= 2.50
BuildRequires: automake
BuildRequires: bison
%{?with_docs:BuildRequires: docbook-utils}
BuildRequires: flex
-%{?with_guile:BuildRequires: guile-devel < 5:2.0}
+%{?with_guile:BuildRequires: guile-devel >= 1.4}
%{?with_perl:BuildRequires: perl-devel}
%{?with_php:BuildRequires: php-devel < 4:7}
%{?with_python:BuildRequires: python-devel >= 2}
%description static -l pl.UTF-8
Biblioteka statyczna GPIB.
+%package -n guile-gpib
+Summary: Guile bindings for GPIB library
+Summary(pl.UTF-8): Wiązania Guile do biblioteki GPIB
+Group: Development/Languages/Perl
+Requires: %{name}-libs = %{version}-%{release}
+Requires: guile-libs
+
+%description -n guile-gpib
+Guile bindings for GPIB library.
+
+%description -n guile-gpib -l pl.UTF-8
+Wiązania Guile do biblioteki GPIB.
+
%package -n perl-gpib
Summary: Perl bindings for GPIB library
Summary(pl.UTF-8): Wiązania Perla do biblioteki GPIB
%patch2 -p1
%patch3 -p1
%patch4 -p1
+%patch5 -p1
# disable modules build by default, just install userspace header
echo 'SUBDIRS = gpib/include' > drivers/Makefile.am
%{__autoconf}
%{__autoheader}
%{__automake}
+%if %{with guile}
+CPPFLAGS="%{rpmcppflags} -I/usr/include/guile/2.0"
+%endif
%configure \
%ifarch %{ix86}
--enable-isa \
# obsoleted by pkg-config
%{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpib.la
+%if %{with guile}
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpib-guile.la
+%if %{with static_libs}
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpib-guile.a
+%endif
+%endif
+
%if %{with perl}
%{__make} -C language/perl pure_install \
DESTDIR=$RPM_BUILD_ROOT
%post libs -p /sbin/ldconfig
%postun libs -p /sbin/ldconfig
+%post -n guile-gpib -p /sbin/ldconfig
+%postun -n guile-gpib -p /sbin/ldconfig
+
+%post -n tcl-gpib -p /sbin/ldconfig
+%postun -n tcl-gpib -p /sbin/ldconfig
+
%if %{with userspace}
%files
%defattr(644,root,root,755)
%{_libdir}/libgpib.a
%endif
+%if %{with guile}
+%files -n guile-gpib
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_libdir}/libgpib-guile-%{version}.so
+%attr(755,root,root) %{_libdir}/libgpib-guile.so
+%endif
+
%if %{with perl}
%files -n perl-gpib
%defattr(644,root,root,755)