%include /usr/lib/rpm/macros.perl
%define php_name php%{?php_suffix}
-%define _rc rc3
-%define rel 0.%{_rc}.1
+%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.0.4
+Version: 4.2.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}%{_rc}.tar.gz
-# Source0-md5: e12b4eeae623015c74f8ed01107e8f92
-Patch0: %{pname}-include_file.patch
-Patch1: %{pname}-destdir.patch
+Source0: http://downloads.sourceforge.net/linux-gpib/%{pname}-%{version}.tar.gz
+# Source0-md5: 0241dcc2d16f6d12a7aa2c3a623a55ff
Patch2: %{pname}-python.patch
Patch3: %{pname}-perl.patch
Patch4: %{pname}-firmwaredir.patch
Patch5: %{pname}-guile2.patch
Patch6: %{pname}-php7.patch
-Patch7: kernel-4.11.patch
+Patch7: kernel-5.0.patch
URL: http://linux-gpib.sourceforge.net/
BuildRequires: autoconf >= 2.50
BuildRequires: automake
%{nil}
%define build_kernel_pkg()\
-TOPDIR=$(pwd)\
-%build_kernel_modules -C drivers/gpib -m gpib -- EARLYCPPFLAGS="-I$TOPDIR -I$TOPDIR/drivers/gpib/include -I$TOPDIR/include"\
+%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}\
cd drivers/gpib\
%install_kernel_modules -D installed -m agilent_82350b/agilent_82350b,cb7210/cb7210,cec/cec_gpib,hp_82335/hp82335,hp_82341/hp_82341,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\
cd ../..\
%{?with_kernel:%{expand:%create_kernel_packages}}
%prep
-%setup -q -n %{pname}-%{version}%{_rc}
-%patch0 -p1
-%patch1 -p1
+%setup -q -n %{pname}-%{version}
+%if %{with userspace}
+tar xzf linux-gpib-user-%{version}.tar.gz
+cd linux-gpib-user-%{version}
%patch2 -p1
%patch3 -p1
%patch4 -p1
%patch5 -p1
-%patch6 -p1
+#%patch6 -p1
+cd ..
+%endif
+
+%if %{with kernel}
+tar xzf linux-gpib-kernel-%{version}.tar.gz
+cd linux-gpib-kernel-%{version}
%patch7 -p1
# disable modules build by default, just install userspace header
for f in drivers/gpib/*/Makefile ; do
echo 'override CC += $(EARLYCPPFLAGS)' >> $f
done
+%endif
%build
+%if %{with userspace}
+cd linux-gpib-user-%{version}
%{__libtoolize}
-%{__aclocal} -I m4
+%{__aclocal}
%{__autoconf}
%{__autoheader}
%{__automake}
%{!?with_php:--disable-php-binding} \
%{!?with_python:--disable-python-binding} \
%{?with_static_libs:--enable-static} \
- %{!?with_tcl:--disable-tcl-binding} \
- --with-linux-srcdir=%{_kernelsrcdir}
+ %{!?with_tcl:--disable-tcl-binding}
-%if %{with userspace}
%{__make}
+cd ..
%endif
%if %{with kernel}
+cd linux-gpib-kernel-%{version}
%{expand:%build_kernel_packages}
%endif
install -d $RPM_BUILD_ROOT%{_examplesdir}
%if %{with kernel}
+cd linux-gpib-kernel-%{version}
%{expand:%install_kernel_packages}
cp -a drivers/gpib/installed/* $RPM_BUILD_ROOT
+cd ..
%endif
%if %{with userspace}
+cd linux-gpib-user-%{version}
%{__make} install \
DESTDIR=$RPM_BUILD_ROOT \
HOTPLUG_USB_CONF_DIR=/lib/udev \
%if %{with docs}
# packaged as %doc
-%{__rm} -r $RPM_BUILD_ROOT%{_datadir}/linux-gpib/html
-%endif
+%{__rm} -r $RPM_BUILD_ROOT%{_datadir}/linux-gpib-user/html
%endif
%clean
%if %{with userspace}
%files
%defattr(644,root,root,755)
+%config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/gpib.conf
%attr(755,root,root) %{_bindir}/ibterm
%attr(755,root,root) %{_bindir}/ibtest
%attr(755,root,root) %{_sbindir}/gpib_config
%files libs
%defattr(644,root,root,755)
-%doc AUTHORS ChangeLog README README.HAMEG README.hp82335 TODO
+%doc linux-gpib-user-%{version}/{AUTHORS,ChangeLog,README,README.HAMEG,README.hp82335,TODO}
%attr(755,root,root) %{_libdir}/libgpib.so.*.*.*
%attr(755,root,root) %ghost %{_libdir}/libgpib.so.0
%if %{with guile}
%files -n guile-gpib
%defattr(644,root,root,755)
-%attr(755,root,root) %{_libdir}/libgpib-guile-%{version}%{_rc}.so
+%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)
-%doc language/perl/{Changes,README}
+%doc linux-gpib-user-%{version}/language/perl/{Changes,README}
%{perl_vendorarch}/LinuxGpib.pm
%dir %{perl_vendorarch}/auto/LinuxGpib
%attr(755,root,root) %{perl_vendorarch}/auto/LinuxGpib/LinuxGpib.so
%files -n %{php_name}-gpib
%defattr(644,root,root,755)
%config(noreplace) %verify(not md5 mtime size) %{php_sysconfdir}/conf.d/gpib.ini
-%attr(755,root,root) %{php_extensiondir}/gpib_php-%{version}%{_rc}.so
+%attr(755,root,root) %{php_extensiondir}/gpib_php-%{version}.so
%attr(755,root,root) %{php_extensiondir}/gpib_php.so
%endif
%if %{with python}
%files -n python-gpib
%defattr(644,root,root,755)
-%doc language/python/README
+%doc linux-gpib-user-%{version}/language/python/README
%attr(755,root,root) %{py_sitedir}/gpib.so
%{py_sitedir}/Gpib.py[co]
%{py_sitedir}/gpib-1.0-py*.egg-info
%if %{with tcl}
%files -n tcl-gpib
%defattr(644,root,root,755)
-%doc language/tcl/README
-%attr(755,root,root) %{_libdir}/libgpib_tcl-%{version}%{_rc}.so
+%doc linux-gpib-user-%{version}/language/tcl/README
+%attr(755,root,root) %{_libdir}/libgpib_tcl-%{version}.so
%attr(755,root,root) %{_libdir}/libgpib_tcl.so
%{_examplesdir}/tcl-gpib-%{version}
%endif
%if %{with docs}
%files doc
%defattr(644,root,root,755)
-%doc doc/doc_html/*
+%doc linux-gpib-user-%{version}/doc/doc_html/*
%endif
%endif