File squashfs.spec of Package squashfs

# spec file for package squashfs
# Copyright (c) 2020 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

Name:           squashfs
Version:        4.4
Release:        0
Summary:        A Read-Only File System with Efficient Compression
License:        GPL-2.0-or-later
Group:          System/Filesystems
Patch0:         squashfs-64k.patch
Patch1:         squashfs-thread-limit
%if %{?suse_version} > 1315
BuildRequires:  liblz4-devel
%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150100
BuildRequires:  libzstd-devel
BuildRequires:  lzma-devel
BuildRequires:  lzo-devel
BuildRequires:  zlib-devel
Supplements:    filesystem(squashfs)
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

This package contains the userland utilities to create and read
squashfs images.

%setup -q -n squashfs%{version}
%patch0 -p1
%patch1 -p1

%define _lto_cflags %{nil}
sed -i -e "s|-O2|%{optflags} -fcommon|" squashfs-tools/Makefile
make %{?_smp_mflags} -C squashfs-tools XZ_SUPPORT=1 LZO_SUPPORT=1 \
%if %{?suse_version} > 1315
   LZ4_SUPPORT=1 \
%if 0%{?suse_version} >= 1550 || 0%{?sle_version} >= 150100

mkdir -p %{buildroot}%{_bindir}
install -m 755 squashfs-tools/{un,mk}squashfs %{buildroot}%{_bindir}