%global ver 0.0.10 # Based on Fedora packaging for major compilers like Clang and GCC. Currently unused. %bcond buildformajor 0 %if %{with buildformajor} %global hcc_major 0 %endif %if %{defined suse_version} %undefine _smp_mflags %endif Name: holyc Version: %{ver}~beta Release: 1%{?dist} Summary: HolyC compiler and transpiler License: BSD-2-Clause URL: https://holyc-lang.com Source0: https://github.com/Jamesbarford/holyc-lang/archive/refs/tags/beta-v%{ver}.tar.gz BuildRequires: cmake %if %{undefined suse_version} BuildRequires: cmake-rpm-macros %endif BuildRequires: gcc BuildRequires: gcc-c++ BuildRequires: sqlite-devel %if %{with buildformajor} Provides: %{name}%{hcc_major} %endif %description HolyC is a fun recreational programming language designed by Terry A. Davis. Originally implemented in TempleOS as a general purpose programming language and scripting language for all manner of tasks. %prep %autosetup -n %{name}-lang-beta-v%{ver}/src %build %cmake \ -DCMAKE_BUILD_TYPE="Release" \ -DHCC_LINK_SQLITE3="1" \ %if %{with buildformajor} -DCMAKE_INSTALL_PREFIX="%{_prefix}/%{_lib}/holyc%{hcc_major}" %endif %cmake_build %install %cmake_install %if %{with buildformajor} # Unlike Clang and GCC HolyC has no way to configure this so we have to use hacky solutions mkdir -p %{buildroot}%{_bindir} for bin in hcc hcc-%{hcc_major}; do ln -sr %{_prefix}/%{_lib}/holyc%{hcc_major}/bin/hcc %{buildroot}%{_bindir}/$bin done %endif %files %license ../COPYING %doc ../README.md %{_bindir}/hcc %if %{without buildformajor} %{_includedir}/tos.HH %endif %if %{with buildformajor} %{_bindir}/hcc-%{hcc_major} %dir %{_prefix}/%{_lib}/holyc%{hcc_major} %{_prefix}/%{_lib}/holyc%{hcc_major}/bin/hcc %dir %{_prefix}/%{_lib}/holyc%{hcc_major}/include %{_prefix}/%{_lib}/holyc%{hcc_major}/include/tos.HH %endif %changelog %autochangelog