File hakuneko.spec of Package hakuneko
#
# spec file for package hakuneko
#
# Copyright (c) 2025 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/
#
Name: hakuneko
Version: 6.1.7
Release: 1%{?dist}
Summary: Manga & Anime Downloader for Linux, Windows & macOS
License: Unlicense
URL: https://hakuneko.download/
%if 0%{?suse_version} == 1500
Group: Productivity/Multimedia/Other
%else
Group: Applications/Multimedia
%endif
ExclusiveArch: x86_64 i586
%ifarch x86_64
%define darch amd64
%endif
%ifarch i586
%define darch i386
%endif
Source0: hakuneko-desktop_%{version}_linux_%{darch}.rpm
BuildRequires: rpm-build
BuildRequires: cpio
BuildRequires: desktop-file-utils
BuildRequires: hicolor-icon-theme
Requires: xdg-utils
PreReq: permissions
Conflicts: hakuneko, hakuneko-desktop
%description
HakuNeko is a cross-platform manga and anime downloader that allows users to download media for offline usage. It supports various websites and provides a user-friendly interface for managing downloads.
%prep
# No preparation needed as we are using pre-built binaries
%build
# No build steps required for pre-built binaries
%install
# Extract RPM contents into builddir
rpm2cpio %{SOURCE0} | cpio -idmv
# Install main directory
install -d -m 755 %{buildroot}/usr/lib/hakuneko-desktop
cp -a usr/lib/hakuneko-desktop/* %{buildroot}/usr/lib/hakuneko-desktop/
# chrome-sandbox require special permissions for setuid/setguid
install -m 4755 usr/lib/hakuneko-desktop/chrome-sandbox %{buildroot}/usr/lib/hakuneko-desktop/chrome-sandbox
# Symlink binary (keep name as hakuneko for convenience)
install -d -m 755 %{buildroot}/usr/bin
ln -sf /usr/lib/hakuneko-desktop/hakuneko %{buildroot}/usr/bin/hakuneko
# Install icon
for size in 16x16 24x24 32x32 48x48 64x64 96x96 128x128 256x256; do
if [ -f usr/share/icons/hicolor/$size/apps/hakuneko-desktop.png ]; then
install -d -m 755 %{buildroot}/usr/share/icons/hicolor/$size/apps
install -m 644 usr/share/icons/hicolor/$size/apps/hakuneko-desktop.png \
%{buildroot}/usr/share/icons/hicolor/$size/apps/hakuneko-desktop.png
fi
done
# man page
install -d -m 755 %{buildroot}/usr/share/man/man1
install -m 644 usr/share/man/man1/hakuneko-desktop.1.gz \
%{buildroot}/usr/share/man/man1/hakuneko-desktop.1.gz
# Install desktop entry
install -d -m 755 %{buildroot}/usr/share/applications
install -m 644 usr/share/applications/hakuneko-desktop.desktop \
%{buildroot}/usr/share/applications/hakuneko-desktop.desktop
# Strip unneeded binary bits (suppress rpm lint warnings)
find %{buildroot}/usr/lib/hakuneko-desktop -type f -name "*.so*" -exec chrpath --delete {} \; || :
find %{buildroot}/usr/lib/hakuneko-desktop -type f -name "*.so*" -exec execstack -c {} \; || :
find %{buildroot}/usr/lib/hakuneko-desktop -type f -perm /111 -exec strip --strip-unneeded {} \; || true
%post
if [ -x /usr/bin/update-desktop-database ]; then
/usr/bin/update-desktop-database -q
fi
if [ -x /usr/bin/gtk-update-icon-cache ]; then
/usr/bin/gtk-update-icon-cache -q /usr/share/icons/hicolor
fi
%postun
if [ -x /usr/bin/update-desktop-database ]; then
/usr/bin/update-desktop-database -q
fi
if [ -x /usr/bin/gtk-update-icon-cache ]; then
/usr/bin/gtk-update-icon-cache -q /usr/share/icons/hicolor
fi
%verifyscript
%verify_permissions -e /usr/lib/hakuneko-desktop/chrome-sandbox
%check
# empty
%files
%defattr(-,root,root)
%attr(0755, root, root) /usr/lib/hakuneko-desktop/chrome-sandbox
/usr/lib/hakuneko-desktop/
/usr/bin/hakuneko
/usr/share/icons/hicolor/{16x16,24x24,32x32,48x48,64x64,96x96,128x128,256x256}/apps/hakuneko-desktop.png
/usr/share/applications/hakuneko-desktop.desktop
/usr/share/man/man1/hakuneko-desktop.1.gz
%changelog
* Thu Jul 22 2025 karaczan - 6.1.7-1
- Initial packaging of HakuNeko 6.1.7 for x86_64 and i386 architectures.