前边有写过简单rpm 包的制作,现在制作一个简单的deb 包。
deb 包的制作是通过源码编译+ fpm
curl https://sh.rustup.rs -sSf | sh
rustup install nightly-2019-05-14
rustup default nightly-2019-05-14
apt-get update
apt-get install git pkg_config
git clone https://github.com/rongfengliang/myvigil-multiemail.git
cd myvigil-multiemail && cargo build --release
sudo apt-get update
sudo apt-get install ruby-dev build-essential
sudo gem install fpm
fpm -s dir -t deb -n vigil --config-files /etc/vigil.cfg -v 2.0 ./vigil=/usr/bin/ ./vigil.cfg=/etc/ ./res=/etc/vigil/ ./vigil.service=/lib/systemd/system/vigil.service
├── res
├── vigil
├── vigil.cfg
├── vigil.service
fpm -s dir -t deb -n vigil --config-files /etc/vigil.cfg -v 2.0 ./vigil=/usr/bin/ ./vigil.cfg=/etc/ ./res=/etc/vigil/ ./vigil.service=/lib/systemd/system/vigil.service
Debian packaging tools generally labels all files in /etc as config files, as mandated by policy, so fpm defaults to this behavior for deb packages. You can disable this default behavior with --deb-no-default-config-files flag {:level=>:warn}
Created package {:path=>"vigil_2.0_amd64.deb"}
dpkg -i vigil_2.0_amd64.deb
效果
dpkg -i vigil_2.0_amd64.deb
(Reading database
Preparing to unpack vigil_2.0_amd64.deb
Unpacking vigil (2.0) over (2.0)
Setting up vigil (2.0)
Installing new version of config file /etc/vigil.cfg
systemctl start vigil
ldd /usr/bin/vigil
linux-vdso.so.1 (0x00007fff72106000)
libssl.so.10 => not found
libcrypto.so.10 => not found
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007ff86c28c000)
librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007ff86c084000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007ff86be67000)
libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007ff86bc50000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ff86b8b1000)
libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007ff86b5ad000)
/lib64/ld-linux-x86-64.so.2 (0x00007ff86cc68000)
说明:
这个是操作系统版本的依赖包的问题,解决方法可以通过重新下载openssl-1.0.1e
参考如下:
wget https://www.openssl.org/source/old/1.0.1/openssl-1.0.1e.tar.gz
./config shared zlib-dynamic
make
https://github.com/rongfengliang/myvigil-multiemail
https://fpm.readthedocs.io/en/latest/intro.html
原文:https://www.cnblogs.com/rongfengliang/p/11067094.html