You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
165 lines
4.0 KiB
165 lines
4.0 KiB
1 year ago
|
# Generated by rust2rpm 16
|
||
|
%bcond_without check
|
||
|
|
||
|
%global __cargo_skip_build 0
|
||
|
%global crate pleaser
|
||
|
|
||
|
%if 0%{?el9}
|
||
|
# disabling this as it chokes on the vendored dependencies
|
||
|
%undefine __brp_mangle_shebangs
|
||
|
# el8 doesn't have these macros
|
||
|
%global __crates_url https://crates.io/api/v1/crates/
|
||
|
%global crates_source %{__crates_url}%{crate}/%{version}/download#/%{crate}-%{version}.crate
|
||
|
%global version_no_tilde %{version}
|
||
|
%endif
|
||
|
|
||
|
Name: rust-%{crate}
|
||
|
Version: 0.5.3
|
||
|
Release: 0%{?dist}
|
||
|
Summary: Please, a polite regex-first sudo alternative
|
||
|
|
||
|
# Upstream license specification: GPL-3.0-or-later
|
||
|
License: GPLv3+
|
||
|
URL: https://crates.io/crates/pleaser
|
||
|
|
||
|
Source0: %{crates_source}
|
||
|
Source1: %{crate}-%{version}-vendor.tar.gz
|
||
|
|
||
|
%if ! 0%{?el9}
|
||
|
# Patch nix dependency to >= 0.19 as upstream bumped
|
||
|
Patch0: pleaser-fix-metadata.diff
|
||
|
%endif
|
||
|
|
||
|
ExclusiveArch: %{rust_arches}
|
||
|
%if %{__cargo_skip_build}
|
||
|
BuildArch: noarch
|
||
|
%endif
|
||
|
|
||
|
%if 0%{?el9}
|
||
|
BuildRequires: rust-toolset
|
||
|
BuildRequires: sed
|
||
|
BuildRequires: pam-devel
|
||
|
%else
|
||
|
BuildRequires: rust-packaging
|
||
|
%endif
|
||
|
|
||
|
%global _description %{expand:
|
||
|
Please, a polite regex-first sudo alternative.}
|
||
|
|
||
|
%description %{_description}
|
||
|
|
||
|
%if ! %{__cargo_skip_build}
|
||
|
%package -n %{crate}
|
||
|
Summary: %{summary}
|
||
|
|
||
|
%description -n %{crate} %{_description}
|
||
|
|
||
|
%files -n %{crate}
|
||
|
%doc README.md
|
||
|
%license LICENSE
|
||
|
%{_bindir}/please
|
||
|
%{_bindir}/pleaseedit
|
||
|
%{_mandir}/man1/please.1*
|
||
|
%{_mandir}/man5/please.ini.5*
|
||
|
%config(noreplace) /etc/pam.d/please
|
||
|
%config(noreplace) /etc/pam.d/pleaseedit
|
||
|
%endif
|
||
|
|
||
|
%package devel
|
||
|
Summary: %{summary}
|
||
|
BuildArch: noarch
|
||
|
|
||
|
%description devel %{_description}
|
||
|
|
||
|
This package contains library source intended for building other packages
|
||
|
which use "%{crate}" crate.
|
||
|
|
||
|
%files devel
|
||
|
%doc README.md
|
||
|
%license LICENSE
|
||
|
|
||
|
%if ! 0%{?el9}
|
||
|
%{cargo_registry}/%{crate}-%{version_no_tilde}/
|
||
|
%endif
|
||
|
|
||
|
%package -n %{name}+default-devel
|
||
|
Summary: %{summary}
|
||
|
BuildArch: noarch
|
||
|
|
||
|
%description -n %{name}+default-devel %{_description}
|
||
|
|
||
|
This package contains library source intended for building other packages
|
||
|
which use "default" feature of "%{crate}" crate.
|
||
|
|
||
|
%files -n %{name}+default-devel
|
||
|
%if ! 0%{?el9}
|
||
|
%ghost %{cargo_registry}/%{crate}-%{version_no_tilde}/Cargo.toml
|
||
|
%endif
|
||
|
|
||
|
%prep
|
||
|
%autosetup -n %{crate}-%{version_no_tilde} -p1
|
||
|
%if 0%{?el9}
|
||
|
%cargo_prep -V 1
|
||
|
%ifarch s390x
|
||
|
# drop opt-level generation to fix s390x OOM problems
|
||
|
sed -i 's/opt-level=3/opt-level=1/' .cargo/config
|
||
|
%endif
|
||
|
%else
|
||
|
%cargo_prep
|
||
|
%endif
|
||
|
|
||
|
%if 0%{?fedora}
|
||
|
%generate_buildrequires
|
||
|
%cargo_generate_buildrequires
|
||
|
%endif
|
||
|
|
||
|
%build
|
||
|
%cargo_build
|
||
|
|
||
|
%install
|
||
|
%cargo_install
|
||
|
%{__install} -Dpm4755 -t %{buildroot}%{_bindir} target/release/please
|
||
|
%{__install} -Dpm4755 -t %{buildroot}%{_bindir} target/release/pleaseedit
|
||
|
%{__install} -Dpm0644 -t %{buildroot}%{_mandir}/man1 man/please.1
|
||
|
%{__install} -Dpm0644 -t %{buildroot}%{_mandir}/man5 man/please.ini.5
|
||
|
|
||
|
mkdir -p $RPM_BUILD_ROOT/etc/pam.d
|
||
|
cat > $RPM_BUILD_ROOT/etc/pam.d/please << EOF
|
||
|
#%PAM-1.0
|
||
|
auth include system-auth
|
||
|
account include system-auth
|
||
|
password include system-auth
|
||
|
session optional pam_keyinit.so revoke
|
||
|
session required pam_limits.so
|
||
|
session include system-auth
|
||
|
EOF
|
||
|
|
||
|
mkdir -p $RPM_BUILD_ROOT/etc/pam.d
|
||
|
cat > $RPM_BUILD_ROOT/etc/pam.d/pleaseedit << EOF
|
||
|
#%PAM-1.0
|
||
|
auth include system-auth
|
||
|
account include system-auth
|
||
|
password include system-auth
|
||
|
session optional pam_keyinit.so revoke
|
||
|
session required pam_limits.so
|
||
|
session include system-auth
|
||
|
EOF
|
||
|
|
||
|
%if %{with check}
|
||
|
%check
|
||
|
%cargo_test
|
||
|
%endif
|
||
|
|
||
|
%changelog
|
||
|
* Mon Jan 15 2024 Arkady L. Shane <tigro@msvsphere-os.ru> - 0.5.3-0
|
||
|
- Rebuilt for MSVSphere 9.3
|
||
|
|
||
|
* Tue Nov 23 2021 ed neville <ed@s5h.net> - 0.5.0-1
|
||
|
- EPEL9 sections
|
||
|
|
||
|
* Fri Jul 23 2021 Fedora Release Engineering <releng@fedoraproject.org> - 0.4.1-2
|
||
|
- Rebuilt for https://fedoraproject.org/wiki/Fedora_35_Mass_Rebuild
|
||
|
|
||
|
* Mon Nov 23 21:34:08 GMT 2020 ed neville <ed@s5h.net> - 0.3.24-1
|
||
|
- Initial package
|