如何构建ruby.deb包



我一直在谷歌上搜索,在stackoverflow上发现了另一个问题,但没有答案,有些人说他们在checkinstall方面取得了成功。我关注这个:

sudo apt-get install uuid-dev libsystemd-dev libssl-dev checkinstall
sudo apt-get install libjemalloc1 libjemalloc-dev
wget http://ftp.ruby-lang.org/pub/ruby/2.7/ruby-2.7.0.tar.gz
tar -xzvf ruby-2.7.0.tar.gz
cd ruby-2.7.0/
./configure --with-jemalloc
make
sudo checkinstall --default --backup=no --deldoc=yes --install=yes --pkgname=ruby --pkgversion='2.7.0'

但它被卡住了:

# sudo checkinstall -D --default --fstrans=no --backup=no --deldoc=yes --install=no  --pkgname=ruby --pkgversion='2.7.0'
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
*****************************************
**** Debian package creation selected ***
*****************************************
This package will be built according to these values:
0 -  Maintainer: [ root@hdd-rig ]
1 -  Summary: [ Package created with checkinstall 1.6.2 ]
2 -  Name:    [ ruby ]
3 -  Version: [ 2.7.0 ]
4 -  Release: [ 1 ]
5 -  License: [ GPL ]
6 -  Group:   [ checkinstall ]
7 -  Architecture: [ amd64 ]
8 -  Source location: [ ruby-2.7.0 ]
9 -  Alternate source location: [  ]
10 - Requires: [  ]
11 - Provides: [ ruby ]
12 - Conflicts: [  ]
13 - Replaces: [  ]
Enter a number to change any of them or press ENTER to continue:
Installing with make install...
========================= Installation results ===========================
BASERUBY = /usr/bin/ruby --disable=gems
CC = gcc
LD = ld
LDSHARED = gcc -shared
CFLAGS = -O3 -ggdb3 -Wall -Wextra -Wdeprecated-declarations -Wduplicated-cond -Wimplicit-function-declaration -Wimplicit-int -Wmisleading-indentation -Wpointer-arith -Wwrite-strings -Wimplicit-fallthrough=0 -Wmissing-noreturn -Wno-cast-function-type -Wno-constant-logical-operand -Wno-long-long -Wno-missing-field-initializers -Wno-overlength-strings -Wno-packed-bitfield-compat -Wno-parentheses-equality -Wno-self-assign -Wno-tautological-compare -Wno-unused-parameter -Wno-unused-value -Wsuggest-attribute=format -Wsuggest-attribute=noreturn -Wunused-variable -std=gnu99
XCFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector-strong -fno-strict-overflow -fvisibility=hidden -fexcess-precision=standard -DRUBY_EXPORT -fPIE -DCANONICALIZATION_FOR_MATHN -I. -I.ext/include/x86_64-linux -I./include -I. -I./enc/unicode/12.1.0
CPPFLAGS =
DLDFLAGS = -Wl,--compress-debug-sections=zlib -fstack-protector-strong -pie
SOLIBS = -lz -lpthread -lrt -lrt -ljemalloc -lgmp -ldl -lcrypt -lm
LANG = en_US.UTF-8
LC_ALL =
LC_CTYPE =
MFLAGS =
gcc (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
Copyright (C) 2017 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
./revision.h unchanged
generating enc.mk

它已经挂在那里好几个小时了。有人有关于如何使用构建ruby 2.9.0的.deb包的说明吗/用jemalloc配置?

我不能使用rbenv或类似的东西,因为我需要将这个二进制包部署到数千个系统中,并且在每个系统上编译都非常慢。

我无法让checkinstall正常工作,但我最终还是编译成了这样:

sudo apt-get update; sudo apt-get -y dist-upgrade
sudo apt-get -y install uuid-dev libsystemd-dev libssl-dev libreadline-dev libyaml-dev libedit-dev checkinstall build-essential libjemalloc-dev
wget https://cache.ruby-lang.org/pub/ruby/3.2/ruby-3.2.1.tar.gz
tar -xzvf ruby-3.2.1.tar.gz
cd ruby-3.2.1
./configure --disable-install-rdoc --enable-yjit
make -j4
mkdir -p ~/ruby-3.2.1-installer/DEBIAN/
make install DESTDIR=~/ruby-3.2.1-installer
du -s ~/ruby-3.2.1-installer # To put in Installed-Size
vim ~/ruby-3.2.1-installer/DEBIAN/control
## FOR AMD64 - Ubuntu 20.04
# Package: ruby3.2.1
# Version: 3.2.1
# Section: custom
# Priority: optional
# Architecture: amd64
# Maintainer: tetherx
# Installed-Size: 211756
# Depends: libc6 (>= 2.31), libffi7 (>= 3.3), libgdbm6 (>= 1.18.1), libreadline8 (>= 8.0), libssl1.1 (>= 1.1.1), libyaml-0-2, zlib1g (>= 1:1.2.11)
# Description: ruby language interpreter
cd ~
dpkg-deb --build ruby-3.2.1-installer
sudo dpkg -i ruby-3.2.1-installer.deb

最新更新