#
# spec file for package Dosemu2
#
# Written by Mateusz Viste for the DOSEMU2 project.
# updated by stsp
#

Name: @PACKAGE_NAME@
Version: @PACKAGE_VERSION@
Release: 1%{?dist}
Summary: The DOS emulator for Linux

Group: System/Emulator

License: GPL-2.0+
URL: www.github.com/stsp/dosemu2
Source0: %{name}-%{version}.tar.gz

BuildRequires: SDL2-devel
BuildRequires: libXext-devel
BuildRequires: alsa-lib-devel
BuildRequires: fluidsynth-devel
BuildRequires: gpm-devel
BuildRequires: libao-devel
BuildRequires: ladspa-devel
BuildRequires: slang-devel
BuildRequires: bison
BuildRequires: flex
BuildRequires: autoconf
BuildRequires: automake
BuildRequires: sed
BuildRequires: perl
BuildRequires: bash
BuildRequires: git >= 2.0
BuildRequires: xorg-x11-font-utils
BuildRequires: linuxdoc-tools
BuildRequires: coreutils
BuildRequires: binutils-devel

# the below is not strictly required, as dosemu can dynamically
# load plugins.
Recommends: SDL2
Recommends: libXext
Recommends: alsa-lib
Recommends: fluidsynth
Suggests:   fluid-soundfont-gm
Suggests:   timidity++ >= 2.14.0
Recommends: gpm-libs
Recommends: libao
Recommends: ladspa
Recommends: slang

# cannot coexist with dosemu1
Conflicts:  dosemu

%description
DOSEMU2 stands for DOS Emulation, and allows you to run DOS and many
DOS programs, including many DPMI applications such as DOOM and Windows 3.1,
under Linux.

%prep
%setup -q

%build
./autogen.sh
./default-configure --prefix=%{_prefix} --libdir=%{_libdir} \
	--sysconfdir=%{_sysconfdir} --enable-debug
# can't use %%configure because of this:
# https://bugzilla.redhat.com/show_bug.cgi?id=1343892
# additionally have to use double-percent for comments:
# https://docs.fedoraproject.org/en-US/Fedora_Draft_Documentation/0.1/html/Packagers_Guide/chap-Packagers_Guide-Spec_File_Reference-Comments.html
#%%configure
make %{?_smp_mflags}

%check

%install
mkdir -p %{buildroot}%{_sysconfdir}/X11/fontpath.d
make DESTDIR=%{buildroot} install

%files
%defattr(-,root,root)
%{_bindir}/*
%{_mandir}/man1/*
%lang(ru) %dir %{_mandir}/ru
%lang(ru) %dir %{_mandir}/ru/man1
%lang(ru) %{_mandir}/ru/man1/*
%{_libdir}/dosemu
%{_datadir}/dosemu
%{_sysconfdir}/X11/fontpath.d/dosemu2*
%doc %{_docdir}/dosemu2
%dir %{_sysconfdir}/dosemu
%config(noreplace) %{_sysconfdir}/dosemu/dosemu.conf

%changelog
