ビルド用パッケージのインストール
sudo apt-get build-dep nginx
sudo apt-get install devscripts fakeroot
sudo apt-get install ruby ruby-dev rake libcurl4-openssl-dev libev-dev
ビルド用ディレクトリ作成してcd.
mkdir ~/build
cd ~/build
nginx 1.4.3-2 Debianソースパッケージと、passenger 4.0.23 tarball を取得
apt-get source nginx
curl -LO http://s3.amazonaws.com/phusion-passenger/releases/passenger-4.0.23.tar.gz
cd nginx-1.4.3/
nginx-1.4.3/debian/modules へ移動して、passengerのtarballを展開
(cd debian/modules && tar xf ~/build/passenger-4.0.23.tar.gz)
passenger から不要なファイルを削除
(cd debian/modules/passenger-4.0.23 && rm -rf doc/images test rpm)
いろいろファイルを修正
vi debian/rules debian/control debian/modules/README.Modules-versions
差分:
diff -u -r debian.1.4.3-2/control debian/control
--- debian.1.4.3-2/control 2013-10-12 01:33:19.000000000 +0900
+++ debian/control 2013-11-02 01:56:49.000000000 +0900
@@ -23,7 +23,10 @@
libssl-dev,
libxslt1-dev,
po-debconf,
- zlib1g-dev
+ zlib1g-dev,
+ libev-dev (>= 1:4.0.0),
+ ruby, ruby-dev, rake,
+ libcurl4-openssl-dev
Standards-Version: 3.9.4
Homepage: http://nginx.net
Vcs-Git: git://anonscm.debian.org/collab-maint/nginx.git
diff -u -r debian.1.4.3-2/modules/README.Modules-versions debian/modules/README.Modules-versions
--- debian.1.4.3-2/modules/README.Modules-versions 2013-10-10 20:35:09.000000000 +0900
+++ debian/modules/README.Modules-versions 2013-11-02 01:52:53.000000000 +0900
@@ -64,3 +64,9 @@
ngx_http_substitutions_filter_module
Homepage: https://github.com/yaoweibin/ngx_http_substitutions_filter_module
Version: 0573ab3b59
+
+ passenger
+ Homepage: https://www.phusionpassenger.com/
+ rm -rf doc/images test rpm
+ Version: 4.0.23
+
--- debian.1.4.3-2/rules 2013-10-16 17:44:22.000000000 +0900
+++ debian/rules 2013-11-02 02:16:41.000000000 +0900
@@ -3,7 +3,7 @@
CFLAGS = `dpkg-buildflags --get CFLAGS`
CFLAGS += -Wall -DFORTIFY_SOURCE=2 -fstack-protector
CFLAGS += `dpkg-buildflags --get CPPFLAGS`
-LDFLAGS = `dpkg-buildflags --get LDFLAGS`
+LDFLAGS = $(dpkg-buildflags --get LDFLAGS)
# export necessary for (hardening) flags for perl
# (src/http/modules/perl/Makefile.PL).
export CFLAGS LDFLAGS
@@ -74,6 +74,7 @@
--add-module=$(MODULESDIR)/nginx-echo \
--add-module=$(MODULESDIR)/nginx-upstream-fair \
--add-module=$(MODULESDIR)/ngx_http_substitutions_filter_module \
+ --add-module=$(MODULESDIR)/passenger-4.0.23/ext/nginx \
$(CONFIGURE_OPTS) >$@
touch $@
@@ -154,6 +155,7 @@
--add-module=$(MODULESDIR)/nginx-upload-progress \
--add-module=$(MODULESDIR)/nginx-upstream-fair \
--add-module=$(MODULESDIR)/ngx_http_substitutions_filter_module \
+ --add-module=$(MODULESDIR)/passenger-4.0.23/ext/nginx \
$(CONFIGURE_OPTS) >$@
touch $@
changelog 追記(-l custom は、パッケージのバージョンを 1.4.3-2custom1 のようにしてくれる便利なオプション)
export DEBEMAIL=tyamada@minimum2scp.org
export DEBFULLNAME="YAMADA Tsuyoshi"
debchange -l custom -D unstable -- "add module passenger-4.0.23 (for nginx-full, nginx-extras)"
ビルド (-sa は、.changes ファイルに強制的にオリジナルのソースを含めるオプション。repreproにソースつきでアップロードしたいのでつけている。dpkg-genchanges(1) 参照/並列コンパイルは -j3 では失敗するが、DEB_BUILD_OPTIONS="parallel=3" だと成功する。謎。)
export DEB_BUILD_OPTIONS="parallel=3"
debuild -rfakeroot -sa
再ビルドの場合は:
fakeroot debian/rules clean
(cd debian/modules/passenger-4.0.23; rake clean)
debuild -rfakeroot -sa
repreproへアップロード:
sudo apt-get install openssh-client dupload
cat > ~/.dupload.conf
package config;
$cfg{'heartbreakone'} = {
fqdn => "minimum2scp.org",
method => "scpb",
incoming => "/var/www/repos/apt/debian/incoming",
# files pass on to dinstall on ftp-master which sends emails itself
dinstall_runs => 1,
};
1;
EOF
dupload --no --to heartbreakone nginx_1.4.3-2custom1_amd64.changes