Skip to content

use fpm make tengine.deb

楷子狐 edited this page Jul 23, 2015 · 3 revisions

一、 安装fpm

apt-get -y install make ruby ruby-dev gcc # yum -y install make ruby ruby-devel gcc
gem source -r https://rubygems.org/ # 放弃官方源,网络原因你懂的
gem source -a http://mirrors.aliyun.com/rubygems/ # 改用国内阿里云源
gem install fpm

二、 初始化编译环境(笔者环境为 debian 8.1 amd64)

apt-get -y install libpcre3-dev libssl-dev libxml2-dev libxslt1-dev libgd-dev libgeoip-dev libluajit-5.1-dev libjemalloc-dev
mkdir -pv ~/deb-{root,file}
wget -O ~/deb-file/tengine-2.1.0.tar.gz http://tengine.taobao.org/download/tengine-2.1.0.tar.gz
tar -C ~/deb-file -zxvf ~/deb-file/tengine-2.1.0.tar.gz

三、 轻松打包 tengine

cd ~/deb-file/tengine-2.1.0

./configure --user=www-data \
--group=www-data \
--with-pcre-jit \
--prefix=/usr/share/tengine \
--sbin-path=/usr/sbin/tengine \
--dso-tool-path=/usr/sbin/dso_tool \
--dso-path=/usr/lib64/tengine/modules \
--conf-path=/etc/tengine/tengine.conf \
--http-log-path=/var/log/tengine/access.log \
--error-log-path=/var/log/tengine/error.log \
--lock-path=/var/lock/tengine.lock \
--pid-path=/run/tengine.pid \
--http-client-body-temp-path=/var/lib/tengine/body \
--http-fastcgi-temp-path=/var/lib/tengine/fastcgi \
--http-proxy-temp-path=/var/lib/tengine/proxy \
--http-scgi-temp-path=/var/lib/tengine/scgi \
--http-uwsgi-temp-path=/var/lib/tengine/uwsgi \
--with-syslog \
--with-jemalloc \
--with-mail \
--with-mail_ssl_module \
--with-http_ssl_module \
--with-http_auth_request_module \
--with-http_dav_module \
--with-http_gzip_static_module \
--with-http_image_filter_module \
--with-http_spdy_module \
--with-http_stub_status_module \
--with-http_realip_module \
--with-http_addition_module=shared \
--with-http_xslt_module=shared \
--with-http_image_filter_module=shared \
--with-http_geoip_module=shared \
--with-http_sub_module=shared \
--with-http_flv_module=shared \
--with-http_slice_module=shared \
--with-http_mp4_module=shared \
--with-http_concat_module=shared \
--with-http_random_index_module=shared \
--with-http_secure_link_module=shared \
--with-http_sysguard_module=shared \
--with-http_userid_filter_module=shared \
--with-http_footer_filter_module=shared \
--with-http_trim_filter_module=shared \
--with-http_autoindex_module=shared \
--with-http_map_module=shared \
--with-http_split_clients_module=shared \
--with-http_referer_module=shared \
--with-http_uwsgi_module=shared \
--with-http_scgi_module=shared \
--with-http_memcached_module=shared \
--with-http_limit_conn_module=shared \
--with-http_limit_req_module=shared \
--with-http_empty_gif_module=shared \
--with-http_browser_module=shared \
--with-http_user_agent_module=shared \
--with-http_upstream_ip_hash_module=shared \
--with-http_upstream_least_conn_module=shared \
--with-http_upstream_session_sticky_module=shared \
--with-http_reqstat_module=shared \
--with-http_lua_module=shared \
--with-luajit-inc=/usr/include/luajit-2.0 \
--with-luajit-lib=/usr/lib/x86_64-linux-gnu \
--with-ld-opt=-Wl,-z,relro \
--with-cc-opt='-g -O2 -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2' 

make -j24
make install DESTDIR=~/deb-root/tengine-2.1.0

dpkg -X tengine-common_1.0.0-1_amd64.deb ~/deb-root/tengine-2.1.0/

fpm -f -s dir -t deb -n tengine --epoch 2 -v 2.1.0 --iteration 3 -C ~/deb-root/tengine-2.1.0 -p ~/deb-file \
-d 'libc6 >= 2.14' -d 'libexpat1 >= 2.0.1' -d 'libgd3 >= 2.1.0~alpha~' -d 'libgeoip1' \
-d 'libpam0g >= 0.99.7.1' -d 'libpcre3 >= 8.35' -d 'libssl1.0.0 >= 1.0.1' -d 'libxml2 >= 2.7.4' \
-d 'libxslt1.1 >= 1.1.25' -d 'zlib1g >= 1:1.2.0' \
--verbose --category 'Service/HTTP(s)Server' --description 'Tengine Web Server' --url 'tengine.taobao.org' --license 'BSD' -m 'higkoo' usr/sbin/dso_tool usr/sbin/tengine usr/share/tengine usr/lib64/tengine var/log/tengine etc/tengine
Clone this wiki locally