sysmaster/sysmaster.spec
xujing 2d34df8438 fix objcopy permission denied when rpmbuild
fix objcopy permission denied when rpmbuild. And by the way, package
sysmaster directory which can be found by "rpm -ql".

(cherry picked from commit c802108b47fca5a07638dbebfa30fdc427879ed6)
2023-07-06 16:53:08 +08:00

110 lines
3.3 KiB
RPMSpec

#needsrootforbuild
%global __cargo_skip_build 0
%global _debugsource_packages 1
%global _debuginfo_subpackages 1
%define _unpackaged_files_terminate_build 0
%global sysmaster_install_source target/release
%global sysmaster_install_target %{buildroot}/usr/lib/sysmaster
%global unit_install_source units
%global conf_install_source config/conf
%global __cargo_common_opts %{?__cargo_common_opts} --all
Name: sysmaster
Version: 0.2.4
Release: 3
Summary: redesign and reimplement process1.
License: Mulan PSL v2
URL: https://gitee.com/openeuler/sysmaster
Source0: %{name}-%{version}.tar.gz
Patch0001: backport-fix-modify-units-for-sctl-enable.patch
ExclusiveArch: x86_64 aarch64
BuildRequires: rust
BuildRequires: cargo
BuildRequires: rust-packaging
BuildRequires: gcc clang util-linux-devel
%description
redesign and reimplement process1.
Summary: %{summary}
%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
%cargo_build
%install
install -Dm0750 -t %{buildroot}/usr/bin %{sysmaster_install_source}/sctl
install -Dm0750 -t %{sysmaster_install_target} %{sysmaster_install_source}/init
install -Dm0750 -t %{sysmaster_install_target} %{sysmaster_install_source}/sysmaster
install -Dm0640 -t %{sysmaster_install_target} %{unit_install_source}/*
install -Dm0750 -t %{sysmaster_install_target}/plugin %{sysmaster_install_source}/libservice.so
install -Dm0750 -t %{sysmaster_install_target}/plugin %{sysmaster_install_source}/libtarget.so
install -Dm0640 -t %{sysmaster_install_target}/plugin %{conf_install_source}/plugin.conf
%files
%attr(0550,-,-) /usr/bin/sctl
%dir /usr/lib/sysmaster
/usr/lib/sysmaster/basic.target
%attr(0550,-,-) /usr/lib/sysmaster/init
/usr/lib/sysmaster/multi-user.target
%dir /usr/lib/sysmaster/plugin
%attr(0550,-,-) /usr/lib/sysmaster/plugin/*.so
/usr/lib/sysmaster/plugin/plugin.conf
/usr/lib/sysmaster/shutdown.target
/usr/lib/sysmaster/sshd-keygen.target
/usr/lib/sysmaster/sshd-keygen@ecdsa.service
/usr/lib/sysmaster/sshd-keygen@ed25519.service
/usr/lib/sysmaster/sshd-keygen@rsa.service
/usr/lib/sysmaster/sshd.service
/usr/lib/sysmaster/sysinit.target
%attr(0550,-,-) /usr/lib/sysmaster/sysmaster
%changelog
* Thu Jul 06 2023 xujing<xujing125@huawei.com> - 0.2.4-3
- fix objcopy permission denied when rpmbuild
* Tue Jun 27 2023 shenyangyang<shenyangyang4@huawei.com> - 0.2.4-2
- modify the sshd units
* Tue Jun 20 2023 shenyangyang<shenyangyang4@huawei.com> - 0.2.4-1
- update version to 0.2.4 for docker use
* Fri Jun 16 2023 licunlong<licunlong1@huawei.com> - 0.2.3-3
- sync patches from upstream
* Tue May 30 2023 shenyangyang<shenyangyang4@huawei.com> - 0.2.3-2
- Support compatible compile with rust 1.60
* Sat May 6 2023 shenyangyang<shenyangyang4@huawei.com> - 0.2.3-1
- update version to 0.2.3
* Tue Sep 20 2022 licunlong<licunlong1@huawei.com> - 0.2.1-2
- rename process1 to sysmaster, and remove pctrl to /usr/bin
* Tue Sep 13 2022 licunlong<licunlong1@huawei.com> - 0.2.1-1
- sync patches from upstream
* 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