+++ /dev/null
---- linux-gpib-kernel-4.2.0/drivers/gpib/sys/osfuncs.c~ 2018-11-07 15:58:07.000000000 +0100
-+++ linux-gpib-kernel-4.2.0/drivers/gpib/sys/osfuncs.c 2019-03-10 18:51:26.364983014 +0100
-@@ -551,7 +551,11 @@
- remain = read_cmd.requested_transfer_count - read_cmd.completed_transfer_count;
-
- /* Check write access to buffer */
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,0,0)
- if(!access_ok(VERIFY_WRITE, userbuf, remain))
-+#else
-+ if(!access_ok(userbuf, remain))
-+#endif
- return -EFAULT;
-
- smp_mb__before_atomic();
-@@ -626,7 +630,11 @@
- remain = cmd.requested_transfer_count - cmd.completed_transfer_count;
-
- /* Check read access to buffer */
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,0,0)
- if(!access_ok(VERIFY_READ, userbuf, remain))
-+#else
-+ if(!access_ok(userbuf, remain))
-+#endif
- return -EFAULT;
-
- /* Write buffer loads till we empty the user supplied buffer.
-@@ -705,7 +713,11 @@
- remain = write_cmd.requested_transfer_count - write_cmd.completed_transfer_count;
-
- /* Check read access to buffer */
-+#if LINUX_VERSION_CODE < KERNEL_VERSION(5,0,0)
- if(!access_ok(VERIFY_READ, userbuf, remain))
-+#else
-+ if(!access_ok(userbuf, remain))
-+#endif
- return -EFAULT;
-
- smp_mb__before_atomic();
---- linux-gpib-4.0.3/usb/agilent_82357a/agilent_82357a.in.orig 2016-04-09 15:33:10.000000000 +0200
-+++ linux-gpib-4.0.3/usb/agilent_82357a/agilent_82357a.in 2016-07-05 22:01:15.232112298 +0200
-@@ -1,7 +1,7 @@
- #!/bin/sh
-
- GPIB_CONFIG_OPTIONS="--minor 0"
--DATADIR=@datadir@
-+FIRMWAREDIR=/lib/firmware
- FXLOAD=fxload
- FXLOAD_OPTIONS=
-
-@@ -47,7 +47,7 @@
-
- # 82357a without firmware
- 957/7/*)
-- FIRMWARE=$DATADIR/usb/agilent_82357a/82357a_fw.hex
-+ FIRMWARE=$FIRMWAREDIR/agilent_82357a/82357a_fw.hex
- ;;
-
- # 82357b with firmware already loaded
-@@ -57,7 +57,7 @@
-
- # 82357b without firmware
- 957/518/*)
-- FIRMWARE=$DATADIR/usb/agilent_82357a/measat_releaseX1.8.hex
-+ FIRMWARE=$FIRMWAREDIR/agilent_82357a/measat_releaseX1.8.hex
- FXLOAD_OPTIONS="-t fx2"
- ;;
-
---- linux-gpib-4.0.3/usb/ni_usb_gpib/ni_usb_gpib.in.orig 2016-04-09 15:33:10.000000000 +0200
-+++ linux-gpib-4.0.3/usb/ni_usb_gpib/ni_usb_gpib.in 2016-07-05 22:01:43.015295116 +0200
-@@ -1,7 +1,7 @@
- #!/bin/sh
-
- GPIB_CONFIG_OPTIONS="--minor 0"
--DATADIR=@datadir@
-+FIRMWAREDIR=/lib/firmware
- FXLOAD=fxload
- FXLOAD_OPTIONS="-t fx"
-
-@@ -48,8 +48,8 @@
-
- # ni-usb-b or kusb-488 without firmware
- 3923/702b/* | 3923/713b/*)
-- FIRMWARE=$DATADIR/usb/ni_usb_gpib/niusbb_firmware.hex
-- SS_LOADER=$DATADIR/usb/ni_usb_gpib/niusbb_loader.hex
-+ FIRMWARE=$FIRMWAREDIR/ni_usb_gpib/niusbb_firmware.hex
-+ SS_LOADER=$FIRMWAREDIR/ni_usb_gpib/niusbb_loader.hex
- ;;
-
- # ni-usb-hs
+--- linux-gpib-user-4.3.0/usb/agilent_82357a/Makefile.am~ 2019-08-23 10:30:11.000000000 +0200
++++ linux-gpib-user-4.3.0/usb/agilent_82357a/Makefile.am 2019-09-18 17:53:41.226519040 +0200
+@@ -10,7 +10,7 @@
+ EXTRA_DIST = 99-agilent_82357a.rules.in
+ CLEANFILES = 99-agilent_82357a.rules
+
+-USB_FIRMWARE_DIR=$(datadir)/usb
++USB_FIRMWARE_DIR=/lib/firmware
+ UDEV_RULES_DIR=$(sysconfdir)/udev/rules.d
+
+ do_subst = $(SED) -e 's,[@]sbindir[@],$(sbindir),g'\
+--- linux-gpib-user-4.3.0/usb/ni_usb_gpib/Makefile.am~ 2019-08-23 10:30:11.000000000 +0200
++++ linux-gpib-user-4.3.0/usb/ni_usb_gpib/Makefile.am 2019-09-18 17:54:07.033184839 +0200
+@@ -10,7 +10,7 @@
+ EXTRA_DIST = 99-ni_usb_gpib.rules.in
+ CLEANFILES = 99-ni_usb_gpib.rules
+
+-USB_FIRMWARE_DIR=$(datadir)/usb
++USB_FIRMWARE_DIR=/lib/firmware
+ UDEV_RULES_DIR=$(sysconfdir)/udev/rules.d
+
+ do_subst = $(SED) -e 's,[@]sbindir[@],$(sbindir),g'\
--- 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,11 @@
- fi
dnl Checks for libraries.
+ if test "$BIND_GUILE" = "yes"; then
+AC_CHECK_LIB([guile-2.2],[scm_c_define],[:],[
+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])],[])
+])])
+ fi
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 @@
--- linux-gpib-4.0.3/language/Makefile.am.orig 2016-04-09 15:33:09.000000000 +0200
+++ linux-gpib-4.0.3/language/Makefile.am 2016-07-05 15:42:10.671996823 +0200
@@ -67,4 +67,4 @@
- $(RM) perl/Makefile
+ $(do_subst) < $(srcdir)/perl/Makefile.PL.in >perl/Makefile.PL
- perl/Makefile:
+ perl/Makefile: perl/Makefile.PL
- -(cd perl && $(PERL) Makefile.PL)
+ -(cd perl && $(PERL) Makefile.PL INSTALLDIRS=vendor CC="$(CC)" OPTIMIZE="$(CFLAGS)")
%include /usr/lib/rpm/macros.perl
%define php_name php%{?php_suffix}
-%define rel 3
+%define rel 1
%define pname linux-gpib
Summary: GPIB (IEEE 488) Linux support
Summary(pl.UTF-8): Obsługa GPIB (IEEE 488) dla Linuksa
Name: %{pname}%{?_pld_builder:%{?with_kernel:-kernel}}%{_alt_kernel}
-Version: 4.2.0
+Version: 4.3.0
Release: %{rel}%{?_pld_builder:%{?with_kernel:@%{_kernel_ver_str}}}
License: GPL v2+
Group: Applications/System
Source0: http://downloads.sourceforge.net/linux-gpib/%{pname}-%{version}.tar.gz
-# Source0-md5: 0241dcc2d16f6d12a7aa2c3a623a55ff
+# Source0-md5: 3085422695baf210b866601db6108860
Patch2: %{pname}-python.patch
Patch3: %{pname}-perl.patch
Patch4: %{pname}-firmwaredir.patch
%{nil}
%define build_kernel_pkg()\
-%configure \\\
- %{?with_drivers_isa:--enable-isa} \\\
- %{?with_drivers_pcmcia:--enable-pcmcia} \\\
- %{!?with_docs:--disable-documentation} \\\
- %{!?with_guile:--disable-guile-binding} \\\
- %{!?with_perl:--disable-perl-binding} \\\
- %{!?with_python:--disable-python-binding} \\\
- %{!?with_tcl:--disable-tcl-binding} \\\
- --with-linux-srcdir=%{_kernelsrcdir}\
-%{__make}\
+%{__make} VERBOSE=1 LINUX_SRCDIR=%{_kernelsrcdir}\
cd drivers/gpib\
%ifarch %{ix86}\
%install_kernel_modules -D installed -m agilent_82350b/agilent_82350b,cb7210/cb7210,cec/cec_gpib,hp_82335/hp82335,ines/ines_gpib,nec7210/nec7210,sys/gpib_common,tms9914/tms9914,tnt4882/tnt4882%{?with_drivers_isa:,pc2/pc2_gpib}%{?with_drivers_usb:,agilent_82357a/agilent_82357a,lpvo_usb_gpib/lpvo_usb_gpib,ni_usb/ni_usb_gpib} -d kernel/gpib\
%if %{with kernel}
tar xzf linux-gpib-kernel-%{version}.tar.gz
cd linux-gpib-kernel-%{version}
-%patch7 -p1
-%ifarch %{ix86}
-%patch8 -p1
-%endif
-
-# disable modules build by default, just install userspace header
-echo 'SUBDIRS = gpib/include' > drivers/Makefile.am
+#%patch7 -p1
+#%ifarch %{ix86}
+#%patch8 -p1
+#%endif
# need to inject -I options before $(LINUXINCLUDE), the simplest way is to override CC
-for f in drivers/gpib/*/Makefile ; do
-echo 'override CC += $(EARLYCPPFLAGS)' >> $f
-done
+#for f in drivers/gpib/*/Makefile ; do
+#echo 'override CC += $(EARLYCPPFLAGS)' >> $f
+#done
%endif
%build
CPPFLAGS="%{rpmcppflags} -I/usr/include/guile/2.2"
%endif
%configure \
+ --with-udev-libdir=/lib/udev \
%{?with_drivers_isa:--enable-isa} \
%{?with_drivers_pcmcia:--enable-pcmcia} \
%{!?with_docs:--disable-documentation} \
%{__mv} $RPM_BUILD_ROOT/lib/udev/*.usermap $RPM_BUILD_ROOT/etc/hotplug/usb
ln -snf /lib/udev/agilent_82357a $RPM_BUILD_ROOT/etc/hotplug/usb/agilent_82357a
ln -snf /lib/udev/ni_usb_gpib $RPM_BUILD_ROOT/etc/hotplug/usb/ni_usb_gpib
-%else
-%{__rm} $RPM_BUILD_ROOT/lib/udev/*.usermap
%endif
# obsoleted by pkg-config
%attr(755,root,root) %{_bindir}/ibterm
%attr(755,root,root) %{_bindir}/ibtest
%attr(755,root,root) %{_sbindir}/gpib_config
+/lib/udev/rules.d/98-gpib-generic.rules
/lib/udev/rules.d/99-agilent_82357a.rules
-/lib/udev/rules.d/99-gpib-generic.rules
/lib/udev/rules.d/99-ni_usb_gpib.rules
-%attr(755,root,root) /lib/udev/agilent_82357a
-%attr(755,root,root) /lib/udev/ni_usb_gpib
+%attr(755,root,root) /lib/udev/gpib_udev_config
+%attr(755,root,root) /lib/udev/gpib_udev_fxloader
+%attr(755,root,root) /lib/udev/gpib_udevadm_wrapper
%if %{with hotplug}
%files hotplug