使用deb 打包开发的postgres extension

昨天写过一个使用rpm 打包分发pg 扩展的demo,今天使用deb 进行打包分发,同时使用checkinstall 生成我们的deb包

安装deb 依赖

sudo apt-get install checkinstall build-essential automake autoconf libtool pkg-config libcurl4-openssl-dev intltool libxml2-dev libgtk2.0-dev libnotify-dev libglib2.0-dev libevent-dev

clone pg 扩展代码

git clone https://github.com/rongfengliang/nvl-pg-extension.git

使用checkinstall 生成deb 包

  • 命令
checkinstall

效果

checkinstall

checkinstall 1.6.2, Copyright 2009 Felipe Eduardo Sanchez Diaz Duran
           This software is released under the GNU GPL.


The package documentation directory ./doc-pak does not exist.
Should I create a default set of package docs? [y]: y

Preparing package documentation...OK

Please write a description for the package.
End your description with an empty line or EOF.
>> this is a oracel like nvl function for pg

修改Version 的名称,使用数字开头,这个是约定,按照以下提示输入3操作即可,比如0.1

This package will be built according to these values:

0 - Maintainer: [ root@iZ2zec9crwxl1n9hb7hxgpZ ]
1 - Summary: [ demo ]
2 - Name: [ nvl-pg ]
3 - Version: [ extension ]
4 - Release: [ 1 ]
5 - License: [ GPL ]
6 - Group: [ checkinstall ]
7 - Architecture: [ amd64 ]
8 - Source location: [ nvl-pg-extension ]
9 - Alternate source location: [ ]
10 - Requires: [ ]
11 - Provides: [ nvl-pg ]
12 - Conflicts: [ ]
13 - Replaces: [ ]

deb 包生成日志

nter a number to change any of them or press ENTER to continue:

Installing with make install...

========================= Installation results ===========================
/bin/mkdir -p '/usr/share/postgresql/10/extension'
/bin/mkdir -p '/usr/share/postgresql/10/extension'
/usr/bin/install -c -m 644 .//nvlfunc.control '/usr/share/postgresql/10/extension/'
/usr/bin/install -c -m 644 .//nvlfunc--1.0.sql '/usr/share/postgresql/10/extension/'

======================== Installation successful ==========================

Copying documentation directory...
./
./README.md

Copying files to the temporary directory...OK

Stripping ELF binaries and libraries...OK

Compressing man pages...OK

Building file list...OK

Building Debian package...OK

Installing Debian package...OK

Erasing temporary files...OK

Writing backup package...OK
OK

Deleting temp dir...OK


**********************************************************************

 Done. The new package has been installed and saved to

 /opt/deb-app/nvl-pg-extension/nvl-pg_0.1-1_amd64.deb

 You can remove it from your system anytime using:

      dpkg -r nvl-pg

**********************************************************************
  • 说明
    需要删除copy的文件,这点不如rpm 好(rpm 有一个buildroot 的目录),checkinstall 直接就安装了
  • 生成的文件
├── Makefile
├── README.md
├── backup-040420191431-pre-nvl-pg.tgz
├── description-pak
├── doc-pak
│ └── README.md
├── nvl-pg_0.1-1_amd64.deb
├── nvlfunc--1.0.sql
└── nvlfunc.control

安装

  • 安装
dpkg -i nvl-pg_0.1-1_amd64.deb
  • 效果
(Reading database ... 115363 files and directories currently installed.)
Preparing to unpack nvl-pg_0.1-1_amd64.deb ...
Unpacking nvl-pg (0.1-1) over (0.1-1) ...
Setting up nvl-pg (0.1-1) ...
Processing triggers for postgresql-common (199.pgdg18.04+1) ...
Building PostgreSQL dictionaries from installed myspell/hunspell packages...
Removing obsolete dictionary files:

pg 扩展目录

find /usr/share/postgresql/10/extension/ -name nvlfunc.control
/usr/share/postgresql/10/extension/nvlfunc.control

说明

使用checkinstall 方式打包deb 包还是很方便的,简单,省事

参考资料

https://www.ostechnix.com/create-deb-file-source-ubuntu-16-04/

posted on   荣锋亮  阅读(340)  评论(0编辑  收藏  举报

编辑推荐:
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· 没有源码,如何修改代码逻辑?
阅读排行:
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· 记一次.NET内存居高不下排查解决与启示
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· .NET10 - 预览版1新功能体验(一)
历史上的今天:
2017-04-04 lua resty template && openresty 使用
2017-04-04 jekyll 安装使用

导航

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5
点击右上角即可分享
微信分享提示