标签:lin 需要 而且 代码 share 演示 file cti post
fpm 是一个不错,而且强大的rpm、deb,系统启动服务工具包,我们可以用来快速的生成专业的软件分发包
演示一个pg 扩展包分发包的生成(rpm 以及deb)
sudo gem install --no-ri --no-rdoc fpm
代码已经写好了,使用plgo 参考https://www.cnblogs.com/rongfengliang/p/10672695.html
git clone https://github.com/rongfengliang/fpm-pg-extension-package-generate-demo
fpm -s dir -t rpm -n myplgo-extension ./example--0.1.sql=/usr/pgsql-10/share/extension/ ./example.control=/usr/pgsql-10/share/extension/ ./example.so=/usr/pgsql-10/lib/
rpm2cpio myplgo-extension-1.0-1.x86_64.rpm | cpio -t
效果
./usr/pgsql-10/lib/example.so
./usr/pgsql-10/share/extension/example--0.1.sql
./usr/pgsql-10/share/extension/example.control
fpm -s dir -t deb -n myplgo-extension ./example--0.1.sql=/usr/pgsql-10/share/extension/ ./example.control=/usr/pgsql-10/share/extension/ ./example.so=/usr/pgsql-10/lib/
dpkg -c myplgo-extension_1.0_amd64.deb
drwxr-xr-x 0/0 0 2019-04-09 13:08 ./
drwxr-xr-x 0/0 0 2019-04-09 13:08 ./usr/
drwxr-xr-x 0/0 0 2019-04-09 13:08 ./usr/pgsql-10/
drwxr-xr-x 0/0 0 2019-04-09 13:08 ./usr/pgsql-10/lib/
-rw-r--r-- 0/0 3316752 2019-04-09 11:39 ./usr/pgsql-10/lib/example.so
drwxr-xr-x 0/0 0 2019-04-09 13:08 ./usr/pgsql-10/share/
drwxr-xr-x 0/0 0 2019-04-09 13:08 ./usr/pgsql-10/share/extension/
-rw-r--r-- 0/0 1005 2019-04-09 11:39 ./usr/pgsql-10/share/extension/example--0.1.sql
-rw-r--r-- 0/0 92 2019-04-09 11:39 ./usr/pgsql-10/share/extension/example.control
drwxr-xr-x 0/0 0 2019-04-09 13:08 ./usr/share/
drwxr-xr-x 0/0 0 2019-04-09 13:08 ./usr/share/doc/
drwxr-xr-x 0/0 0 2019-04-09 13:08 ./usr/share/doc/myplgo-extension/
-rw-r--r-- 0/0 142 2019-04-09 13:08 ./usr/share/doc/myplgo-extension/changelog.gz
演示的比较简单,主要是使用fpm 也很简单,我们不需要关注太多的包代码细节,直接使用就可以了,主要是进行配置而已
对于需要添加系统服务的也很简单,参考如下:
% fpm -s pleaserun -t rpm -n example /usr/bin/example
% rpm -qlp example-1.0-1.x86_64.rpm
/usr/share/pleaserun/example/generate-cleanup.sh
/usr/share/pleaserun/example/install-path.sh
/usr/share/pleaserun/example/install.sh
/usr/share/pleaserun/example/launchd/10.9/files/Library/LaunchDaemons/example.plist
/usr/share/pleaserun/example/launchd/10.9/install_actions.sh
/usr/share/pleaserun/example/systemd/default/files/etc/default/example
/usr/share/pleaserun/example/systemd/default/files/etc/systemd/system/example.service
/usr/share/pleaserun/example/systemd/default/install_actions.sh
/usr/share/pleaserun/example/sysv/lsb-3.1/files/etc/default/example
/usr/share/pleaserun/example/sysv/lsb-3.1/files/etc/init.d/example
/usr/share/pleaserun/example/upstart/0.6.5/files/etc/default/example
/usr/share/pleaserun/example/upstart/0.6.5/files/etc/init/example.conf
/usr/share/pleaserun/example/upstart/1.5/files/etc/default/example
/usr/share/pleaserun/example/upstart/1.5/files/etc/init/example.conf
https://github.com/rongfengliang/fpm-pg-extension-package-generate-demo
https://www.cnblogs.com/rongfengliang/p/10674023.html
https://www.cnblogs.com/rongfengliang/p/10672695.html
https://github.com/rongfengliang/plgo-rpm
https://github.com/rongfengliang/plgo
https://fpm.readthedocs.io/en/latest/intro.html
使用fpm 方便快速生成postgresql extension分发包
标签:lin 需要 而且 代码 share 演示 file cti post
原文地址:https://www.cnblogs.com/rongfengliang/p/10676353.html