diff --git a/anda/srpm-macros/.gitignore b/anda/srpm-macros/.gitignore new file mode 100644 index 0000000000..9832ff8895 --- /dev/null +++ b/anda/srpm-macros/.gitignore @@ -0,0 +1,7 @@ +build/ +*.tar.* +*.zip +*.crate +*.deb +*.rpm +anda-build/ \ No newline at end of file diff --git a/anda/srpm-macros/anda-srpm-macros.spec b/anda/srpm-macros/anda-srpm-macros.spec new file mode 100644 index 0000000000..bb7d152861 --- /dev/null +++ b/anda/srpm-macros/anda-srpm-macros.spec @@ -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 +- Initial Build diff --git a/anda/srpm-macros/anda.hcl b/anda/srpm-macros/anda.hcl new file mode 100644 index 0000000000..c757c59187 --- /dev/null +++ b/anda/srpm-macros/anda.hcl @@ -0,0 +1,6 @@ +project "pkg" { + rpm { + spec = "anda-srpm-macros.spec" + sources = "." + } +} \ No newline at end of file diff --git a/anda/srpm-macros/macros.caching b/anda/srpm-macros/macros.caching new file mode 100644 index 0000000000..2948d2a58a --- /dev/null +++ b/anda/srpm-macros/macros.caching @@ -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 \ +) \ No newline at end of file diff --git a/anda/srpm-macros/macros.cargo_extra b/anda/srpm-macros/macros.cargo_extra new file mode 100644 index 0000000000..18e6e47bb1 --- /dev/null +++ b/anda/srpm-macros/macros.cargo_extra @@ -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 \ +) \ No newline at end of file diff --git a/anda/srpm-macros/umpkg.toml b/anda/srpm-macros/umpkg.toml new file mode 100644 index 0000000000..fd6d38210d --- /dev/null +++ b/anda/srpm-macros/umpkg.toml @@ -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"