File squashfuse.spec of Package squashfuse

#
# spec file for package squashfuse
#
# Copyright (c) 2022 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/
#


%global _lto_cflags %{_lto_cflags} -ffat-lto-objects
%define soname 0

Name:           squashfuse
Version:        0.1.105
Release:        0
Summary:        FUSE module to mount squashfs images
License:        BSD-2-Clause
Group:          System/Filesystems
URL:            https://github.com/vasi/squashfuse
Source0:        https://github.com/vasi/squashfuse/archive/%{version}/%{name}-%{version}.tar.gz
Patch0:         fix-configure-version.patch
Patch1:         fix-use-sys_xattr_h.patch
BuildRequires:  autoconf
BuildRequires:  automake
BuildRequires:  gcc
BuildRequires:  libtool
BuildRequires:  pkgconfig
BuildRequires:  squashfs
BuildRequires:  pkgconfig(fuse3)
BuildRequires:  pkgconfig(liblz4)
BuildRequires:  pkgconfig(liblzma)
BuildRequires:  pkgconfig(libzstd)
BuildRequires:  pkgconfig(lzo2)
BuildRequires:  pkgconfig(zlib)
Requires:       fuse3

%description
Squashfuse is a FUSE filesystem that allows a
squashfs archive to be mounted in user-space.
It is designed to be fast and memory-efficient,
and supports most of the features of the squashfs format.

%package -n lib%{name}%{soname}
Summary:        FUSE module to mount squashfs images
Group:          System/Libraries

%description -n lib%{name}%{soname}
Squashfuse is a FUSE filesystem that allows a
squashfs archive to be mounted in user-space.
It is designed to be fast and memory-efficient,
and supports most of the features of the squashfs format.

%package devel
Summary:        FUSE module to mount squashfs images
Group:          Development/Languages/C and C++
Requires:       lib%{name}%{soname} = %{version}

%description devel
This package contains development files.

%package devel-static
Summary:        FUSE module to mount squashfs images
Group:          Development/Languages/C and C++
Requires:       %{name}-devel = %{version}

%description devel-static
This package contains static development files.

%prep
%autosetup -p1

# fix squashfuse*.pc
sed -e 's|^Libs: \(.*\)|Libs: \1 -llzo2|' -i %{name}*.pc.in

%build
autoreconf -fi
%configure
%make_build

%install
%make_install

cp -pv *.h %{buildroot}%{_includedir}/%{name}
sed -e 's,^#include ",#include "squashfuse/,' \
	%{buildroot}%{_includedir}/%{name}/squashfuse.h \
	> %{buildroot}%{_includedir}/squashfuse.h

find %{buildroot} -type f -name "*.la" -delete -print

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

%files
%license LICENSE
%doc README
%{_bindir}/%{name}
%{_bindir}/%{name}_ll
%{_mandir}/man1/%{name}.1%{?ext_man}

%files -n lib%{name}%{soname}
%license LICENSE
%{_libdir}/lib%{name}*.so.*

%files devel
%{_includedir}/%{name}
%{_includedir}/%{name}.h
%{_libdir}/lib%{name}*.so
%{_libdir}/pkgconfig/%{name}.pc
%{_libdir}/pkgconfig/%{name}_ll.pc

%files devel-static
%{_libdir}/*.a

%changelog
openSUSE Build Service is sponsored by