78 lines
2.4 KiB
RPMSpec
78 lines
2.4 KiB
RPMSpec
#needsrootforbuild
|
|
%global __cargo_skip_build 0
|
|
%global _debugsource_packages 1
|
|
%global _debuginfo_subpackages 1
|
|
%define _unpackaged_files_terminate_build 0
|
|
%global process1_install_source target/release
|
|
%global process1_install_target %{buildroot}/usr/lib/process1
|
|
%global __cargo_common_opts %{?__cargo_common_opts} --all
|
|
|
|
Name: process1
|
|
Version: 0.2.0
|
|
Release: 2
|
|
Summary: redesign and reimplement process1.
|
|
|
|
License: Mulan PSL v2
|
|
URL: https://gitee.com/openeuler/process1
|
|
Source0: %{name}-%{version}.tar.gz
|
|
|
|
|
|
ExclusiveArch: x86_64 aarch64
|
|
|
|
BuildRequires: rust
|
|
BuildRequires: cargo
|
|
BuildRequires: rust-packaging
|
|
BuildRequires: gcc
|
|
|
|
%description
|
|
redesign and reimplement process1.
|
|
|
|
Summary: %{summary}
|
|
|
|
%files
|
|
/usr/lib/process1/*
|
|
|
|
%prep
|
|
%autosetup -p1
|
|
|
|
%cargo_prep
|
|
|
|
%cargo_generate_buildrequires
|
|
|
|
%build
|
|
|
|
sed -i '/\[source.crates-io\]/{n;d}' ./.cargo/config
|
|
sed -i '/\[source.local-registry\]/{n;d}' ./.cargo/config
|
|
sed -i '/\[source.local-registry\]/a directory = "vendor"' ./.cargo/config
|
|
%ifarch aarch64
|
|
sed -i 's/rustflags = \[/rustflags = \["-Clink-arg=-lgcc", /g' ./.cargo/config
|
|
%endif
|
|
|
|
%cargo_build -a
|
|
|
|
%install
|
|
install -Dm0755 -t %{process1_install_target} %{process1_install_source}/init
|
|
install -Dm0755 -t %{process1_install_target} %{process1_install_source}/process1
|
|
install -Dm0755 -t %{process1_install_target} %{process1_install_source}/pctrl
|
|
install -Dm0755 -t %{process1_install_target} %{process1_install_source}/fstab
|
|
install -Dm0755 -t %{process1_install_target} %{process1_install_source}/sysmonitor
|
|
install -Dm0755 -t %{process1_install_target} %{process1_install_source}/random_seed
|
|
install -Dm0755 -t %{process1_install_target} %{process1_install_source}/rc-local-generator
|
|
|
|
strip %{process1_install_source}/lib*.so
|
|
|
|
install -Dm0644 -t %{process1_install_target}/plugin %{process1_install_source}/libmount.so
|
|
install -Dm0644 -t %{process1_install_target}/plugin %{process1_install_source}/libservice.so
|
|
install -Dm0644 -t %{process1_install_target}/plugin %{process1_install_source}/libsocket.so
|
|
install -Dm0644 -t %{process1_install_target}/plugin %{process1_install_source}/libtarget.so
|
|
install -Dm0644 -t %{process1_install_target}/plugin config/plugin.conf
|
|
|
|
|
|
%changelog
|
|
* Mon Aug 22 2022 He Xiaowen <hexiaowen@huawei.com> - 0.2.0-2
|
|
- strip the libraries
|
|
|
|
* Mon Aug 22 2022 He Xiaowen <hexiaowen@huawei.com> - 0.2.0-1
|
|
- initial package
|
|
|