3

CentOS 官方是如何编译一个包的

 2 years ago
source link: https://diabloneo.github.io//2021/12/07/How-CentOS-build-rpm-packages/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

CentOS 官方是如何编译一个包的

Dec 7, 2021

CentOS 是企业级开发里常用的 base 操作系统,很多时候,我们会先使用官方源里的包,随着业务的发展,我们会开始自己修改代码。这种时候,我们就希望可以编译出和 CentOS 官方一样的包。那么如何找到 CentOS 官方是如何编译包的呢?

Koji 是 Fedora 平台用来编译 RPM 包和镜像的系统,CentOS/Rocky Linux 也都使用这个平台。这个 wiki 介绍了 Koji 的基本信息:https://fedoraproject.org/wiki/Koji

我们可以找到 CentOS Koji 的链接,然后通过 Koji 来找到我们需要的包的信息。

如何找到 CentOS 8 官方编译 libvirt 的方案

步骤如下:

在里面搜索 meson,可以找到 meson 的参数,就知道 CentOS 8 官方如何编译 libvirt 库了:

+ /usr/bin/meson --buildtype=plain --prefix=/usr --libdir=/usr/lib64 --libexecdir=/usr/libexec --bindir=/usr/bin --sbindir=/usr/sbin --includedir=/usr/include --datadir=/usr/share --mandir=/usr/share/man --infodir=/usr/share/info --localedir=/usr/share/locale --sysconfdir=/etc --localstatedir=/var --sharedstatedir=/var/lib --wrap-mode=nodownload --auto-features=enabled . x86_64-redhat-linux-gnu -Drunstatedir=/run -Ddriver_qemu=enabled -Ddriver_openvz=disabled -Ddriver_lxc=disabled -Ddriver_vbox=disabled -Ddriver_libxl=disabled -Dsasl=enabled -Dpolkit=enabled -Ddriver_libvirtd=enabled -Ddriver_remote=enabled -Ddriver_test=enabled -Ddriver_esx=enabled -Dcurl=enabled -Ddriver_hyperv=disabled -Dopenwsman=disabled -Ddriver_vmware=disabled -Ddriver_vz=disabled -Ddriver_bhyve=disabled -Ddriver_ch=disabled -Dremote_default_mode=legacy -Ddriver_interface=enabled -Ddriver_network=enabled -Dstorage_fs=enabled -Dstorage_lvm=enabled -Dstorage_iscsi=enabled -Dstorage_iscsi_direct=enabled -Dlibiscsi=enabled -Dstorage_scsi=enabled -Dstorage_disk=enabled -Dstorage_mpath=enabled -Dstorage_rbd=enabled -Dstorage_sheepdog=disabled -Dstorage_gluster=enabled -Dglusterfs=enabled -Dstorage_zfs=disabled -Dstorage_vstorage=disabled -Dnumactl=enabled -Dnumad=enabled -Dcapng=enabled -Dfuse=disabled -Dnetcf=enabled -Dselinux=enabled -Dselinux_mount=/sys/fs/selinux -Dapparmor=disabled -Dapparmor_profiles=disabled -Dsecdriver_apparmor=disabled -Dudev=enabled -Dyajl=enabled -Dsanlock=enabled -Dlibpcap=enabled -Dlibnl=enabled -Daudit=enabled -Ddtrace=enabled -Dfirewalld=enabled -Dfirewalld_zone=enabled -Dwireshark_dissector=enabled -Dlibssh=enabled -Dlibssh2=disabled -Dpm_utils=disabled -Dnss=enabled '-Dpackager=CentOS Buildsys <[email protected]>, 2021-11-09-20:38:08, ' -Dpackager_version=1.module_el8.6.0+983+a7505f3f -Dqemu_user=qemu -Dqemu_group=qemu -Dtls_priority=@LIBVIRT,SYSTEM -Dwerror=true -Dexpensive_tests=enabled -Dinit_script=systemd -Ddocs=enabled -Dtests=enabled -Drpath=disabled -Dlogin_shell=disabled

在里面搜索 rpmbuild 就可以知道它用什么命令打包的了。

同样的,Fedora 和 Rocky Linux 也可以用这个方法找到他们的打包细节。


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK