返回顶部
🇺🇸 English
🇨🇳 简体中文
🇨🇳 繁體中文
🇺🇸 English
🇯🇵 日本語
🇰🇷 한국어
🇫🇷 Français
🇩🇪 Deutsch
🇪🇸 Español
🇷🇺 Русский
r

rpm-packager

Build RPM packages from source code for CentOS/RHEL systems. Use when user needs to: (1) package software source into installable RPM, (2) create SPEC files, (3) build packages for CentOS 7/8/9 or RHEL, (4) prepare software for distribution on RPM-based Linux systems.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.0
安全检测
已通过
334
下载量
免费
免费
0
收藏
概述
安装方式
版本历史

rpm-packager

# RPM Packager Skill Transform source code into installable RPM packages for CentOS/RHEL systems. ## Quick Start ```bash # Basic usage ./scripts/build-rpm.sh <source-dir> <package-name> <version> <release> # Example ./scripts/build-rpm.sh ./myapp myapp 1.0.0 1 ``` ## Workflow ### 1. Prepare Source Code Ensure source code is ready: - Has a build system (Makefile, CMakeLists.txt, setup.py, etc.) - Clean directory structure - No build artifacts ### 2. Check Prerequisites Required tools on CentOS/RHEL (**requires sudo privileges**): ```bash sudo yum install rpm-build mock gcc make ``` > **Note:** Installing system packages requires `sudo` privileges. The build process itself runs as your user account. ### 3. Run Build Script ```bash cd ~/.openclaw/workspace/skills/rpm-packager chmod +x scripts/build-rpm.sh ./scripts/build-rpm.sh /path/to/source package-name 1.0.0 1 ``` ### 4. Verify Output Build produces: - Binary RPM: `~/rpmbuild/RPMS/x86_64/package-name-1.0.0-1.el8.x86_64.rpm` - Source RPM: `~/rpmbuild/SRPMS/package-name-1.0.0-1.el8.src.rpm` ### 5. Install & Test ```bash # Install the RPM sudo rpm -ivh ~/rpmbuild/RPMS/x86_64/package-name-1.0.0-1.el8.x86_64.rpm # Or use yum/dnf for dependency resolution sudo yum localinstall ~/rpmbuild/RPMS/x86_64/package-name-1.0.0-1.el8.x86_64.rpm # Verify installation rpm -q package-name ``` ## SPEC File Customization For complex packages, customize the SPEC file: 1. **Review template**: See [references/spec-template.md](references/spec-template.md) 2. **Edit generated SPEC**: Modify `~/rpmbuild/SPECS/package-name.spec` 3. **Rebuild**: `rpmbuild -ba ~/rpmbuild/SPECS/package-name.spec` ### Common Customizations **Add dependencies:** ```spec BuildRequires: python3-devel openssl-devel Requires: python3 openssl-libs ``` **Custom install paths:** ```spec %install mkdir -p %{buildroot}%{_bindir} mkdir -p %{buildroot}%{_sysconfdir}/package-name install -m 755 myapp %{buildroot}%{_bindir}/ install -m 644 config.conf %{buildroot}%{_sysconfdir}/package-name/ ``` **Include documentation:** ```spec %files %doc README.md LICENSE CHANGELOG.md %{_bindir}/myapp ``` ## Build for Different CentOS Versions Use mock for clean builds targeting specific versions: ```bash # CentOS 7 mock -r centos-7-x86_64 package-name.spec # CentOS 8 mock -r centos-8-x86_64 package-name.spec # CentOS 9 mock -r centos-9-x86_64 package-name.spec ``` ## Environment Variables | Variable | Default | Description | |----------|---------|-------------| | `RPM_BUILDER_NAME` | `OpenClaw Builder` | Builder name in changelog | | `RPM_BUILD_DIR` | `~/rpmbuild` | Custom build directory | ## Troubleshooting ### Build fails with "No such file or directory" - Check `BuildRequires` for missing tools - Verify source tarball extracts correctly ### RPM installs but command not found - Ensure `%files` section includes correct paths - Check executable permissions in `%install` ### Dependency errors during install - Add missing `Requires` entries to SPEC file - Use `yum localinstall` instead of `rpm -i` for auto-dependency resolution ## Output Locations After successful build: - **Binary RPMs**: `~/rpmbuild/RPMS/<arch>/` - **Source RPM**: `~/rpmbuild/SRPMS/` - **Build logs**: `~/rpmbuild/BUILDLOGS/` - **SPEC files**: `~/rpmbuild/SPECS/` ## Security Notes - Build directory defaults to `~/rpmbuild` to avoid conflicts with system-wide builds - Builder identity is anonymized by default (uses `OpenClaw Builder`) - No personal information is embedded in generated RPMs unless explicitly configured

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 rpm-packager-1776277334 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 rpm-packager-1776277334 技能

通过命令行安装

skillhub install rpm-packager-1776277334

下载

⬇ 下载 rpm-packager v1.0.0(免费)

文件大小: 5.59 KB | 发布时间: 2026-4-16 17:26

v1.0.0 最新 2026-4-16 17:26
Initial release of rpm-packager.

- Build RPM packages from source code for CentOS/RHEL systems.
- Includes automated script for building packages with sample usage.
- Guides for preparing source, installing prerequisites, and running the build process.
- Instructions for customizing SPEC files and handling dependencies.
- Supports builds for CentOS 7/8/9 using mock.
- Documents output locations, environment variables, and security notes.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部