Name: anarch Summary: Suckless, anarcho-pacifist, 90s-style Doom clone that runs everywhere License: CC0 %global git_date 20210616 %global git_commit f6a6a68a890716cd394c6fb2d00bd8123b51b18f %global git_commit_short %(c='%{git_commit}'; echo "${c:0:8}") Version: 1.02d Release: 1.%{git_date}git%{git_commit_short}%{?dist} URL: https://drummyfish.gitlab.io/anarch/ Source0: https://gitlab.com/drummyfish/%{name}/-/archive/%{git_commit}/%{name}-%{git_commit}.tar.gz Source100: %{name}-sdl2.desktop Source101: %{name}-sdl2.appdata.xml BuildRequires: desktop-file-utils BuildRequires: libappstream-glib BuildRequires: gcc-c++ BuildRequires: SDL2-devel %description Anarch is an extremely small, completely Public Domain, no-dependency, no-file, portable suckless anarcho-pacifist from-scratch 90s-style Doom clone that runs everywhere, made for the benefit of all living beings. %prep %setup -q -n %{name}-%{git_commit} %build # The can be built in many versions. # The Linux ones are: terminal, SDL2, CSFML. # # The terminal version is experimental and needs to be ran as root, # as it uses /dev/input and /dev/tty for IO. # # The CSFML version... Fedora has SFML packaged, but not CSFML. # # This leaves us with (for the moment?) only the SDL2 version. gcc %{optflags} -std=c99 -lSDL2 -o %{name}-sdl2 main_sdl.c # Also build the test executable. gcc %{optflags} -std=c99 -o %{name}-test main_test.c %install install -m 755 -d %{buildroot}%{_bindir} install -m 755 -p %{name}-sdl2 -t %{buildroot}%{_bindir} ICON_DIR='%{buildroot}%{_datadir}/icons/hicolor/128x128/apps' install -m 755 -d "${ICON_DIR}" install -m 644 -p media/logo_big.png "${ICON_DIR}/%{name}-sdl2.png" install -m 755 -d %{buildroot}%{_datadir}/applications install -m 644 -p %{SOURCE100} -t %{buildroot}%{_datadir}/applications install -m 755 -d %{buildroot}%{_metainfodir} install -m 644 -p %{SOURCE101} -t %{buildroot}%{_metainfodir} %check ./%{name}-test desktop-file-validate %{buildroot}%{_datadir}/applications/%{name}-sdl2.desktop appstream-util validate-relax --nonet %{buildroot}%{_metainfodir}/%{name}-sdl2.appdata.xml %files %doc README.md %license LICENSE %{_bindir}/%{name}-sdl2 %{_datadir}/applications/%{name}-sdl2.desktop %{_datadir}/icons/hicolor/*/apps/%{name}-sdl2.png %{_metainfodir}/%{name}-sdl2.appdata.xml %changelog * Wed Jun 30 2021 Artur Frenszek-Iwicki - 1.02d-1.20210617gitf6a6a68a8 - Initial packaging