add srpm macros

This commit is contained in:
Cappy Ishihara
2022-10-10 09:39:29 +07:00
parent bbfaf26593
commit f9ce5b19dc
6 changed files with 99 additions and 0 deletions
+7
View File
@@ -0,0 +1,7 @@
build/
*.tar.*
*.zip
*.crate
*.deb
*.rpm
anda-build/
+36
View File
@@ -0,0 +1,36 @@
Name: anda-srpm-macros
Version: 0.1.1
Release: 1%{?dist}
Summary: SRPM macros for extra Fedora packages
License: MIT
# URL:
Source0: macros.cargo_extra
Source1: macros.caching
Recommends: rust-packaging
Obsoletes: fyra-srpm-macros < 0.1.1-1
Provides: fyra-srpm-macros
BuildArch: noarch
%description
%{summary}
%prep
%build
%install
install -D -p -m 0644 -t %{buildroot}%{_rpmmacrodir} %{SOURCE0}
install -D -p -m 0644 -t %{buildroot}%{_rpmmacrodir} %{SOURCE1}
%files
%{_rpmmacrodir}/macros.cargo_extra
%{_rpmmacrodir}/macros.caching
%changelog
* Mon Sep 26 2022 Cappy Ishihara <cappy@cappuchino.xyz>
- Initial Build
+6
View File
@@ -0,0 +1,6 @@
project "pkg" {
rpm {
spec = "anda-srpm-macros.spec"
sources = "."
}
}
+16
View File
@@ -0,0 +1,16 @@
%_sccache %{_bindir}/sccache
%sccache_prep (\
export CC="sccache gcc" \
export CXX="sccache g++" \
export RUSTC_WRAPPER="sccache" \
%if %{with dist_cache} && %{?sccache_endpoint} && %{?sccache_accesskey} && %{?sccache_secret} && %{?sccache_bucket} \
export SCCACHE_BUCKET=%{sccache_bucket}\
export SCCACHE_ENDPOINT=%{sccache_endpoint}\
export AWS_SECRET_ACCESS_KEY=%{sccache_secret}\
export AWS_ACCESS_KEY_ID=%{sccache_accesskey}\
export SCCACHE_S3_USE_SSL=true\
%endif \
)
+28
View File
@@ -0,0 +1,28 @@
%cargo_prep_online (\
set -eu \
%{__mkdir} -p .cargo \
cat > .cargo/config << EOF \
[build]\
rustc = "%{__rustc}"\
rustdoc = "%{__rustdoc}"\
\
[env]\
CFLAGS = "%{build_cflags}"\
CXXFLAGS = "%{build_cxxflags}"\
LDFLAGS = "%{build_ldflags}"\
\
[install]\
root = "%{buildroot}%{_prefix}"\
\
[term]\
verbose = true\
\
[source]\
\
[source.local-registry]\
directory = "%{cargo_registry}"\
\
EOF\
%{__rm} -f Cargo.lock \
%{__rm} -f Cargo.toml.orig \
)
+6
View File
@@ -0,0 +1,6 @@
[fyra-srpm-macros]
spec = "fyra-srpm-macros.spec"
build_script = ""
build_method = "mock"
owner = "cappy"
git_repo = "https://github.com/ultramarine-linux/pkg-fyra-srpm-macros"