## START: Set by rpmautospec ## (rpmautospec version 0.7.2) ## 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 %undefine _auto_set_build_flags %global __local_generator_provides %{S:3} %{version}-%{release} %global __local_generator_path ^%{hare_stdlib}$ %ifarch aarch64 %undefine _hare_dynamic %endif %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}} # https://lists.sr.ht/~sircmpwn/hare-dev/patches/54316 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-for-hare-deps-recursivity.patch Patch: 0006-hare-module-Highlight-results-from-gather-calls.patch Patch: 0007-cmd-hare-Print-modules-without-dependencies.patch Patch: 0008-cmd-hare-Print-dependencies-to-a-t.patch # https://lists.sr.ht/~sircmpwn/hare-dev/patches/54862 Patch: 0001-Makefile-Build-haredoc-with-HAREFLAGS.patch Patch: 0002-Makefile-Install-hare-1-built-by-hare.patch Patch: 0003-Makefile-Add-HARECACHE-to-the-environment.patch Patch: 0004-Makefile-Add-LDFLAGS-to-the-environment.patch BuildRequires: binutils BuildRequires: gcc BuildRequires: harec BuildRequires: make BuildRequires: qbe BuildRequires: rpm-local-generator-support BuildRequires: scdoc BuildRequires: tzdata Requires: %{name}-rpm-macros = %{version}-%{release} Requires: %{name}-stdlib = %{version}-%{release} Requires: binutils Requires: harec Requires: qbe Requires: tzdata # XXX: can't build SRPM outside of rawhide without hare_arches %global hare_arches aarch64 riscv64 x86_64 # See cross toolchain in config.mk below Recommends: gcc %{lua: for arch in string.gmatch(macros.hare_arches, '%S+') do if arch ~= macros._arch then print("Recommends: gcc-"..arch.."-linux-gnu\n") end end} ExclusiveArch: %{hare_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_moddir} VERSION = %{version}-%{release} PLATFORM = %{_host_os} ARCH = %{_arch} HAREFLAGS = %{build_hareflags} HAREC = harec HARECFLAGS = QBE = qbe QBEFLAGS = LDFLAGS = %{build_ldflags} LDLINKFLAGS = -z noexecstack -pie %{ldlinkflags} SCDOC = scdoc HARECACHE = .cache BINOUT = .bin %{lua: for arch in string.gmatch(macros.hare_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 # TODO: permissions install -d %{buildroot}%{hare_moddir} 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 %{hare_srcdir} %dir %{hare_moddir} %files stdlib %doc README %license COPYING %{hare_stdlib} %files rpm-macros %{_fileattrsdir}/%{name}.attr %{_rpmmacrodir}/macros.%{name} %{_rpmconfigdir}/%{name}.* %changelog ## START: Generated by rpmautospec * Tue Oct 01 2024 John Doe - 0.24.2-1 - Uncommitted changes ## END: Generated by rpmautospec