ARTICLE · 1313548
让你的源码以 .deb / .rpm / .apk 的形式安装
让你的源码以 .deb / .rpm / .apk 的形式安装
在客户端(rocky9.5)上安装 

也支持 .deb / .rpm / .apk 之间互转
# 源码转debrambo@ub2404:~/source_to$ sudo python3 converter.py git-2.56.0.tar.gz git 2.56.0 --format deb=== [步骤 1/3] 解压源码包 (git-2.56.0.tar.gz) ====== [步骤 2/3] 执行统一预编译与暂存(含自愈合引擎) ===[*] 执行构建命令 (尝试 1/3): ./configure --prefix=/usr[*] 执行构建命令 (尝试 1/3): make -j8[*] 事后自愈合引擎触发:动态补装 Rust/Cargo.../bin/sh: 1: yum: not foundReading package lists... DoneBuilding dependency tree... DoneReading state information... DoneThe following additional packages will be installed:libgit2-1.7 libhttp-parser2.9 libllvm17t64 libssh2-1t64 libstd-rust-1.75 libstd-rust-devSuggested packages:cargo-doc llvm-17 lld-17 clang-17The following NEW packages will be installed:cargo libgit2-1.7 libhttp-parser2.9 libllvm17t64 libssh2-1t64 libstd-rust-1.75 libstd-rust-dev rustc0 upgraded, 8 newly installed, 0 to remove and 201 not upgraded.Need to get 97.4 MB of archives.After this operation, 419 MB of additional disk space will be used.Get:1 http://hk.archive.ubuntu.com/ubuntu noble/main amd64 libhttp-parser2.9 amd64 2.9.4-6build1 [22.3 kB]Get:2 http://hk.archive.ubuntu.com/ubuntu noble-updates/main amd64 libssh2-1t64 amd64 1.11.0-4.1ubuntu0.24.04.4 [121 kB]Get:3 http://hk.archive.ubuntu.com/ubuntu noble-updates/main amd64 libgit2-1.7 amd64 1.7.2+ds-1ubuntu3.3 [530 kB]Get:4 http://hk.archive.ubuntu.com/ubuntu noble/main amd64 libllvm17t64 amd64 1:17.0.6-9ubuntu1 [26.2 MB]Get:5 http://hk.archive.ubuntu.com/ubuntu noble-updates/main amd64 libstd-rust-1.75 amd64 1.75.0+dfsg0ubuntu1-0ubuntu7.4 [20.2 MB]Get:6 http://hk.archive.ubuntu.com/ubuntu noble-updates/main amd64 libstd-rust-dev amd64 1.75.0+dfsg0ubuntu1-0ubuntu7.4 [40.8 MB]Get:7 http://hk.archive.ubuntu.com/ubuntu noble-updates/main amd64 rustc amd64 1.75.0+dfsg0ubuntu1-0ubuntu7.4 [3,372 kB]Get:8 http://hk.archive.ubuntu.com/ubuntu noble-updates/main amd64 cargo amd64 1.75.0+dfsg0ubuntu1-0ubuntu7.4 [6,217 kB]Fetched 97.4 MB in 10s (10.2 MB/s)Selecting previously unselected package libhttp-parser2.9:amd64.(Reading database ... 210316 files and directories currently installed.)Preparing to unpack .../0-libhttp-parser2.9_2.9.4-6build1_amd64.deb ...Unpacking libhttp-parser2.9:amd64 (2.9.4-6build1) ...Selecting previously unselected package libssh2-1t64:amd64.Preparing to unpack .../1-libssh2-1t64_1.11.0-4.1ubuntu0.24.04.4_amd64.deb ...Unpacking libssh2-1t64:amd64 (1.11.0-4.1ubuntu0.24.04.4) ...Selecting previously unselected package libgit2-1.7:amd64.Preparing to unpack .../2-libgit2-1.7_1.7.2+ds-1ubuntu3.3_amd64.deb ...Unpacking libgit2-1.7:amd64 (1.7.2+ds-1ubuntu3.3) ...Selecting previously unselected package libllvm17t64:amd64.Preparing to unpack .../3-libllvm17t64_1%3a17.0.6-9ubuntu1_amd64.deb ...Unpacking libllvm17t64:amd64 (1:17.0.6-9ubuntu1) ...Selecting previously unselected package libstd-rust-1.75:amd64.Preparing to unpack .../4-libstd-rust-1.75_1.75.0+dfsg0ubuntu1-0ubuntu7.4_amd64.deb ...Unpacking libstd-rust-1.75:amd64 (1.75.0+dfsg0ubuntu1-0ubuntu7.4) ...Selecting previously unselected package libstd-rust-dev:amd64.Preparing to unpack .../5-libstd-rust-dev_1.75.0+dfsg0ubuntu1-0ubuntu7.4_amd64.deb ...Unpacking libstd-rust-dev:amd64 (1.75.0+dfsg0ubuntu1-0ubuntu7.4) ...Selecting previously unselected package rustc.Preparing to unpack .../6-rustc_1.75.0+dfsg0ubuntu1-0ubuntu7.4_amd64.deb ...Unpacking rustc (1.75.0+dfsg0ubuntu1-0ubuntu7.4) ...Selecting previously unselected package cargo.Preparing to unpack .../7-cargo_1.75.0+dfsg0ubuntu1-0ubuntu7.4_amd64.deb ...Unpacking cargo (1.75.0+dfsg0ubuntu1-0ubuntu7.4) ...Setting up libllvm17t64:amd64 (1:17.0.6-9ubuntu1) ...Setting up libssh2-1t64:amd64 (1.11.0-4.1ubuntu0.24.04.4) ...Setting up libhttp-parser2.9:amd64 (2.9.4-6build1) ...Setting up libstd-rust-1.75:amd64 (1.75.0+dfsg0ubuntu1-0ubuntu7.4) ...Setting up libstd-rust-dev:amd64 (1.75.0+dfsg0ubuntu1-0ubuntu7.4) ...Setting up rustc (1.75.0+dfsg0ubuntu1-0ubuntu7.4) ...Setting up libgit2-1.7:amd64 (1.7.2+ds-1ubuntu3.3) ...Setting up cargo (1.75.0+dfsg0ubuntu1-0ubuntu7.4) ...Processing triggers for man-db (2.12.0-4build2) ...Processing triggers for libc-bin (2.39-0ubuntu8.9) ...[*] 执行构建命令 (尝试 2/3): make -j8[*] 执行构建命令 (尝试 1/3): make DESTDIR=/tmp/tmpsonr5wqo/source_src/raw_staging install[*] 动态探并精准部署主配置文件: /etc/git/apache.conf=== [步骤 3/3] 生成 .deb 包 ===dpkg-deb: building package 'git' in '/home/rambo/source_to/git_2.56.0_amd64.deb'.[+] 目标包生成圆满成功:- /home/rambo/source_to/git_2.56.0_amd64.deb# 源码转rpmrambo@ub2404:~/source_to$ sudo python3 converter.py git-2.56.0.tar.gz git 2.56.0 --format rpm........warning: Duplicate build-ids /tmp/tmp1a_rhkrf/rpmbuild/BUILDROOT/git-2.56.0-1.x86_64/usr/libexec/git-core/git-for-each-ref antwarning: Duplicate build-ids /tmp/tmp1a_rhkrf/rpmbuild/BUILDROOT/git-2.56.0-1.x86_64/usr/libexec/git-core/git-for-each-ref aneProvides: git = 2.56.0-1 git(x86-64) = 2.56.0-1Requires(interp): /bin/shWrote: /tmp/tmp1a_rhkrf/rpmbuild/RPMS/x86_64/git-2.56.0-1.x86_64.rpmExecuting(%clean): /bin/sh -e /var/tmp/rpm-tmp.WJ9H5v+ umask 022+ cd /tmp/tmp1a_rhkrf/rpmbuild/BUILD+ cd precompiled+ /usr/bin/rm -rf /tmp/tmp1a_rhkrf/rpmbuild/BUILDROOT/git-2.56.0-1.x86_64+ RPM_EC=0++ jobs -p+ exit 0=== [步骤 1/3] 解压源码包 (git-2.56.0.tar.gz) ====== [步骤 2/3] 执行统一预编译与暂存(含自愈合引擎) ===[*] 执行构建命令 (尝试 1/3): ./configure --prefix=/usr[*] 执行构建命令 (尝试 1/3): make -j8[*] 执行构建命令 (尝试 1/3): make DESTDIR=/tmp/tmp1a_rhkrf/source_src/raw_staging install[*] 动态探并精准部署主配置文件: /etc/git/apache.conf=== [步骤 3/3] 生成红帽 DevOps 原生 .rpm 包 ===[+] 目标包生成圆满成功:- /workspace/git-2.56.0-1.x86_64.rpmrambo@ub2404:~/source_to$ ls -alh git*-rw-r--r-- 1 root root 1.2G Nov 5 01:49 git-2.56.0-1.x86_64.rpm-rw-r--r-- 1 root root 1.2G Nov 5 02:18 git_2.56.0_amd64.deb-rw-rw-r-- 1 rambo rambo 13M Sep 29 00:01 git-2.56.0.tar.gz


















































































