%global _hardened_build 1 # Kind of an ugly hack to get the kernel source directory, since in a mock # chroot, `uname -r` does not return the right version %global kversion %((rpm -q --qf '%%{EVR}.%%{ARCH}\\n' kernel-devel | tail -1)) %global ksrcdir %{_usrsrc}/kernels/%{kversion} Name: linux-gpib Version: 4.3.0 Release: 1%{?dist} Summary: Linux GPIB (IEEE-488) userspace library and programs License: GPLv2+ URL: http://linux-gpib.sourceforge.net/ Source0: http://downloads.sourceforge.net/linux-gpib/%{name}-%{version}.tar.gz Source1: dkms-%{name}.conf.in Requires: dkms-%{name} Requires(post): /sbin/ldconfig Requires(postun): /sbin/ldconfig BuildRequires: autoconf >= 2.50 BuildRequires: automake BuildRequires: libtool BuildRequires: sed BuildRequires: gcc BuildRequires: flex BuildRequires: bison %description The Linux GPIB package provides support for GPIB (IEEE-488) hardware. This packages contains the userspace libraries and programs. %package devel Summary: Development files for %{name} Requires: %{name}%{?_isa} = %{version}-%{release} %description devel Development files for %{name}. %package -n dkms-%{name} Summary: Linux GPIB (IEEE-488) driver # since the package just distributes the source for # compilation by dkms, this package can be noarch BuildArch: noarch # TODO: do we need to limit the archs this will run on? #ExclusiveArch: ???? Requires: dkms Requires: kernel-headers Requires: kernel-devel Requires: gcc Requires: make Requires(post): /sbin/ldconfig Requires(postun): /sbin/ldconfig BuildRequires: kernel-devel BuildRequires: kmod BuildRequires: elfutils-libelf-devel %description -n dkms-%{name} The Linux GPIB package provides support for GPIB (IEEE-488) hardware. This packages contains the kernel drivers for adapters compatible with: - Agilent/Keysight 82350B - Agilent/Keysight 82357A/B - CB7210 - Capital Equipment Corporation GPIB cards - FMH GPIB HDL core - HP 82335 - HP 82341 - INES PCI cards - LPVO USB GPIB - NEC7210 - NI GPIB-USB-B/HS/HS+ - TMS9914 - TNT4882 %package -n python2-%{name} Summary: Python 2 %{name} module %{?python_provide:%python_provide python2-%{name}} Requires: %{name}%{?_isa} = %{version}-%{release} BuildRequires: python2-devel %description -n python2-%{name} Python 2 bindings for %{name}. %package -n python%{python3_pkgversion}-%{name} Summary: Python 3 %{name} module %{?python_provide:%python_provide python%{python3_pkgversion}-%{name}} Requires: %{name}%{?_isa} = %{version}-%{release} BuildRequires: python%{python3_pkgversion}-devel %description -n python%{python3_pkgversion}-%{name} Python 3 bindings for %{name}. %package doc Summary: Documentation for %{name} library BuildArch: noarch Requires: %{name} = %{version}-%{release} %description doc HTML and PDF documentation for %{name}. %prep %setup -q -n %{name}-%{version} tar xzf %{name}-user-%{version}.tar.gz tar xzf %{name}-kernel-%{version}.tar.gz pushd %{name}-kernel-%{version} sed -e 's/__VERSION_STRING/%{version}/g' %{SOURCE1} > dkms.conf popd %build pushd %{name}-user-%{version} autoreconf -vif # we make the docs, and the Perl and Python bindings in the spec, # not the library's Makefile %configure \ --disable-guile-binding \ --disable-php-binding \ --disable-tcl-binding \ --disable-python-binding \ --disable-perl-binding \ --disable-static %make_build pushd language pushd python %{py2_build} %{py3_build} popd popd # language popd # %%{name}-user-%version %install rm -rf $RPM_BUILD_ROOT # dkms package pushd %{name}-kernel-%{version} install -d %{buildroot}%{_usrsrc}/%{name}-%{version}-%{release} cp -Rfp . %{buildroot}%{_usrsrc}/%{name}-%{version}-%{release} install -p -m 0644 dkms.conf %{buildroot}%{_usrsrc}/%{name}-%{version}-%{release} popd # userspace pushd %{name}-user-%{version} %make_install UDEV_RULES_DIR=%{_udevrulesdir} # obsoleted by pkg-config %{__rm} $RPM_BUILD_ROOT%{_libdir}/libgpib.la pushd language pushd python %{py2_install} %{py3_install} popd popd # language %check # Sanity check to make sure the kernel modules compile pushd %{name}-kernel-%{version} %make_build LINUX_SRCDIR=%{ksrcdir} popd # Post-install stuff # systemd stuff %post %{?ldconfig} %postun %{?ldconfig} # and ldconfig %ldconfig_scriptlets devel # dkms # Adapted from %post -n dkms-%{name} dkms add -m %{name} -v %{version}-%{release} -q --rpm_safe_upgrade || : # Rebuild and make available for the currently running kernel dkms build -m %{name} -v %{version}-%{release} -q || : dkms install -m %{name} -v %{version}-%{release} -q --force || : %{?ldconfig} udevadm control --reload > /dev/null 2>&1 || : %preun -n dkms-%{name} # Remove all versions from DKMS registry dkms remove -m %{name} -v %{version}-%{release} -q --all --rpm_safe_upgrade || : %{?ldconfig} udevadm control --reload > /dev/null 2>&1 || : %files %defattr(644,root,root,755) %license %{name}-user-%{version}/COPYING %doc %{name}-user-%{version}/README %attr(755,root,root) %{_bindir}/ibterm %attr(755,root,root) %{_bindir}/ibtest %attr(755,root,root) %{_sbindir}/gpib_config %attr(755,root,root) /usr/lib/udev/gpib_udev_config %attr(755,root,root) /usr/lib/udev/gpib_udev_fxloader %attr(755,root,root) /usr/lib/udev/gpib_udevadm_wrapper %{_libdir}/libgpib.so.* %config(noreplace) %{_sysconfdir}/gpib.conf %{_udevrulesdir}/*.rules %files -n dkms-%{name} %doc %{name}-kernel-%{version}/README %{name}-kernel-%{version}/AUTHORS %{name}-kernel-%{version}/INSTALL %license %{name}-kernel-%{version}/COPYING %dir %{_usrsrc}/%{name}-%{version}-%{release} %{_usrsrc}/%{name}-%{version}-%{release}/* %exclude %{_usrsrc}/%{name}-%{version}-%{release}/NEWS %files devel %defattr(644,root,root,755) %doc %{name}-user-%{version}/README %license %{name}-user-%{version}/COPYING %dir %{_includedir}/gpib %{_includedir}/gpib/gpib_user.h %{_includedir}/gpib/ib.h %{_libdir}/pkgconfig/libgpib.pc %{_libdir}/libgpib.so %files -n python%{python3_pkgversion}-%{name} %defattr(644,root,root,755) %doc %{name}-user-%{version}/language/python/README %license %{name}-user-%{version}/COPYING %{python3_sitearch}/* %files -n python2-%{name} %defattr(644,root,root,755) %doc %{name}-user-%{version}/language/python/README %license %{name}-user-%{version}/COPYING %{python2_sitearch}/* %changelog * Tue Jan 28 2020 George - Upgarde to ver 4.3.0 - Removed un-needed things from original spec (bindings, help files) * Sun Feb 24 2019 Colin Samples - 4.2.0-2.20190107svn1809 - Fix Agilent adapter configuation * Sun Feb 24 2019 Colin Samples - 4.2.0-1.20190107svn1809 - Bump linux-gbib version, and update udev rules and systemd unit file to account for changes in upstream. Add support for RHEL8 beta. * Fri Feb 1 2019 Colin Samples - 4.1.0-2.20180529svn1753 - Increment release number to fix F29 copr * Sat Jun 16 2018 Colin Samples - 4.1.0-1.20180529svn1753 - Initial release