-# TODO: Fix issue with the WORDS_BIGENDIAN macro of autoconf-2.63
-# fuse built using autotools is unusable because of it.
+#
# Conditional build:
-%bcond_with svga # do not build svgalib version
-%bcond_without x # do not build X11 version
-%bcond_without fb # do not build framebuffer version
-%bcond_without sdl # do not build SDL version
+%bcond_with svga # svgalib version
+%bcond_without fb # framebuffer version
+%bcond_without gtk2 # GTK+ 2 version
+%bcond_without gtk3 # GTK+ 3 version
+%bcond_without sdl # SDL version
+%bcond_without libao # libao instead of alsa
#
+%define libspectrum_ver 1.4.2
Summary: Free Unix Spectrum Emulator
Summary(pl.UTF-8): Darmowy uniksowy emulator ZX Spectrum
Name: fuse
-Version: 0.10.0.2
-Release: 3
+Version: 1.5.5
+Release: 1
License: GPL v2+
Group: Applications/Emulators
-Source0: http://dl.sourceforge.net/fuse-emulator/%{name}-%{version}.tar.gz
-# Source0-md5: f6e44ad9d3ef6668cbfa60cd4647e024
-Patch0: %{name}-widget.patch
+Source0: http://downloads.sourceforge.net/fuse-emulator/%{name}-%{version}.tar.gz
+# Source0-md5: 21c834410534bcb926e98f5d4ef4c039
+Source1: ti_m397.rom
+# Source1-md5: 8c61b20e1f7666ff80ad7f48bb2b10c0
URL: http://fuse-emulator.sourceforge.net/
-%{?with_sdl:BuildRequires: SDL-devel >= 1.2.4}
+BuildRequires: SDL-devel >= 1.2.4
+%{!?with_libao:BuildRequires: alsa-lib-devel}
BuildRequires: autoconf >= 2.59-9
-BuildRequires: automake
-%{?with_x:BuildRequires: gtk+2-devel >= 1:2.0.0}
+BuildRequires: automake >= 1:1.11
+BuildRequires: glib2-devel >= 1:2.20.0
+%{?with_fb:BuildRequires: gpm-devel}
+%{?with_gtk2:BuildRequires: gtk+2-devel >= 2:2.18.0}
+%{?with_gtk3:BuildRequires: gtk+3-devel >= 3.0}
+%{?with_libao:BuildRequires: libao-devel}
BuildRequires: libjsw-devel
BuildRequires: libpng-devel
-BuildRequires: libsamplerate-devel
-BuildRequires: libspectrum-devel >= 0.5.0
-BuildRequires: libtool
-BuildRequires: libxml2-devel >= 2.0.0
+BuildRequires: libspectrum-devel >= %{libspectrum_ver}
+BuildRequires: libtool >= 2:2
+BuildRequires: libxml2-devel >= 1:2.6.0
BuildRequires: perl-base
BuildRequires: pkgconfig
+BuildRequires: rpmbuild(macros) >= 1.697
+BuildRequires: sed >= 4.0
%{?with_svga:BuildRequires: svgalib-devel}
+BuildRequires: xorg-lib-libX11-devel
+BuildRequires: zlib-devel
BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%description
Summary: Free Unix Spectrum Emulator (common files)
Summary(pl.UTF-8): Darmowy uniksowy emulator ZX Spectrum (pliki wspólne)
Group: Applications/Emulators
-Requires: libspectrum >= 0.4.0
+# actually -common doesn't require these libraries, but all the frontends do
+Requires: glib2 >= 1:2.20.0
+Requires: libspectrum >= %{libspectrum_ver}
+Requires: libxml2-devel >= 1:2.6.0
+Suggests: fdd3000e
%description common
fuse is Free Unix Spectrum Emulator.
W tym pakiecie znajdują się pliki dla wersji korzystającej z svgalib.
-%package X11
-Summary: Free Unix Spectrum Emulator (X11 version)
-Summary(pl.UTF-8): Darmowy uniksowy emulator ZX Spectrum (wersja na XWindow)
+%package gtk
+Summary: Free Unix Spectrum Emulator (GTK+ 2 version)
+Summary(pl.UTF-8): Darmowy uniksowy emulator ZX Spectrum (wersja GTK+ 2)
+Group: Applications/Emulators
+Requires: %{name}-common = %{version}-%{release}
+Requires: gtk+2 >= 2:2.18.0
+Obsoletes: fuse-X11
+
+%description gtk
+fuse is Free Unix Spectrum Emulator.
+What Fuse does have:
+
+* Working 48K/128K/+2/+2A Speccy emulation, running at true Speccy
+ speed on any computer you're likely to try it on (it runs at full
+ speed on a SparcStation 4 unless you do too much graphics intensive
+ stuff).
+* Support for loading from .tzx files.
+* Sound emulation.
+* Emulation of several printers for ZX Spectrum.
+
+This package contains files for GTK+ 2 version.
+
+%description gtk -l pl.UTF-8
+fuse (Free Unix Spectrum Emulator) jest emulatorem ZX Spectrum.
+Jego właściwości to:
+
+* Emulacja ZX Spectrum 48K/128K/+2/+2A.
+* Możliwość ładowania programów z plików .tzx.
+* Dźwięk.
+* Emulacja kilku drukarek przeznaczonych dla ZX Spectrum.
+
+W tym pakiecie znajdują się pliki dla wersji GTK+ 2.
+
+%package gtk3
+Summary: Free Unix Spectrum Emulator (GTK+ 3 version)
+Summary(pl.UTF-8): Darmowy uniksowy emulator ZX Spectrum (wersja GTK+ 3)
Group: Applications/Emulators
Requires: %{name}-common = %{version}-%{release}
+Obsoletes: fuse-X11
-%description X11
+%description gtk3
fuse is Free Unix Spectrum Emulator.
What Fuse does have:
* Sound emulation.
* Emulation of several printers for ZX Spectrum.
-This package contains files for X11 version.
+This package contains files for GTK+ 3 version.
-%description X11 -l pl.UTF-8
+%description gtk3 -l pl.UTF-8
fuse (Free Unix Spectrum Emulator) jest emulatorem ZX Spectrum.
Jego właściwości to:
* Dźwięk.
* Emulacja kilku drukarek przeznaczonych dla ZX Spectrum.
-W tym pakiecie znajdują się pliki dla wersji X11.
+W tym pakiecie znajdują się pliki dla wersji GTK+ 3.
+
+%package -n bash-completion-fuse
+Summary: Bash completion for FUSE emulator commands
+Summary(pl.UTF-8): Bashowe dopełnianie składni poleceń emulatora FUSE
+Group: Applications/Shells
+Requires: %{name}-common = %{version}-%{release}
+Requires: bash-completion >= 2.0
+
+%description -n bash-completion-fuse
+Bash completion for FUSE emulator commands.
+
+%description -n bash-completion-fuse -l pl.UTF-8
+Bashowe dopełnianie składni poleceń emulatora FUSE.
%prep
%setup -q
-#%patch0 -p1
-%build
-#%{__libtoolize}
-#%{__aclocal}
-#%{__autoheader}
-#%{__autoconf}
-#%{__automake}
-
-# X11
-%if %{with x}
-%configure \
- --disable-ui-joystick \
- --with-joystick \
- --with-gtk
-%{__make} clean
-%{__make}
-cp -f fuse fuse-x11
-%endif
+# PLD uses per-backend fuse program instead of just "fuse"
+%{__sed} -i -e '/^complete /s/ fuse$/ fuse-fb fuse-gtk fuse-gtk3 fuse-sdl fuse-svga/' data/shell-completion/bash/fuse
+%build
+%define common_opts \\\
+ --disable-silent-rules \\\
+ --with-bash-completion-dir=%{bash_compdir} \\\
+ %{nil}
# SDL
%if %{with sdl}
-%configure \
- --enable-ui-joystick \
+mkdir build-sdl
+cd build-sdl
+../%configure \
+ %{common_opts} \
+ --program-suffix=-sdl \
--with-sdl
-%{__make} clean
%{__make}
-cp -f fuse fuse-sdl
+cd ..
%endif
# svga
%if %{with svga}
-%configure \
- --enable-ui-joystick \
+mkdir build-svga
+cd build-svga
+../%configure \
+ %{common_opts} \
+ --program-suffix=-svga \
--with-svgalib
-%{__make} clean
%{__make}
-cp -f fuse fuse-svga
+cd ..
%endif
# framebuffer
%if %{with fb}
-%configure \
- --with-joystick \
+mkdir build-fb
+cd build-fb
+../%configure \
+ %{common_opts} \
+ --program-suffix=-fb \
+%if %{with libao}
+ --without-alsa \
+ --with-libao \
+%endif
--with-fb
-%{__make} clean
%{__make}
-cp -f fuse fuse-fb
+cd ..
+%endif
+
+# gtk
+%if %{with gtk2}
+mkdir build-gtk2
+cd build-gtk2
+../%configure \
+ %{common_opts} \
+ --program-suffix=-gtk \
+%if %{with libao}
+ --without-alsa \
+ --with-libao \
+%endif
+ --with-gtk
+%{__make}
+cd ..
+%endif
+
+# gtk3
+%if %{with gtk3}
+mkdir build-gtk3
+cd build-gtk3
+../%configure \
+ %{common_opts} \
+ --enable-gtk3 \
+ --program-suffix=-gtk3 \
+%if %{with libao}
+ --without-alsa \
+ --with-libao \
+%endif
+ --with-gtk
+%{__make}
+cd ..
%endif
%install
rm -rf $RPM_BUILD_ROOT
+%if %{with sdl}
+%{__make} -C build-sdl install \
+ DESTDIR=$RPM_BUILD_ROOT
+%endif
-%{__make} install \
+%if %{with svga}
+%{__make} -C build-svga install \
DESTDIR=$RPM_BUILD_ROOT
+%endif
-%{?with_svga:install fuse-svga $RPM_BUILD_ROOT%{_bindir}}
-%{?with_x:install fuse-x11 $RPM_BUILD_ROOT%{_bindir}}
-%{?with_fb:install fuse-fb $RPM_BUILD_ROOT%{_bindir}}
-%{?with_sdl:install fuse-sdl $RPM_BUILD_ROOT%{_bindir}}
+%if %{with fb}
+%{__make} -C build-fb install \
+ DESTDIR=$RPM_BUILD_ROOT
+%endif
+
+%if %{with gtk2}
+%{__make} -C build-gtk2 install \
+ DESTDIR=$RPM_BUILD_ROOT
+%endif
+
+%if %{with gtk3}
+%{__make} -C build-gtk3 install \
+ DESTDIR=$RPM_BUILD_ROOT
+%endif
+
+cp -p %{SOURCE1} $RPM_BUILD_ROOT%{_datadir}/%{name}
%clean
rm -rf $RPM_BUILD_ROOT
%files common
%defattr(644,root,root,755)
-%doc README THANKS AUTHORS keysyms.dat keysyms.pl hacking/*
+%doc README THANKS AUTHORS ChangeLog keysyms.dat keysyms.pl hacking/*.txt
%{_datadir}/%{name}
-%{_mandir}/man1/fuse.1*
%if %{with fb}
%files fb
%defattr(644,root,root,755)
%attr(755,root,root) %{_bindir}/fuse-fb
+%{_mandir}/man1/fuse-fb.1*
+%endif
+
+%if %{with gtk2}
+%files gtk
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/fuse-gtk
+%{_mandir}/man1/fuse-gtk.1*
+%endif
+
+%if %{with gtk3}
+%files gtk3
+%defattr(644,root,root,755)
+%attr(755,root,root) %{_bindir}/fuse-gtk3
+%{_mandir}/man1/fuse-gtk3.1*
%endif
%if %{with sdl}
%files sdl
%defattr(644,root,root,755)
%attr(755,root,root) %{_bindir}/fuse-sdl
+%{_mandir}/man1/fuse-sdl.1*
%endif
%if %{with svga}
%files svga
%defattr(644,root,root,755)
%attr(755,root,root) %{_bindir}/fuse-svga
+%{_mandir}/man1/fuse-svga.1*
%endif
-%if %{with x}
-%files X11
+%files -n bash-completion-fuse
%defattr(644,root,root,755)
-%attr(755,root,root) %{_bindir}/fuse-x11
-%endif
+%{bash_compdir}/fuse