動かざることバグの如し

近づきたいよ 君の理想に

Ubuntuでsquid3をビルドしてインストール

今回初めてdebuildコマンドつかった

UbuntuてかDebian環境ってこんなに整っていたんですね(今更

環境

依存ライブラリのインストール

そもそものビルドに必要なものをインストール

apt install devscripts build-essential fakeroot debhelper dh-autoreconf cdbs

squidのビルドに必要な依存ライブラリのインストール

apt-get install build-dep squid3

ソースのダウンロード

任意の場所で以下を実行 するとカレントディレクトリに「squid3-3.5.xx」のディレクトリの中にsquidのソースがダウンロードされる

apt-get source squid3

で今回はSSL対応にしたい(ssl_bump機能を使いたい)のでオプションを変更する。

debian/rulesのファイルにて「DEB_CONFIGURE_EXTRA_FLAGS」を探して以下を追加

--with-openssl \
--enable-ssl \
--enable-ssl-crtd \

あとはconfigureしてmake 結構時間かかる

./configure
debuild -us -uc -j`nproc`

が、エラー

CRYPTO_LOCK_X509’ was not declared in this scope

どうもSquid 3.5はOpenSSL v1.1に対応していないのが原因

Squid - Users - Build errors with Squid 3.5.24 under Debian

apt remove libssl1.0-dev
apt install libssl1.0-dev

インストール

あとはソースディレクトリ( squid3-3.5.23)の上にdebファイルが沢山生成されているのでまとめてインストールすればおk

dpkg -i squid*armhf.deb

確認

# squid -v |grep ssl
configure options:  '--build=arm-linux-gnueabihf' '--prefix=/usr' '--includedir=${prefix}/include' '--mandir=${prefix}/share/man' '--infodir=${prefix}/share/info' '--sysconfdir=/etc' '--localstatedir=/var' '--libexecdir=${prefix}/lib/squid3' '--srcdir=.' '--disable-maintainer-mode' '--disable-dependency-tracking' '--disable-silent-rules' 'BUILDCXXFLAGS=-g -O2 -fdebug-prefix-map=/root/squid3-3.5.23=. -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -Wl,-z,relro -Wl,-z,now -Wl,--as-needed' '--datadir=/usr/share/squid' '--sysconfdir=/etc/squid' '--libexecdir=/usr/lib/squid' '--mandir=/usr/share/man' '--enable-inline' '--disable-arch-native' '--enable-async-io=8' '--enable-storeio=ufs,aufs,diskd,rock' '--enable-removal-policies=lru,heap' '--enable-delay-pools' '--enable-cache-digests' '--enable-icap-client' '--enable-follow-x-forwarded-for' '--enable-auth-basic=DB,fake,getpwnam,LDAP,NCSA,NIS,PAM,POP3,RADIUS,SASL,SMB' '--enable-auth-digest=file,LDAP' '--enable-auth-negotiate=kerberos,wrapper' '--enable-auth-ntlm=fake,smb_lm' '--enable-external-acl-helpers=file_userip,kerberos_ldap_group,LDAP_group,session,SQL_session,time_quota,unix_group,wbinfo_group' '--enable-url-rewrite-helpers=fake' '--enable-eui' '--enable-esi' '--enable-icmp' '--enable-zph-qos' '--enable-ecap' '--disable-translation' '--with-swapdir=/var/spool/squid' '--with-logdir=/var/log/squid' '--with-pidfile=/var/run/squid.pid' '--with-filedescriptors=65536' '--with-large-files' '--with-default-user=proxy' '--with-openssl' '--enable-ssl' '--enable-ssl-crtd' '--enable-build-info=Debian linux' '--enable-linux-netfilter' 'build_alias=arm-linux-gnueabihf' 'CFLAGS=-g -O2 -fdebug-prefix-map=/root/squid3-3.5.23=. -fstack-protector-strong -Wformat -Werror=format-security -Wall' 'LDFLAGS=-Wl,-z,relro -Wl,-z,now -Wl,--as-needed' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' 'CXXFLAGS=-g -O2 -fdebug-prefix-map=/root/squid3-3.5.23=. -fstack-protector-strong -Wformat -Werror=format-security'

参考リンク