File libsixel.spec of Package libsixel

#
# spec file for package libsixel
#
# Copyright (c) 2021 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
# upon. The license for this file, and modifications and additions to the
# file, is the same license as for the pristine package itself (unless the
# license for the pristine package is not an Open Source License, in which
# case the license is the MIT License). An "Open Source License" is a
# license that conforms to the Open Source Definition (Version 1.9)
# published by the Open Source Initiative.

# Please submit bugfixes or comments via https://bugs.opensuse.org/
#


%define  _name  sixel
%define   _ver  1
Name:           libsixel
Version:        @SERVICE@
Release:        0
Summary:        A SIXEL encoder/decoder implementation
License:        MIT
Group:          Productivity/Graphics/Convertors
URL:            https://github.com/saitoha/libsixel
Source:         %{name}-%{version}.tar.xz
BuildRequires:  fdupes
BuildRequires:  pkgconfig
BuildRequires:  pkgconfig(gdk-pixbuf-2.0)
BuildRequires:  pkgconfig(gdlib)
BuildRequires:  pkgconfig(libcurl)
BuildRequires:  pkgconfig(libjpeg)
BuildRequires:  pkgconfig(libpng)

%description
This package provides encoder/decoder implementation for DEC SIXEL
graphics, and some converter programs.

%package -n %{_name}-bin
Summary:        %{summary}
Group:          Productivity/Graphics/Convertors

%description -n %{_name}-bin
%{summary}.

%package -n %{name}%{_ver}
Summary:        A library for encoding/decoding DEC SIXEL graphics
Group:          System/Libraries

%description -n %{name}%{_ver}
A library for encoding/decoding DEC SIXEL graphics.

%package devel
Summary:        Development files for %{name}
Group:          Development/Libraries/C and C++
Requires:       %{name}%{_ver} = %{version}

%description devel
Development files for %{name} including headers and libraries

%package -n %{_name}-bash-completion
Summary:        Bash completion for %{name}
Group:          System/Shells
Requires:       bash-completion
Supplements:    (%{_name}-bin and bash)
BuildArch:      noarch

%description -n %{_name}-bash-completion
Bash command line completion support for %{name}.

%package -n %{_name}-zsh-completion
Summary:        Zsh Completion for %{name}
Group:          System/Shells
Requires:       zsh
Supplements:    (%{_name}-bin and zsh)
BuildArch:      noarch

%description -n %{_name}-zsh-completion
ZSH command line completion support for %{name}.

%prep
%autosetup
sed -i '1s/env \(python\).*/\13/' python/%{name}/*.py

%build
%configure \
    --disable-static
%make_build

%install
%make_install
chmod 0755 %{buildroot}%{python3_sitelib}/%{name}/*.py
find %{buildroot}%{_libdir} -type f -name "*.la" -delete -print
%fdupes -s %{buildroot}%{python3_sitelib}

%post -n %{name}%{_ver} -p /sbin/ldconfig
%postun -n %{name}%{_ver} -p /sbin/ldconfig

%files -n %{_name}-bin
%doc README.md
%{_bindir}/img2sixel
%{_bindir}/%{name}-config
%{_bindir}/sixel2png
%{_mandir}/man?/img2sixel.?%{?ext_man}
%{_mandir}/man?/sixel2png.?%{?ext_man}
%{_mandir}/man?/sixel.?%{?ext_man}
%{python3_sitelib}/%{name}
%license LICENSE

%files -n %{name}%{_ver}
%{_libdir}/%{name}.so.*

%files devel
%{_includedir}/sixel.h
%{_libdir}/pkgconfig/%{name}.pc
%{_libdir}/%{name}.so

%files -n %{_name}-bash-completion
%dir %{_datadir}/bash-completion/
%dir %{_datadir}/bash-completion/completions
%{_datadir}/bash-completion/completions/img2sixel

%files -n %{_name}-zsh-completion
%dir %{_datadir}/zsh/
%dir %{_datadir}/zsh/site-functions
%{_datadir}/zsh/site-functions/_img2sixel

%changelog
openSUSE Build Service is sponsored by