RPM Package Management

v4.0.0

RPM 包管理专家。提供 spec 文件分析、构建、验证、依赖管理、宏系统、多构建系统支持。适用于 Red Hat/Fedora/CentOS/openSUSE/openEuler 等所有 RPM 发行版。包含完整的构建系统模板(Autotools/CMake/Meson/Python/Node.js)和 RPM...

0· 139·1 current·1 all-time
bywei dong@weidongkl

Install

OpenClaw Prompt Flow

Install with OpenClaw

Best for remote or guided setup. Copy the exact prompt, then paste it into OpenClaw for weidongkl/rpm.

Previewing Install & Setup.
Prompt PreviewInstall & Setup
Install the skill "RPM Package Management" (weidongkl/rpm) from ClawHub.
Skill page: https://clawhub.ai/weidongkl/rpm
Keep the work scoped to this skill only.
After install, inspect the skill metadata and help me finish setup.
Use only the metadata you can verify from ClawHub; do not invent missing requirements.
Ask before making any broader environment changes.

Command Line

CLI Commands

Use the direct CLI path if you want to install manually and keep every step visible.

OpenClaw CLI

Canonical install target

openclaw skills install weidongkl/rpm

ClawHub CLI

Package manager switcher

npx clawhub@latest install rpm
Security Scan
VirusTotalVirusTotal
Benign
View report →
OpenClawOpenClaw
Benign
high confidence
Purpose & Capability
The name/description (RPM packaging tooling, spec analysis, build workflows) aligns with the instructions provided. The SKILL.md contains expected commands (rpmbuild, mock, rpmlint, osc, rpm, etc.). Minor inconsistency: package.json shows version 1.0.1 while SKILL.md and registry metadata claim 4.0.0, and the skill has no homepage/source/author provenance; this is an organizational/information integrity note but not a functional mismatch.
Instruction Scope
Instructions stay within RPM packaging scope (creating/editing spec files, building SRPM/RPM, running rpmlint, mock/OBS builds). They do include commands that operate at system level (rpm -e, rpm -ivh, rpmbuild) and an example curl pipeline to check remote releases; these are expected for this domain but mean the user should not run them without verifying sources and should prefer isolated build environments (mock/OBS/chroot) because RPM spec scripts can execute arbitrary code at install time.
Install Mechanism
No install spec and no code files are executed — this is an instruction-only skill (lowest install risk). package.json is metadata-only and does not introduce downloads or installs.
Credentials
The skill requests no environment variables, no credentials, and no config paths. That is proportional for an instruction-only packaging helper.
Persistence & Privilege
always:false and normal user-invocation/autonomous invocation defaults are set. The skill does not request elevated persistence or modify other skills' configs.
Assessment
This skill is essentially a documented RPM packaging workflow and appears coherent with that purpose. Before using it: (1) verify the skill's origin since Homepage/Source are missing and package.json version differs from SKILL.md; (2) run builds in isolated environments (mock, OBS, or chroot) rather than as root on your host, because spec files and package install scripts can run arbitrary commands; (3) inspect any upstream Source URLs and downloaded tarballs before building; (4) avoid running destructive rpm -e / rpm -ivh commands on production systems without backups; and (5) confirm required host tools (rpmbuild, mock, rpmlint, osc) are the expected versions for your distro. If you need higher assurance, ask the publisher for a provenance link or a signed release/archive.

Like a lobster shell, security has layers — review code before you run it.

build-systemvk976wc8p53dgeefr4rm70txz0183ehtjlatestvk9745ek3d5365c2w4cady7wdkh85eteslinuxvk976xz60t6bqt0t53b21cbmn3s83f6ywpackagingvk976xz60t6bqt0t53b21cbmn3s83f6ywrpmvk976xz60t6bqt0t53b21cbmn3s83f6yw
139downloads
0stars
5versions
Updated 4h ago
v4.0.0
MIT-0

RPM 包管理技能

🚀 快速开始

1. 创建 spec 文件

rpmdev-newspec -o mypackage.spec mypackage

2. 构建 RPM

rpmbuild -ba mypackage.spec
# 或使用 mock (推荐)
mock -r fedora-39-x86_64 mypackage.spec

3. 检查质量

rpmlint mypackage.spec

📋 核心功能

1. Spec 文件分析与优化

  • ✅ 自动检测 spec 文件问题
  • ✅ 提供优化建议
  • ✅ 符合官方打包指南
  • ✅ RPMLint 集成

2. 多构建系统支持

构建系统PrepBuildInstall
Autotools%autosetup -p1%configure%make_install
CMake%autosetup -p1%cmake%cmake_install
Meson%autosetup -p1%meson%ninja_install
Python%autosetup -p1 -n %{name}-%{version}%pyproject_build_wheel%pyproject_make_binary
Node.js%autosetup -p1 -n packagenpm install手动安装

3. 自动化构建

  • 本地构建 | rpmbuild -ba
  • Mock 构建 | mock --rebuild
  • OBS 构建 | osc build

4. 包验证与测试

  • RPMLint 集成
  • 签名验证
  • 文件完整性检查
  • 运行时测试

5. 依赖管理

  • 自动依赖生成
  • 依赖解析
  • 依赖冲突检测
  • 反向依赖查询

6. 宏系统深入理解

  • 宏定义与展开
  • 宏调试
  • 宏文档查询

