File vice.spec of Package vice33
#
# spec file for package vice
#
# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany.
#
# 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/
#
%define _configure ../configure
Name: vice
Version: 3.3
Release: 0
Summary: Emulator of Numerous Commodore 8-Bit Computers
License: GPL-2.0+
Group: System/Emulators/Other
Url: http://vice-emu.sourceforge.net
#Source: %{name}-%{version}-no-roms.tar.gz
Source: %{name}-%{version}.tar.gz
# script to regenerate tarball without roms
Source100: generate-tarball.sh
Source101: vice-roms.txt
Source102: README.SuSE
# PATCH-FIX-OPENSUSE vice-remove-rom-installation.patch gber@opensuse.org -- Do not try to install non-existing ROMs
Patch0: vice-remove-rom-installation.patch
# PATCH-FIX-OPENSUSE vice-use-xdg-open.patch gber@opensuse.org -- Call xdg-open instead of firefox
Patch1: vice-use-xdg-open.patch
BuildRequires: Mesa-devel
BuildRequires: bdftopcf
BuildRequires: bison
BuildRequires: dos2unix
BuildRequires: fdupes
BuildRequires: flex
BuildRequires: gcc-c++
BuildRequires: gettext
BuildRequires: giflib-devel
BuildRequires: info
BuildRequires: libSDL_sound-devel
%if 0%{?suse_version} < 1500
BuildRequires: libieee1284-devel
%endif
BuildRequires: libjpeg-devel
BuildRequires: libpcap-devel
BuildRequires: mkfontdir
BuildRequires: update-desktop-files
BuildRequires: perl
BuildRequires: readline-devel
BuildRequires: xa
BuildRequires: pkgconfig(alsa)
BuildRequires: pkgconfig(gtk+-3.0)
BuildRequires: pkgconfig(libpng)
BuildRequires: pkgconfig(libpulse)
BuildRequires: pkgconfig(sdl2)
#BuildRequires: pkgconfig(vte)
BuildRequires: vte-devel
BuildRequires: pkgconfig(x11)
BuildRequires: pkgconfig(xrandr)
BuildRequires: pkgconfig(xxf86vm)
BuildRequires: pkgconfig(zlib)
Requires(post): info
Requires(preun): info
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%description
VICE is an emulator for numerous Commodore 8-bit computers including the C64,
the C64DTV, the C128, the VIC20, almost all PET models, the PLUS4 and the
CBM-II (aka C610).
%package gtk
Summary: GTK Frontend for vice
Group: System/Emulators/Other
License: GPL-2.0+
Requires: %{name} = %{version}
Requires: xdg-utils
Recommends: %{name}-lang
%description gtk
This package provides the GTK frontend for vice.
%lang_package
%prep
%setup -q
#%patch0 -p1
#%patch1 -p1
cp %{SOURCE101} vice-roms.txt
cp %{SOURCE102} README.SuSE
%build
mkdir build-sdlui
pushd build-sdlui
%configure \
--with-sdlsound \
--without-oss \
--enable-sdlui \
--enable-ethernet \
--enable-parsid \
--disable-arch
make %{?_smp_mflags} V=1 VICEDIR=%{_datadir}/%{name}
popd
mkdir build-gnomeui
pushd build-gnomeui
%configure \
--with-sdlsound \
--without-oss \
--enable-native-gtk3ui \
--enable-ethernet \
--enable-parsid \
--disable-arch
make %{?_smp_mflags} V=1 VICEDIR=%{_datadir}/%{name}
popd
%install
pushd build-gnomeui
%makeinstall VICEDIR=%{_datadir}/%{name}
for bin in %{buildroot}%{_bindir}/x*; do
mv "${bin}" "${bin}-gtk"
done
# install -D -p -m 644 ../src/arch/unix/x11/c128icon.c "%{buildroot}%{_datadir}/pixmaps/x128.xpm"
#suse_update_desktop_file -c x128-gtk "VICE C-128" "Commodore C-128 Emulator" x128-gtk x128 System Emulator
# install -D -p -m 644 ../src/arch/unix/x11/c64icon.c "%{buildroot}%{_datadir}/pixmaps/x64.xpm"
#suse_update_desktop_file -c x64-gtk "VICE C-64" "Commodore C-64 Emulator" x64-gtk x64 System Emulator
#suse_update_desktop_file -c x64dtv-gtk "VICE C-64 DTV" "Commodore C-64 DTV Emulator" x64dtv-gtk x64 System Emulator
# install -D -p -m 644 ../src/arch/unix/x11/cbm2icon.c "%{buildroot}%{_datadir}/pixmaps/xcbm2.xpm"
#suse_update_desktop_file -c xcbm2-gtk "VICE CBM-II" "Commodore CBM-II Emulator" xcbm2-gtk xcbm2 System Emulator
#suse_update_desktop_file -c xcbm5x0-gtk "VICE CBM-II (5x0)" "Commodore CBM-II (5x0 Models) Emulator" xcbm5x0-gtk xcbm2 System Emulator
# install -D -p -m 644 ../src/arch/unix/x11/peticon.c "%{buildroot}%{_datadir}/pixmaps/xpet.xpm"
#suse_update_desktop_file -c xpet-gtk "VICE PET" "Commodore PET Emulator" xpet-gtk xpet System Emulator
# install -D -p -m 644 ../src/arch/unix/x11/plus4icon.c "%{buildroot}%{_datadir}/pixmaps/xplus4.xpm"
#suse_update_desktop_file -c xplus4-gtk "VICE PLUS/4" "Commodore PLUS/4 Emulator" xplus4-gtk xplus4 System Emulator
# install -D -p -m 644 ../src/arch/unix/x11/vic20icon.c "%{buildroot}%{_datadir}/pixmaps/xvic.xpm"
#suse_update_desktop_file -c xvic-gtk "VICE VIC20" "Commodore VIC20 Emulator" xvic-gtk xvic System Emulator
popd
pushd build-sdlui
%makeinstall VICEDIR=%{_datadir}/%{name}
popd
# remove non-info file
rm %{buildroot}/%{_infodir}/vice.txt
# remove and symlink to openSUSE default doc directory
mv %{buildroot}/%{_datadir}/vice/doc installed-doc
mkdir -p %{buildroot}%{_defaultdocdir}/%{name}
ln -s %{_defaultdocdir}/%{name} %{buildroot}/%{_datadir}/vice/doc
chmod -x AUTHORS README
%fdupes %{buildroot}
#find_lang %{name} %{?no_lang_C}
%post
%install_info --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz
%preun
%install_info_delete --info-dir=%{_infodir} %{_infodir}/%{name}.info.gz
%post gtk
%desktop_database_post
%postun gtk
%desktop_database_postun
%files
%defattr(-,root,root)
%doc AUTHORS ChangeLog.* FEEDBACK README README.SuSE vice-roms.txt
%doc installed-doc/*
%{_bindir}/c1541
%{_bindir}/cartconv
%{_bindir}/petcat
%{_bindir}/vsid
%{_bindir}/x128
%{_bindir}/x64
%{_bindir}/x64dtv
%{_bindir}/x64sc
%{_bindir}/xcbm2
%{_bindir}/xcbm5x0
%{_bindir}/xpet
%{_bindir}/xplus4
%{_bindir}/xscpu64
%{_bindir}/xvic
%{_datadir}/vice
#%{_datadir}/pixmaps/*.xpm
%{_mandir}/man1/c1541.1*
%{_mandir}/man1/cartconv.1*
%{_mandir}/man1/petcat.1*
%{_mandir}/man1/vice.1*
%{_infodir}/vice.info.gz
%files gtk
%defattr(-,root,root)
%{_bindir}/x128-gtk
%{_bindir}/x64-gtk
%{_bindir}/x64dtv-gtk
%{_bindir}/x64sc-gtk
%{_bindir}/xcbm2-gtk
%{_bindir}/xcbm5x0-gtk
%{_bindir}/xpet-gtk
%{_bindir}/xplus4-gtk
%{_bindir}/xscpu64-gtk
%{_bindir}/xvic-gtk
#%{_datadir}/applications/*.desktop
#%files lang -f %{name}.lang
%changelog