File hamlib.spec of Package hamlib

#
# spec file for package hamlib
#
# Copyright (c) 2024 Walter Fey DL8FCL
#
# This file is under MIT license

%define date 20240514
%define soname 4

Name:           hamlib
Version:        4.6~git%{date}
Release:        0
Summary:        Library and basic applications to control transcievers, receivers and rotors
License:        LGPL-2.1-only and GPL-2.0-only
Group:          Productivity/Hamradio/Other
Url:            https://hamlib.github.io/
Source:         %{name}-%{version}.tar.xz
Patch0:         %{name}-perl_install.diff

BuildRequires:  asciidoc
BuildRequires:  fdupes
BuildRequires:  gcc-c++
BuildRequires:  libindi-devel
BuildRequires:  libnova-devel
BuildRequires:  libtool
BuildRequires:  libusb-devel
BuildRequires:  lua-devel
BuildRequires:  perl
BuildRequires:  pkgconfig
BuildRequires:  readline-devel
BuildRequires:  swig
BuildRequires:  pkgconfig(gdlib)
BuildRequires:  pkgconfig(libxml-2.0)
BuildRequires:  pkgconfig(python3)
BuildRequires:  pkgconfig(tcl)

%description
The Ham Radio Control Library – Hamlib, for short – is a project to provide
programs with a consistent Application Programming Interface (API) for
controlling the myriad of radios and rotators available to amateur radio
and communications users.

%package devel
Summary:        Hamlib development libraries
Group:          Development/Libraries/Other
Requires:       %{name} = %{version}

%description devel
The Ham Radio Control Library – Hamlib, for short – is a project to provide
programs with a consistent Application Programming Interface (API) for
controlling the myriad of radios and rotators available to amateur radio
and communications users. 

%package -n libhamlib++%{soname}
Summary:        Hamlib C++ libraries
Group:          Development/Libraries/Other

%description -n libhamlib++%{soname}
The Ham Radio Control Library – Hamlib, for short – is a project to provide
programs with a consistent Application Programming Interface (API) for
controlling the myriad of radios and rotators available to amateur radio
and communications users.

%package -n libhamlib++%{soname}-devel
Summary:        Hamlib C++ development libraries
Group:          Development/Libraries/Other
Requires:       hamlib-devel = %{version}
Requires:       libhamlib++%{soname} = %{version}

%description -n libhamlib++%{soname}-devel
The Ham Radio Control Library – Hamlib, for short – is a project to provide
programs with a consistent Application Programming Interface (API) for
controlling the myriad of radios and rotators available to amateur radio
and communications users.

%package -n lua-%{name}
Summary:        LUA bindings for Hamlib
Group:          Development/Libraries/Other
Requires:       %{name} = %{version}

%description -n lua-%{name}
The Ham Radio Control Library – Hamlib, for short – is a project to provide
programs with a consistent Application Programming Interface (API) for
controlling the myriad of radios and rotators available to amateur radio
and communications users.

%package -n python3-%{name}
Summary:        Python bindings for Hamlib
Group:          Development/Libraries/Other

%description -n python3-%{name}
The Ham Radio Control Library – Hamlib, for short – is a project to provide
programs with a consistent Application Programming Interface (API) for
controlling the myriad of radios and rotators available to amateur radio
and communications users.

%package -n perl-%{name}
Summary:        Perl bindings for Hamlib
Group:          Development/Libraries/Other
%requires_eq    perl-base

%description -n perl-%{name}
The Ham Radio Control Library – Hamlib, for short – is a project to provide
programs with a consistent Application Programming Interface (API) for
controlling the myriad of radios and rotators available to amateur radio
and communications users.

%package -n tcl-%{name}
Summary:        Tcl bindings for Hamlib
Group:          Development/Libraries/Other
%requires_eq    tcl

%description -n tcl-%{name}
The Ham Radio Control Library – Hamlib, for short – is a project to provide
programs with a consistent Application Programming Interface (API) for
controlling the myriad of radios and rotators available to amateur radio
and communications users.

%prep
%setup
%patch -P 0 -p1

%build
autoreconf --install
%configure --with-perl-binding \
           --with-tcl-binding \
           --with-lua-binding \
           --with-python-binding PYTHON_VERSION='3' \
           --with-xml-support

%make_build

%install
%make_install
rm %{buildroot}%{_datadir}/doc/hamlib/LICENSE
rm %{buildroot}%{perl_vendorarch}/auto/Hamlib/.packlist
%fdupes %{buildroot}%{python3_sitearch}

%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%post -n libhamlib++%{soname} -p /sbin/ldconfig
%postun -n libhamlib++%{soname} -p /sbin/ldconfig

%files
%doc AUTHORS NEWS README.multicast
%license LICENSE
%{_bindir}/*
%{_mandir}/man1/*
%{_mandir}/man7/*
%{_libdir}/libhamlib.so.*
%{_datadir}/doc/hamlib
%exclude  %{_libdir}/*.la

%files devel
%dir %{_includedir}/hamlib
%{_includedir}/hamlib/*.h
%{_datadir}/aclocal/hamlib.m4
%{_libdir}/pkgconfig/hamlib.pc
%{_libdir}/libhamlib.so

%files -n libhamlib++%{soname}
%{_libdir}/libhamlib++.so.*

%files -n libhamlib++%{soname}-devel
%{_libdir}/libhamlib++.so

%files -n lua-%{name}
%{_libdir}/lua

%files -n python3-%{name}
%{python3_sitearch}/Hamlib.*
%{python3_sitearch}/_Hamlib.*
%{python3_sitearch}/__pycache__/Hamlib.cpython*.pyc

%files -n perl-%{name}
%{perl_vendorarch}/*

%files -n tcl-%{name}
%{_libdir}/tcl*

%changelog
openSUSE Build Service is sponsored by