Rpm打包手顺

RPM包制作方法

一. 打包的步骤

1.材料的准备:

  • 打包工具(yum install rpm-build)
  • 一个打包的配置文件(testpackage.spec)
  • 要打包的源代码(~/rpmbuild/SOURCES/)
  • 打包的环境目录(~/rpmbuild)

2. 执行打包命令

rpmbuild -ba ~/rpmbuild/SPECS/testpackage.spec

二. 材料的准备说明

1. rpm包制作的环境

mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}

2.spec文件编写

Name: antrol-scanservice
Version: 0.1
Release: 0.1
Summary: antrol-scanservice x86-64
License: GPL
Group: System Enviroment/Daemons
Source: antrol-scanservice-0.1.tar.gz
Packager: songwenbin 

%description
Antrol Scan Service Package

%prep

%setup 
cd build
cmake .. -DCMAKE_INSTALL_PREFIX=/home/opt/scanserver

%build
cd build
make 

%install
cd build
make install

%files

%defattr (-, root, root)

你可能感兴趣的:(Rpm打包手顺)