File hfsplus-tools.spec of Package hfsplus-tools
#
# spec file for package hfsplus-tools
#
# Copyright (c) 2013-2022 Malcolm J Lewis <malcolmlewis@opensuse.org>
#
# 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 http://bugs.opensuse.org/
#
Name: hfsplus-tools
Version: 627.40.1
Release: 0
License: APSL-2.0
Summary: Apple HFS+ filesystems tools
URL: https://github.com/apple-oss-distributions/hfs
Group: System/Filesystems
Source0: %{url}/archive/hfs-%{version}.tar.gz
Source99: apsl-2.0.txt
Patch0: 0001-fsck_hfs-Disable-BlocksRuntime.patch
Patch1: 0002-hfs-Add-build-support-for-GNU-Make.patch
Patch2: 0003-hfs-Remove-unsupported-__unused-specifiers.patch
Patch3: 0004-fsck_hfs-Port-byteswap-code-to-Linux.patch
Patch4: 0005-dfalib-Remove-all-uses-of-p-escape-code-from-strings.patch
Patch5: 0006-hfs-Combined-patch-to-add-Linux-support.patch
Patch6: 0007-hfs-Add-support-for-Linux-ioctl-calls.patch
BuildRequires: pkgconfig(libbsd)
BuildRequires: pkgconfig(libmd)
BuildRequires: pkgconfig(uuid)
%description
This package provides tools to create and check HFS+ filesystems under Linux.
%prep
%setup -q -n hfs-hfs-%{version}
%autopatch -p1
cp %{S:99} .
%build
export CFLAGS="%{optflags}"
export LINUX="1"
make %{?_smp_mflags} -f Makefile
%install
mkdir -p %{buildroot}/%{_sbindir}
cp newfs_hfs/newfs_hfs %{buildroot}/%{_sbindir}/mkfs.hfsplus
cp fsck_hfs/fsck_hfs %{buildroot}/%{_sbindir}/fsck.hfsplus
# man pages -- a mildly non-invasive name change is in order
mkdir -p %{buildroot}/%{_mandir}/man8
cat fsck_hfs/fsck_hfs.8 | sed -e 's/[F|f]sck_hfs/fsck.hfsplus/g' \
> %{buildroot}/%{_mandir}/man8/fsck.hfsplus.8
cat newfs_hfs/newfs_hfs.8 | sed -e 's/[N|n]ewfs_hfs/mkfs.hfsplus/g' \
> %{buildroot}/%{_mandir}/man8/mkfs.hfsplus.8
# and a utility symlink...
cd %{buildroot}/%{_sbindir}
cd %{buildroot}/%{_mandir}/man8
%post
if ! grep -e '^hfsplus$' /etc/filesystems >/dev/null 2>&1 ; then
sed -i 's/*/hfsplus\n*/g' /etc/filesystems
echo "Added 'hfsplus' to the file /etc/filesystems"
fi
%postun
if [ "$1" == "0" ]; then
sed -i -e '/^hfsplus$/d' /etc/filesystems
echo "Deleted 'hfsplus' from the file /etc/filesystems"
fi
%files
%license apsl-2.0.txt
%{_sbindir}/mkfs.hfsplus
%{_sbindir}/fsck.hfsplus
%{_mandir}/man8/mkfs.hfsplus.8%{?ext_man}
%{_mandir}/man8/fsck.hfsplus.8%{?ext_man}
%changelog