File hfsprogs.spec of Package hfsprogs

Name:                hfsprogs
Summary:             Apple's HFS utils, ported and patched for Linux
Version:             332.25
Release:             11
License:             CC-BY-NC-SA-2.5
Group:               System/Filesystems
Url:                 https://github.com/Artoria2e5/hfsprogs
Source0:             %{name}.tar.gz
Patch0:              0000-linux-5.5.patch
BuildRequires:       gcc
BuildRequires:       libbsd-devel
BuildRequires:       libopenssl-devel

%description
Apple's HFS utils, ported and patched for Linux.
Originally diskdev-cmds.


%prep
%setup -q -n %{name}

%autopatch -p1
for patch in debian/patches/*.patch AUR/Archl-Makefile.patch
do
    echo "Applying patch ${patch} ..."
    patch -p1 -i ${patch}
done

%build
make -f Makefile.lnx

%install
install -m755 -d %{buildroot}/usr/bin
install -m755 -d %{buildroot}/usr/share/license/%{name}
install -m755 -d %{buildroot}/usr/share/%{name}
install -m755 -d %{buildroot}/usr/share/man/man8/
# Copy executable files
install -m755 "newfs_hfs.tproj/newfs_hfs" %{buildroot}/%{_bindir}/mkfs.hfsplus
install -m755 "fsck_hfs.tproj/fsck_hfs" %{buildroot}/%{_bindir}/fsck.hfsplus
# Copy shared data
install -m644 "newfs_hfs.tproj/hfsbootdata.img" %{buildroot}/%{_datadir}/%{name}/hfsbootdata
# Copy man pages
install -m644 "newfs_hfs.tproj/newfs_hfs.8" %{buildroot}/%{_mandir}/man8/mkfs.hfsplus.8
install -m644 "fsck_hfs.tproj/fsck_hfs.8" %{buildroot}/%{_mandir}/man8/fsck.hfsplus.8

%files
%{_bindir}/mkfs.hfsplus
%{_bindir}/fsck.hfsplus
%{_datadir}/%{name}
%{_mandir}/man8/*
openSUSE Build Service is sponsored by