Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
openeuler_risc-v-fixing [2024/01/25 03:40] – Add bcond_without macro & oEEP-0012 misaka00251openeuler_risc-v-fixing [2024/04/03 03:55] (current) – Add noarch misaka00251
Line 25: Line 25:
 建仓的时候除了 spec 文件和源码,一定要包含一个 yaml 文件。如果 ''version_control'' 是 ''git'',那么 ''src_repo'' 就要填写完整的地址。 建仓的时候除了 spec 文件和源码,一定要包含一个 yaml 文件。如果 ''version_control'' 是 ''git'',那么 ''src_repo'' 就要填写完整的地址。
  
-<code yaml>+<file yaml kweathercore.yaml>
 version_control: github version_control: github
 src_repo: KDE/kweathercore src_repo: KDE/kweathercore
 tag_prefix: "^v" tag_prefix: "^v"
 separator: "." separator: "."
-</code>+</file>
  
 ===== upstream 源码包名字跟仓内不一样 ===== ===== upstream 源码包名字跟仓内不一样 =====
Line 44: Line 44:
 目前有宏了,之前没有宏的话需要这样: 目前有宏了,之前没有宏的话需要这样:
  
-<code>+<file spec example.spec>
 %build %build
 mkdir %{_target_platform} mkdir %{_target_platform}
Line 54: Line 54:
 %install %install
 make install/fast DESTDIR=%{buildroot} -C %{_target_platform} make install/fast DESTDIR=%{buildroot} -C %{_target_platform}
-</code>+</file>
  
 ===== 单 part 执行 ===== ===== 单 part 执行 =====
Line 78: Line 78:
 For all: For all:
 rpmbuild -ba --define "_srcdefattr (-.root,root)" --nosignature --short-circuit /home/abuild/rpmbuild/SOURCES/texlive-base.spec rpmbuild -ba --define "_srcdefattr (-.root,root)" --nosignature --short-circuit /home/abuild/rpmbuild/SOURCES/texlive-base.spec
 +</code>
 +
 +==== 安装单 part 执行 ====
 +
 +参考[[这个 bugzilla|https://bugzilla.redhat.com/show_bug.cgi?id=671210]],可以使用 ''--nodeps'' 指令,想要寻找这类包也可以直接使用 ''rpm -Va --nofiles'' 命令:
 +
 +<code bash>
 +# rpm -ivh chromedriver-119.0.6045.159-1.oe2309.riscv64.rpm chromium-119.0.6045.159-1.oe2309.riscv64.rpm chromium-common-119.0.6045.159-1.oe2309.riscv64.rpm 
 +error: Failed dependencies:
 +        rpmlib(ShortCircuited) <= 4.9.0-1 is needed by chromedriver-119.0.6045.159-1.oe2309.riscv64
 +        rpmlib(ShortCircuited) <= 4.9.0-1 is needed by chromium-119.0.6045.159-1.oe2309.riscv64
 +        rpmlib(ShortCircuited) <= 4.9.0-1 is needed by chromium-common-119.0.6045.159-1.oe2309.riscv64
 +# rpm -ivh chromedriver-119.0.6045.159-1.oe2309.riscv64.rpm chromium-119.0.6045.159-1.oe2309.riscv64.rpm chromium-common-119.0.6045.159-1.oe2309.riscv64.rpm --nodeps
 +Verifying...                          ################################# [100%]
 +Preparing...                          ################################# [100%]
 +Updating / installing...
 +   1:chromium-common-119.0.6045.159-1.################################# [ 33%]
 +   2:chromedriver-119.0.6045.159-1.oe2################################# [ 67%]
 +   3:chromium-119.0.6045.159-1.oe2309 ################################# [100%]
 </code> </code>
  
Line 105: Line 124:
 以下有一个例子: 以下有一个例子:
  
-<code>+<file spec example.spec>
 # 默认没有 cuda # 默认没有 cuda
 %bcond_without cuda %bcond_without cuda
Line 121: Line 140:
 BuildRequires:  cuda-nvcc BuildRequires:  cuda-nvcc
 %endif %endif
-</code>+</file>
  
 +===== expand macro =====
 +
 +<file spec example.spec>
 +%global common_description %{expand:
 +This package provides a set of C++ libraries for multimedia streaming, using
 +using open standard protocols (RTP/RTCP, RTSP, SIP). These libraries can be
 +used  to build streaming applications.
 +
 +The libraries can also be used to stream, receive, and process MPEG, H.263+ or
 +JPEG video, and several audio codecs. They can easily be extended to support
 +additional (audio and/or video) codecs, and can also be used to build basic
 +RTSP or SIP clients and servers, and have been used to add streaming support to
 +existing media player applications.}
 +
 +%description    %{common_description}
 +</file>
 +
 +===== 碰到 noarch 怎么办 =====
 +
 +如果遇到 "%ifarch" 宏不起作用的情况下,可以先看一下 spec 文件内是否有 "BuildArch: noarch" 这一行。
 +
 +在包为 noarch 的情况下,"%ifarch" 是不起作用的。你可能需要这样的 dirty hack 才行:
 +
 +<file spec example.spec>
 +BuildArch: noarch
 +%if "%{_arch}" == "riscv64"
 +echo "Do Something"
 +%endif
 +</file>