## START: Set by rpmautospec ## (rpmautospec version 0.3.0) %define autorelease(e:s:pb:n) %{?-p:0.}%{lua: release_number = 2; 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 # Generated by rust2rpm 22 # Also partially inspired by the Arch packaging # - git clone https://aur.archlinux.org/external-editor-revived.git %bcond_without check %global crate external-editor-revived %global thunderbird_app_id \{3550f703-e582-4d05-9a08-453d09bdfdc6\} %global extensions_dir %{_libdir}/mozilla/extensions/%{thunderbird_app_id} Name: external-editor-revived Version: 0.4.0 Release: %autorelease Summary: Thunderbird extension that allows editing emails in external editors such as Vim # Apache-2.0 OR BSL-1.0 # GPL-3.0-or-later # MIT OR Apache-2.0 # Unlicense OR MIT License: Apache-2.0 AND MIT AND GPL-3.0-or-later # LICENSE.dependencies contains a full license breakdown URL: https://github.com/Frederick888/external-editor-revived Source: https://github.com/Frederick888/external-editor-revived/archive/refs/tags/v%{version}.tar.gz ExclusiveArch: %{rust_arches} BuildRequires: rust-packaging >= 21 BuildRequires: coreutils BuildRequires: sed BuildRequires: zip Requires: mozilla-filesystem %global _description %{expand: Edit emails in external editors such as Vim.} %description %{_description} %files %license LICENSE %license LICENSE.dependencies %doc CHANGELOG.md %doc README.md %{_bindir}/external-editor-revived %{_libdir}/mozilla/native-messaging-hosts/external_editor_revived.json %{extensions_dir}/external-editor-revived@tsundere.moe.xpi %prep %autosetup -n %{crate}-%{version_no_tilde} -p1 %cargo_prep %generate_buildrequires %cargo_generate_buildrequires %build # do the rust compilation %cargo_build # capture license information from deps %{cargo_license} > LICENSE.dependencies # log license summary (to be copied as comment above) %cargo_license_summary # package up the extension pushd $RPM_BUILD_DIR/%{crate}-%{version}/extension zip -r -FS $RPM_BUILD_DIR/external-editor-revived@tsundere.moe.xpi * popd %install %cargo_install # Generate the native messaging json by executing the binary # and redirecting stdout to sed that updates the location of the # binary and then writing that out to the destination file mkdir -p $RPM_BUILD_ROOT%{_libdir}/mozilla/native-messaging-hosts $RPM_BUILD_ROOT%{_bindir}/external-editor-revived 2>/dev/null | \ sed 's|^ "path":.*$| "path": "%{_bindir}/external-editor-revived",|' > \ $RPM_BUILD_ROOT%{_libdir}/mozilla/native-messaging-hosts/external_editor_revived.json # copy over extension mkdir -p $RPM_BUILD_ROOT%{extensions_dir} cp $RPM_BUILD_DIR/external-editor-revived@tsundere.moe.xpi $RPM_BUILD_ROOT%{extensions_dir}/ %if %{with check} %check %cargo_test %endif %changelog * Sat Dec 10 2022 Dusty Mabe 0.4.0-2 - make use of %%cargo_license and %%cargo_license_summary macros * Sat Dec 10 2022 Dusty Mabe 0.4.0-1 - Add in spec file from Package Review