## START: Set by rpmautospec ## (rpmautospec version 0.7.1) ## RPMAUTOSPEC: autorelease, autochangelog %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 1; base_release_number = tonumber(rpm.expand("%{?-b*}%{!?-b:1}")); print(release_number + base_release_number - 1); }%{?-e:.%{-e*}}%{?-s:.%{-s*}}%{!?-n:%{?dist}} ## END: Set by rpmautospec %bcond_with bootstrap # The dependency generators normally target third-party modules, it is # overridden here for the standard library. %global __hare_path ^%{hare_stdlib}$ %global ldlinkflags %{lua: sep='' for gcc_flag in string.gmatch(macros.build_ldflags, '%S+') do if gcc_flag:match '^\-Wl,' then ld_flag=string.gsub(gcc_flag, '\-Wl,', '') print(sep..string.gsub(ld_flag, ',', ' ')) sep=' ' end end} Summary: The Hare programming language Name: hare License: GPL-3.0-only Version: 0.24.2%{?preview:~%preview} Release: %autorelease URL: https://harelang.org/ Source0: https://git.sr.ht/~sircmpwn/%{name}/archive/%{version}%{?preview:-%preview}.tar.gz Source1: macros.%{name} Source2: %{name}.attr Source3: %{name}.prov Source4: %{name}.req %{load:%{S:1}} Patch: 0001-cmd-hare-Move-unwrap_module_error-logic-to-stdlib.patch Patch: 0002-cmd-hare-Move-gather_submodules-to-stdlib.patch Patch: 0003-hare-module-Optionally-gather-modules-recursively.patch Patch: 0004-hare-module-Resolve-submodules-from-a-location.patch Patch: 0005-cmd-hare-New-options-to-print-deps-recursively.patch Patch: 0006-hare-module-Highlight-results-from-gather-calls.patch Patch: 0007-hare-cmd-Print-modules-without-dependencies.patch Patch: 0008-cmd-hare-Print-dependencies-to-a-t.patch %if %{without bootstrap} BuildRequires: %{name}-rpm-macros %endif BuildRequires: binutils BuildRequires: harec BuildRequires: make BuildRequires: qbe BuildRequires: scdoc BuildRequires: tzdata Requires: %{name}-rpm-macros = %{version}-%{release} Requires: %{name}-stdlib = %{version}-%{release} Requires: harec Requires: tzdata # See cross toolchain in config.mk below Requires: binutils Recommends: gcc %{lua: for arch in string.gmatch(macros.hare_host_arches, '%S+') do if arch ~= macros._arch then print("Recommends: gcc-"..arch.."-linux-gnu\n") end end} ExclusiveArch: %{qbe_arches} %description Hare is a systems programming language. %package stdlib Summary: The Hare standard library License: MPL-2.0 BuildArch: noarch %description stdlib The standard library for the Hare programming language. %package rpm-macros Summary: Macros for hare packages License: MIT BuildArch: noarch %description rpm-macros RPM macros for packages shipping hare modules. %prep %autosetup -p1 -n %{name}-%{version}%{?preview:-%preview} %conf tee config.mk <<'EOF' PREFIX = %{_prefix} BINDIR = %{_bindir} MANDIR = %{_mandir} SRCDIR = %{_usrsrc} STDLIB = %{hare_stdlib} HAREPATH = %{hare_stdlib}:%{hare_srcdir} VERSION = %{version}-%{release} PLATFORM = %{_host_os} ARCH = %{_arch} HAREFLAGS = -R HAREC = harec HARECFLAGS = QBE = qbe QBEFLAGS = LDFLAGS = -Wl,-z,noexecstack -fPIE %{build_ldflags} LDLINKFLAGS = -z noexecstack -pie %{ldlinkflags} SCDOC = scdoc HARECACHE = .cache BINOUT = .bin %{lua: for arch in string.gmatch(macros.hare_host_arches, '%S+') do local host = arch.."-linux-gnu-" if arch == macros._arch then host = "" end print(string.upper(arch).."_AS = "..host.."as\n") print(string.upper(arch).."_AR = "..host.."ar\n") print(string.upper(arch).."_CC = "..host.."gcc\n") print(string.upper(arch).."_LD = "..host.."ld\n") end} EOF %build %make_build %install %make_install install -d %{buildroot}%{hare_srcdir} install -D -p -t %{buildroot}/%{_rpmmacrodir} %{S:1} install -D -p -t %{buildroot}/%{_fileattrsdir} %{S:2} install -D -p -t %{buildroot}/%{_rpmconfigdir} %{S:3} install -D -p -t %{buildroot}/%{_rpmconfigdir} %{S:4} %check %make_build check %files %doc README.md %license cmd/COPYING %{_bindir}/%{name}* %{_mandir}/man1/%{name}* %{_mandir}/man5/%{name}* %dir %{_usrsrc}/%{name}/ %dir %{hare_srcdir} %files stdlib %doc README %license COPYING %{hare_stdlib} %files rpm-macros %{_fileattrsdir}/%{name}.attr %{_rpmmacrodir}/macros.%{name} %{_rpmconfigdir}/%{name}.* %changelog ## START: Generated by rpmautospec * Sat Aug 24 2024 John Doe - 0.24.2-1 - Uncommitted changes ## END: Generated by rpmautospec