The method of making rpm packages under linux

  
RPM is the abbreviation of RPM Package Manager. Although the file format name is marked with RedHat, its original design concept is open. The method of making and installing rpm package in linux environment is as follows:
First, make rpm package
rp-pppoe-3.10 for the production process.
1. Download rp-pppoe-3.10.tar.gz
[root@localhost home]# pwd
/home
[root@localhost home]#
2.Unzip
# tar zxvf rp-pppoe-3.10.tar.gz
3.
# cp /home/rp-pppoe-3.10/rp-pppoe.spec /usr/src/redhat/SOURCES/
# cp /home/rp-pppoe-3.10.tar.gz /usr/src/redhat/SOURCES/
3. Make rpm包
# cd /usr/src/redhat/SOURCES/
# rpmbuild -bb Rp-pppoe.spec <==Compile only to RPM files
# rpmbuild -ba rp-pppoe.spec <==Compile and generate RPM and SRPM files at the same time
If the compilation is successful, rp is already created -pppoe rpm package, check
[root@localhost i386]# pwd
/usr/src/redhat/RPMS/i386
[root@localhost i386]# ll
total 420< Br>-rw-r--r-- 1 root root 186322 01-06 11:09 rp-pppoe-3.10-1.i386.rpm
-rw-r--r-- 1 root root 150356 01- 06 11:09 rp-pppoe-debuginfo-3.10-1.i386.rpm
-rw-r--r-- 1 root root 63319 01-06 11:09 rp-pppoe-gui-3.10-1.i386 .rpm
[root@localhost i386]#
Second, rpm package installation under linux
1. Check the system has five installed rp-pppoe.
[root@localhost i386]# rpm -qa rp-pppoe
rp-pppoe-3.5-1
2.Remove the rpm package that the system has installed
[root@localhost i386]# rpm -e rp-pppoe
[root@localhost i386]# rpm -qa rp-pppoe
3. Install the rpm package just made
[root@localhost i386]# ls
rp-pppoe -3.10-1.i386.rpm rp-pppoe-gui-3.10-1.i386.rpm
rp-pppoe-debuginfo-3.10-1.i386.rpm
[root@localhost i386]# rpm -ivh Rp-pppoe-3.10-1.i386.rpm
Preparing... ############################################## ########### [100%]
1: rp-pppoe ######################################### ################[100%]
[root@localhost i386]# rpm -qa rp-pppoe
rp-pppoe-3.10-1
[ ,null,null,3],Root@localhost i386]# ls /etc/ppp/pppoe-server-options
/etc/ppp/pppoe-server-options
The above information indicates that the installation was successful.
Three, linux under the installation and installation of rpm package error solution
When making rpm (1.3 steps) error:
RPM build errors:
Installed (but unpackaged) file(s) found:
Workaround:
Comment out
%__check_files /usr/lib/rpm/check-files %{buildroot} in /usr/lib/rpm/macros

Copyright © Windows knowledge All Rights Reserved