FPM custom NGINX RPM package

Obtain and install FPM

Links: https://pan.baidu.com/s/1JM2GIrSG4xgVcVZhIwNogw
extraction code: ztfe

rpm -ivh fpm-1.6.3-1.x86_64.rpm 
[root@nginx1 /]# fpm -v
1.6.3

FPM common parameters

parameter Explanation
-s Specifies the source type, that is what you want to package a file or directory
-d Specify a dependency on those packages
-t Specify the type of package
-n Specify the name of the package
-v Specifies the package version number
-C Specify the relative path packaged
-f Specify the path to the file needs to be packaged
-p The lay of the packet is output to the specified path
–post-install After completing the package installation script to be executed, the same: after-install
–pre-install Script to be executed before the package is installed, with: befor-install
–post-uninstall Packages uninstall script to be executed after the completion of the same: after-remove
–pre-uninstall Before the uninstall is complete script package to be executed, the same: before-remove

Open and empty before the yum cache data

sed -i 's#keepcache=0#keepcache=1#g' /etc/yum.conf
find /var/cache/ -type f -name '*.rpm' |xargs rm -f

Download nginx dependence

yum install -y pcre-devel openssl-devel

Download dependence packaged good

find /var/cache/ -type f -name '*.rpm'|xargs cp -t /tmp/
cd /tmp/
tar zcf nginx_yum.tar.gz *.rpm

Nginx will be installed rpm package

fpm -s dir -t rpm -n nginx -v 1.6.3 -d 'pcre-devel openssl-devel' -f /application/nginx-1.6.3/

The downloaded files packed and

sz nginx_yum.tar.gz 
sz nginx-1.6.3-1.x86_64.rpm 

installation

Uploaded nginx_yum.tar.gz decompression

tar xf nginx_yum.tar.gz
yum localinstall *.rpm

verification

ll /application/
[root@nginx1 ~]# ll /application/
总用量 4
drwxr-xr-x 16 root root 4096 5月   6 15:36 nginx-1.6.3

Guess you like

Origin blog.csdn.net/qq_33235529/article/details/89886122