# swy: reminder; these things get built with 'rpmbuild -ba openbrf.spec -vvv' Name: openbrf Version: %(TZ=UTC date +'%Y.%m.%d_%H.%M') Release: 1 Summary: Mount&Blade resource editor by Marco Tarini and Swyter License: GPL-2.0-or-later URL: https://forum.taleworlds.com/?threads/462517 %define giturl https://github.com/Swyter/openbrf-redux BuildRequires: gcc BuildRequires: make BuildRequires: git BuildRequires: coreutils BuildRequires: icoutils BuildRequires: mesa-libGLU-devel Requires: mesa-libGLU Requires: qt6-qtbase-common Requires: hicolor-icon-theme BuildArch: i686 x86_64 aarch64 %description %{summary} %prep git clone %{giturl}.git openbrf-redux %build cd "openbrf-redux/_build" # extract all the Windows icon sub-images, we can later grab the 256px # version and use it in Linux as XDG PNG icon. icotool -x ../openBrf.ico # build it as fast as possible, but leaving a free CPU core for other stuff! qmake6 -makefile ../openBrf.pro make -j $[ (n = `nproc` - 1) < 1 ? 1 : n ] # swy: don't make the thread count zero (-j 0) when there's only one available core (due to the system-threads - 1 thing) %install # swy: reuse the Arch Linux PKGBUILD lines pkgdir="${RPM_BUILD_ROOT}"; srcdir="./" mkdir -p "${pkgdir}/opt/openbrf" mkdir -p "${pkgdir}/opt/openbrf/translations" install -D -m711 -s "${srcdir}/openbrf-redux/_build/openBrf" "${pkgdir}/opt/openbrf/openbrf" install -D -m644 "${srcdir}/openbrf-redux/_build/carry_positions.txt" "${pkgdir}/opt/openbrf" install -D -m644 "${srcdir}/openbrf-redux/_build/customPreviewShaders.xml" "${pkgdir}/opt/openbrf" install -D -m644 "${srcdir}/openbrf-redux/_build/reference.brf" "${pkgdir}/opt/openbrf" install -D -m644 "${srcdir}/openbrf-redux/_build/translations/"* "${pkgdir}/opt/openbrf/translations" mkdir -p "${pkgdir}/usr/bin" echo '#!/usr/bin/env sh' > "${pkgdir}/usr/bin/openbrf" echo 'env LC_NUMERIC=C /opt/openbrf/openbrf "$@"' >> "${pkgdir}/usr/bin/openbrf" chmod 755 "${pkgdir}/usr/bin/openbrf" install -D -m644 "${srcdir}/openbrf-redux/_build/openBrf_6_256x256x32.png" "${pkgdir}/opt/openbrf/openbrf.png" install -D -m644 "${srcdir}/openbrf-redux/_build/openBrf_6_256x256x32.png" "${pkgdir}/usr/share/pixmaps/openbrf.png" install -D -m644 "${srcdir}/openbrf-redux/_build/openBrf_6_256x256x32.png" "${pkgdir}/usr/share/icons/hicolor/256x256/apps/openbrf.png" install -D -m644 "${srcdir}/openbrf-redux/_build/openBrf_7_48x48x32.png" "${pkgdir}/usr/share/icons/hicolor/48x48/apps/openbrf.png" install -D -m644 "${srcdir}/openbrf-redux/_build/openBrf_8_32x32x32.png" "${pkgdir}/usr/share/icons/hicolor/32x32/apps/openbrf.png" install -D -m644 "${srcdir}/openbrf-redux/_build/openBrf_9_16x16x32.png" "${pkgdir}/usr/share/icons/hicolor/16x16/apps/openbrf.png" # add a shortcut that handles application/x-openbrf files mkdir -p "${pkgdir}/usr/share/applications" cat < "${pkgdir}/usr/share/applications/openbrf.desktop" #!/usr/bin/env xdg-open [Desktop Entry] Version=1.0 Terminal=false Type=Application Name=OpenBRF Redux Comment=Mount&Blade resource editor by Marco Tarini and Swyter Exec=openbrf Icon=openbrf MimeType=application/x-openbrf Categories=Graphics EOF # add our custom mime type for application/x-openbrf => *.brf files mkdir -p "${pkgdir}/usr/share/mime/packages" cat < "${pkgdir}/usr/share/mime/packages/openbrf.xml" BRF Mount&Blade Binary Resource File Recurso binario de Mount&Blade EOF %post xdg-icon-resource forceupdate --theme hicolor &>/dev/null update-mime-database /usr/share/mime &>/dev/null update-desktop-database -q %files /usr/bin/openbrf /opt/openbrf/openbrf /opt/openbrf/openbrf.png /opt/openbrf/carry_positions.txt /opt/openbrf/customPreviewShaders.xml /opt/openbrf/reference.brf /opt/openbrf/translations/ /usr/share/applications/openbrf.desktop /usr/share/mime/packages/openbrf.xml /usr/share/pixmaps/openbrf.png /usr/share/icons/hicolor/256x256/apps/openbrf.png /usr/share/icons/hicolor/48x48/apps/openbrf.png /usr/share/icons/hicolor/32x32/apps/openbrf.png /usr/share/icons/hicolor/16x16/apps/openbrf.png %changelog * Mon Apr 06 2026 Swyter - 0-1 - Blah blah blah.