File SheepShaver.spec of Package SheepShaver

#
# spec file for package SheepShaver
#
# Copyright (c) 2025 SUSE LLC and contributors
#
# 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:           SheepShaver
Version:        2.4_git20250106
Release:        0
Summary:        MacOS run-time environment
License:        GPL-2.0-only
Group:          System/Emulators/Other
URL:            http://sheepshaver.cebix.net/
Source0:        %{name}-%{version}.tar.xz
Patch1:         no_std_headers_check.patch
ExcludeArch:    aarch64 ppc %{power64} s390 s390x
BuildRequires:  ImageMagick
BuildRequires:  automake
BuildRequires:  gcc-c++
BuildRequires:  gtk2-devel
BuildRequires:  libICE-devel
BuildRequires:  libSM-devel
BuildRequires:  libX11-devel
BuildRequires:  libXext-devel
BuildRequires:  libXxf86dga-devel
BuildRequires:  libXxf86vm-devel
BuildRequires:  pkg-config
BuildRequires:  update-desktop-files
%{?systemd_requires}

%description
SheepShaver is a MacOS run-time environment for Linux that allows you to run MacOS applications at native speed inside the Linux multitasking environment on PowerPC-based Linux systems. This means that both Linux and MacOS applications can run at the same time and data can be exchanged between them.

SheepShaver is neither a MacOS replacement nor an emulator. It runs an unmodified PowerPC MacOS under control of Linux at full speed without any kind of emulation. So it also uses the MacOS 68k emulator to run 68k applications. In this way, SheepShaver is comparable to the "Blue Box" of Apple's Rhapsody operating system.

Some of SheepShaver's features:

* Compatibility: SheepShaver runs MacOS 7.5.2 thru 9.0.4 with all system extensions like AppleGuide, AppleScript, QuickTime, QuickTime VR, QuickDraw 3D, Open Transport, PPP, Language Kits, ColorSync, etc.
* Graphics: The MacOS user interface is displayed in an X11 window or full-screen (requires DGA)
* Sound: CD-quality stereo sound output
* Networking: SheepShaver supports Internet and LAN networking via Ethernet and PPP with all Open Transport compatible MacOS applications.
* Volumes: Any HFS or HFS+ volume can be used with SheepShaver (this includes Zip/Jaz/SyQuest drives etc.). It also features a built-in CD-ROM driver and a driver for HD floppy disks.
* Data Exchange: You can access Linux files from the MacOS via a "Linux" icon on the Mac desktop and copy and paste text between Linux and MacOS

%prep
%autosetup -p1

%build
%global pkg_optflags "-O2 -g -fmessage-length=0 -D_FORTIFY_SOURCE=2 -fstack-protector"
CFLAGS="${CFLAGS:-%{pkg_optflags}}"
CXXFLAGS="${CXXFLAGS:-%{pkg_optflags}}"
%if 0%{?suse_version} && 0%{?suse_version} > 1500
CXXFLAGS="${CXXFLAGS} -DSTDC_HEADERS=1"
%endif
export CFLAGS CXXFLAGS
cd %{_builddir}/%{name}-%{version}/%{name}
%{__make} links
cd src/Unix

# workaround fix for bug in CrossPlatform change
%{__rm} -f sigsegv.* video_blit.* video_vosf.* vm_alloc.*
%{__ln_s} ../CrossPlatform/*.cpp .
%{__ln_s} ../CrossPlatform/*.h .

./autogen.sh --prefix=/usr --with-bincue
%{__make} %{?_smp_mflags}
%{__strip} -s %{name}
/usr/bin/convert %{_builddir}/%{name}-%{version}/%{name}/doc/Linux/icon.gif -transparent '#ffffff' png32:%{name}.png

%install
cd %{_builddir}/%{name}-%{version}/%{name}/src/Unix
%{__make} install DESTDIR=%{buildroot}
%{__mkdir_p} %{buildroot}%{_datadir}/pixmaps
%{__mkdir_p} %{buildroot}%{_defaultdocdir}/%{name}
%{__mkdir_p} %{buildroot}%{_defaultdocdir}/%{name}/doc
%{__mkdir_p} %{buildroot}%{_sysconfdir}/sysctl.d
%{__install} -m 0644 -p -t %{buildroot}%{_datadir}/pixmaps %{name}.png
%{__install} -m 0644 -p -t %{buildroot}%{_defaultdocdir}/%{name} %{_builddir}/%{name}-%{version}/%{name}/NEWS
%{__install} -d -m 0755 %{buildroot}%{_defaultlicensedir}/%{name}
%{__install} -m 0644 -p -t %{buildroot}%{_defaultlicensedir}/%{name} %{_builddir}/%{name}-%{version}/%{name}/COPYING
%{__install} -m 0644 -p -t %{buildroot}%{_defaultdocdir}/%{name}/doc %{_builddir}/%{name}-%{version}/%{name}/doc/Linux/*
echo "vm.mmap_min_addr = 0" > %{buildroot}%{_sysconfdir}/sysctl.d/%{name}.conf
%suse_update_desktop_file -c %{name} %{name} "%{summary}" %{name} %{name} System Emulator

%check

%if 0%{?suse_version} && 0%{?suse_version} < 1600
%post
%if 0%{?suse_version} && 0%{?suse_version} < 1500
%desktop_database_post
%endif
%restart_on_update
%endif

%if 0%{?suse_version} && 0%{?suse_version} < 1600
%postun
%if 0%{?suse_version} && 0%{?suse_version} < 1500
%desktop_database_postun
%endif
%restart_on_update
%endif

%files
%defattr(-,root,root,-)
%dir %{_sysconfdir}/sysctl.d
%attr(755,root,root) %{_bindir}/%{name}
%{_datadir}/%{name}/
%{_mandir}/man1/%{name}.1.gz
%{_datadir}/pixmaps/%{name}.png
%{_datadir}/applications/%{name}.desktop
%config %{_sysconfdir}/sysctl.d/%{name}.conf
%{_defaultdocdir}/%{name}/
%{_defaultlicensedir}/%{name}/

%changelog
openSUSE Build Service is sponsored by