# Versions are like 1.0.5-r619. The first part (1.0.5 in this example) # goes into the Version: field, the rest (rc2-r619 here) into %%src_release. %global src_release 619 %global src_version %{version}-r%{src_release} %global repo_url https://downloads.sourceforge.net/project/%{name}/%{version}/ Summary: Cars Sports Racing: Simulation Name: cars-sports-racing Version: 1.0.5 Release: %autorelease Epoch: 1 # Contains LGPLv2 files also published under GPLv2+ License: GPL-3.0-or-later AND GPL-2.0-or-later AND CC-BY-SA-4.0 URL: https://www.cars-sports-racing.net/ Source0: %{?repo_url}%{name}-src-base-%{src_version}.tar.xz Source1: %{name}.desktop ExcludeArch: s390x Provides: %{name} = %{epoch}:%{version}-%{release} Requires: %{name}-data-base = %{epoch}:%{version} Requires: opengl-games-utils BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: cmake BuildRequires: chrpath BuildRequires: libcurl-devel BuildRequires: desktop-file-utils BuildRequires: enet-devel BuildRequires: expat-devel BuildRequires: freealut-devel BuildRequires: freeglut-devel BuildRequires: FreeSOLID-devel BuildRequires: libGL-devel BuildRequires: libjpeg-devel BuildRequires: libpng-devel BuildRequires: libXi-devel BuildRequires: libXmu-devel BuildRequires: libXrandr-devel BuildRequires: plib-devel BuildRequires: SDL2-devel BuildRequires: SDL2_mixer-devel BuildRequires: libogg-devel BuildRequires: libvorbis-devel # Dont provide or require internal libs. Using new rpm builtin filtering, # see http://www.rpm.org/wiki/PackagerDocs/DependencyGenerator %global __requires_exclude liblearning.so %global __requires_exclude %{__requires_exclude}|libcsnetworking.so %global __requires_exclude %{__requires_exclude}|libraceengine.so %global __requires_exclude %{__requires_exclude}|librobottools.so %global __requires_exclude %{__requires_exclude}|libtgf.so %global __requires_exclude %{__requires_exclude}|libtgfclient.so %global __requires_exclude %{__requires_exclude}|libtgfdata.so %global __requires_exclude %{__requires_exclude}|libportability.so %global __provides_exclude_from %{_libdir}/games/cars-sports-racing/.*\\.so %description A fork of the open racing car simulator Speed Dreams, itself being a fork of Torcs. This project implementing challenges for the player to pass allowing them to unlock the levels. For the moment, just OpenGL1 (with PLIB) is implemented. Best lap recorded in master-server and in the future, hall of fame for championship ranking. The goal in the future is to have a career mode integrated into the game engine %package data-base Summary: The Open Racing Car Simulator additional dirt tracks BuildArch: noarch Provides: %{name} = %{epoch}:%{version}-%{release} %description data-base This package contains base tracks and cars for the game. %package devel Summary: The Cars Sports Racing development files Requires: %{name}%{?_isa} = %{epoch}:%{version}-%{release} %description devel This package contains the development files for the game. %prep %setup -q -c -n %{name}-src-base-%{version}-%{release} # fixes spurious-executable-perm find . -name '*.c' -o -name '*.h' -o -name '*.cpp' -o -name '*.hpp' | \ xargs chmod 644 %build %cmake -DCMAKE_BUILD_TYPE:STRING=Release \ -DCMAKE_SKIP_RPATH:BOOL=OFF \ -DOPTION_DEBUG:STRING=ON \ -DCMAKE_SHARED_LINKER_FLAGS="-Wl,--as-needed" \ -DCSR_BINDIR:PATH=bin \ -DOPTION_3RDPARTY_SOLID:BOOL=ON \ -DOPTION_TRACKEDITOR:BOOL=OFF \ -DOPTION_OFFICIAL_ONLY:BOOL=ON \ -DOPTION_CLIENT_SERVEUR:BOOL=ON \ -DOPTION_WEBSERVER:BOOL=ON %cmake_build %install %cmake_install find %{buildroot} -type f -name "*.cmake" -delete desktop-file-install \ --dir %{buildroot}%{_datadir}/applications \ %{SOURCE1} # Register as an application to be visible in the software center mkdir -p %{buildroot}%{_datadir}/appdata cp packaging/appdata/%{name}.appdata.xml %{buildroot}%{_datadir}/appdata/%{name}.appdata.xml pushd %{buildroot}%{_libdir}/games/%{name} # Change rpath to refer only private lib dir. for lib in $(find . -type f -name \*.so ); do # Bug: cmake should make so-files 755 on Fedora by default. chmod 755 $lib chrpath --replace %{_libdir}/games/%{name}/lib $lib done # https://sourceforge.net/p/speed-dreams/tickets/730/ cd drivers for base in usr shadow axiom; do for lib in ${base}_*; do cd $lib cmp ../$base/$base.so *.so && ln -sf ../$base/$base.so *.so cd .. done done # Check that %%{buildroot}%%{_libdir}/games/%%{name}/lib doesn't # contain unfiltered libs. cd ../lib excluded=$( echo '%{__requires_exclude}' | tr '|' ':' ) for lib in *.so; do if [ "${excluded/${lib}/}" = "$excluded" ]; then echo "ERROR: $lib not filtered in __requires_exclude" >&2 exit 2 fi done popd # removed userman and faq documentation, because it's depreciated rm -rf docs; mkdir docs cp -a %{buildroot}%{_datadir}/games/%{name}/*.txt docs cp -a %{buildroot}%{_datadir}/games/%{name}/*.xml docs # remove zero length files find %{buildroot} -size 0 -delete %files %license COPYING.txt %doc docs/*.xml docs/*.txt %{_mandir}/man6/* %{_bindir}/%{name} %{_bindir}/csr-* %{_libdir}/games/%{name}/ %{_datadir}/appdata/%{name}.appdata.xml %{_datadir}/applications/%{name}.desktop %{_datadir}/games/%{name}/ %exclude %{_datadir}/games/%{name}/cars/ %exclude %{_datadir}/games/%{name}/config/ %exclude %{_datadir}/games/%{name}/data/ %exclude %{_datadir}/games/%{name}/drivers/ %exclude %{_datadir}/games/%{name}/tracks/ %files data-base %{_datadir}/games/%{name}/cars/ %{_datadir}/games/%{name}/config/ %{_datadir}/games/%{name}/data/ %{_datadir}/games/%{name}/drivers/ %{_datadir}/games/%{name}/tracks/ %files devel %{_includedir}/%{name}/ %changelog * Fri Nov 15 2024 Xavier Bertaux - 1:1.0.5-1 - First import