## START: Set by rpmautospec ## (rpmautospec version 0.8.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_without check %global debug_package %{nil} %global _enable_debug_packages 0 %global crate cosmic-ext-calculator %global crateid dev.edfloreshz.Calculator %global shortversion 0.2.0 %global commit 455f28c9ae445fa30f91e570ab2eaccbf28e8461 #global committag 1 %global commitversion %{?committag:%{commit}}%{?!committag:%{shortversion}} %global shortcommitversion %{?committag:%(c=%{commit}; echo ${c:0:7})}%{?!committag:%{shortversion}} %global commitdatestring 2025-09-26 01:09:18 +0200 %global commitdate 20250926 %global licenceversion 3.27.0 %global commitgit %{?committag:^git%{commitdate}.%(c=%{commit}; echo ${c:0:7})} Name: cosmic-ext-calculator Version: %{shortversion}%{commitgit} Release: 1%{?dist} Summary: A simple calculator for the COSMIC desktop License: GPLv3 URL: https://github.com/cosmic-utils/calculator Source0: https://github.com/cosmic-utils/calculator/archive/refs/tags/%{commitversion}/calculator-%{shortcommitversion}.tar.gz # To create the below sources: # * git clone https://github.com/cosmic-utils/cosmic-classic-menu.git at the specified commit # * cargo vendor > vendor-config-%%{shortcommitversion}.toml # * tar -pczf vendor-%%{shortcommitversion}.tar.xz vendor Source1: vendor-%{shortcommitversion}.tar.xz # * mv vendor-config-%%{shortcommitversion}.toml .. Source2: vendor-config-%{shortcommitversion}.toml # https://github.com/evenorog/license/issues/6 Source3: https://github.com/spdx/license-list-data/archive/refs/tags/v%{licenceversion}.tar.gz#/license-list-data-%{licenceversion}.tar.gz Patch0: calculator-0.2.0-justfile.patch BuildRequires: cargo-rpm-macros >= 26 BuildRequires: rustc BuildRequires: cargo BuildRequires: rust-xkbcommon-devel BuildRequires: just %description The calculator has an operations history, providing the ability to bring previous calculations back to the screen for further use or inspection. %prep %autosetup -n calculator-%{commitversion} -p1 -a1 -b3 mv ../license-list-data-%{licenceversion} vendor/license/license-list-data/ %cargo_prep -N # Check if .cargo/config.toml exists if [ -f .cargo/config.toml ]; then # If it exists, append the contents of %%{SOURCE2} to .cargo/config.toml cat %{SOURCE2} >> .cargo/config.toml echo "Appended %{SOURCE2} to .cargo/config.toml" else # If it does not exist, append the contents of %%{SOURCE2} to .cargo/config cat %{SOURCE2} >> .cargo/config echo "Appended %{SOURCE2} to .cargo/config" fi %build # Set vergen environment variables export VERGEN_GIT_COMMIT_DATE="date --utc '%{commitdatestring}'" export VERGEN_GIT_SHA="%{commit}" %cargo_build %{cargo_license_summary} %{cargo_license} > LICENSE.dependencies %{cargo_vendor_manifest} sed 's/\(.*\) (.*#\(.*\))/\1+git\2/' -i cargo-vendor.txt sed 's/^\([^+]*\)+.*+\([^+]*\)$/\1+\2/' -i cargo-vendor.txt %install # Set vergen environment variables export VERGEN_GIT_COMMIT_DATE="date --utc '%{commitdatestring}'" export VERGEN_GIT_SHA="%{commit}" just rootdir=%{buildroot} prefix=%{_prefix} install %if %{with check} %check # Set vergen environment variables export VERGEN_GIT_COMMIT_DATE="date --utc '%{commitdatestring}'" export VERGEN_GIT_SHA="%{commit}" %cargo_test %endif %files %license LICENSE %license LICENSE.dependencies %license cargo-vendor.txt %doc README.md %{_bindir}/%{crate} %{_datadir}/applications/%{crateid}.desktop %{_metainfodir}/%{crateid}.metainfo.xml %{_datadir}/icons/hicolor/scalable/apps/%{crateid}*.svg %changelog * Fri Oct 17 2025 Jean-Marc Liger - 0.2.0-1 - Initial package