📝 Spec 文件标准结构

Name:           mypackage
Version:        1.0.0
Release:        0%{?dist}
Summary:        Package summary

License:        MIT
URL:            https://example.com
Source0:        https://github.com/%{url}/releases/download/%{version}/%{name}-%{version}.tar.gz

BuildRequires:  gcc
BuildRequires:  make
Requires:       glibc >= 2.17

%description
Detailed package description.

%prep
%autosetup -p1

%build
%configure
%make_build

%install
%make_install

%check
make test

%files
%license LICENSE
%doc README.md
%{_bindir}/%{name}

%changelog
* Thu Apr 16 2026 Your Name <your@email.com> - 1.0.0-1
- Update to 1.0.0
- Fix build issues

🔧 常用命令

RPM 查询

rpm -qa                    # 所有已安装包
rpm -qi package           # 包信息
rpm -ql package           # 文件列表
rpm -qR package           # 依赖
rpm -qf /path/to/file     # 文件归属

构建命令

rpmbuild -ba spec         # 构建 SRPM+RPM
rpmbuild -bs spec         # 仅构建 SRPM
rpmbuild -bb spec         # 仅构建 RPM
mock -r fedora-39-x86_64 --rebuild src.rpm
osc build                 # OBS 构建

验证命令

rpmlint spec              # 检查 spec 文件
rpmlint rpm               # 检查 RPM
rpm -V package            # 验证包
rpm -Va                   # 验证所有包

宏管理

rpm --showrc              # 查看所有宏
rpm --eval '%{name}'      # 展开宏
rpmspec -E spec           # 检查 spec 宏

🎯 工作流

新包构建流程

1. 创建 spec → rpmdev-newspec -o mypackage.spec
2. 编辑 spec → 填写元数据、依赖、构建指令
3. 本地构建 → rpmbuild -ba mypackage.spec
4. 质量检查 → rpmlint mypackage.spec
5. 修正问题 → 根据 RPMLint 报告修改
6. Mock 构建 → mock --rebuild src.rpm (可选)
7. OBS 构建 → osc build (如需要)

升级现有包流程

1. 检查新版本 → curl -s https://example.com/releases | grep mypackage
2. 更新 Source0 → %update_source_url mypackage.spec
3. 更新 Version → sed -i "s/^Version:.*/Version:/new/" mypackage.spec
4. 更新 Release → Release: 1%{?dist}
5. 更新 changelog → 添加新条目
6. 重建构建 → rpmbuild -ba mypackage.spec
7. 验证功能 → rpm -e && rpm -ivh package.rpm

🔍 RPMLint 常见错误

错误说明修复方法
invalid-licenseLicense 不在标准列表参考 SPDX License List
no-description缺少 %description添加描述
spurious-executable-permission文件有执行权限但不是脚本移除执行位或添加 %{_bindir}
summary-not-capitalizedSummary 首字母未大写大写首字母
wrong-file-end-of-line-encoding文件编码问题用 UTF-8 保存

🏗️ 构建系统模板

Autotools

BuildRequires: autoconf automake libtool
%prep: %autosetup -p1
%build: %configure && %make_build
%install: %make_install

CMake

BuildRequires: cmake
%prep: %autosetup -p1
%build: %cmake && %cmake_build
%install: %cmake_install

Meson

BuildRequires: meson ninja-build
%prep: %autosetup -p1
%build: %meson && %ninja_build
%install: %ninja_install

Python

BuildRequires: python3-devel python3-setuptools
%prep: %autosetup -p1 -n %{name}-%{version}
%build: %pyproject_build_wheel && %pyproject_install
%install: %pyproject_make_binary

Node.js

BuildRequires: nodejs npm
%prep: %autosetup -p1 -n package
%build: npm install --production=false && npm run build
%install: mkdir -p %{buildroot}%{_datadir}/%{name} && cp -r . %{buildroot}%{_datadir}/%{name}/

🔄 宏参考

路径
%{_bindir}/usr/bin
%{_libdir}/usr/lib[64]
%{_datadir}/usr/share
%{_sysconfdir}/etc
%{_docdir}/usr/share/doc
%{_mandir}/usr/share/man
%{_topdir}~/rpmbuild

📚 最佳实践

Spec 文件编写

  • ✅ 使用 %autosetup 而非手动 %setup
  • ✅ 使用 %{_bindir} 等标准宏
  • ✅ 提供详细的 changelog 条目
  • ✅ 优先使用标准构建系统宏
  • ✅ 运行 rpmlint 检查

构建优化

  • ✅ 使用并行构建 make %{?_smp_mflags}
  • ✅ 使用 mock 或 OBS 进行干净构建
  • ✅ 明确声明所有依赖
  • ✅ 使用 %{?dist} 区分发行版
  • ✅ 避免 AutoReq: no

质量控制

  • ✅ 运行 rpmlint 检查 spec
  • ✅ 验证签名和校验和
  • ✅ 测试安装/卸载
  • ✅ 检查依赖完整性
  • ✅ 验证文件权限

📋 依赖技能

本技能可与以下技能配合使用:

技能用途
openeuler-rpmopenEuler 专项打包规范
kojiKoji 构建系统集成

版本: 4.0.0 | 作者: OS Build Agent

Comments

Loading comments...