環境
- CentOS 6.5
- neon 0.29.3-3.el6_4
$ yum list neon
Loaded plugins: fastestmirror
Loading mirror speeds from cached hostfile
* base: www.ftp.ne.jp
* extras: www.ftp.ne.jp
* updates: www.ftp.ne.jp
Installed Packages
neon.i686 0.29.3-3.el6_4 @base
手順
ソースrpmを取得する
rpmfindで探す(neonの場合)
yumdownloaderを使ってダウンロードしてもできるっぽい(参考)
# yum install yum-utils
# yumdownloader --source httpd
作業前の注意
システムを誤って壊さないように、rootではなく一般ユーザーで実行したほうがいいらしい。
ソースrpmを展開する
rpm
コマンドを使う(参考)
$ rpm -ivh neon-0.29.3-3.el6_4.src.rpm
ファイルの展開先はrpmbuild
コマンドで確認できる。
$ rpmbuild --showrc | grep topdir
-14: _builddir %{_topdir}/BUILD
-14: _buildrootdir %{_topdir}/BUILDROOT
-14: _rpmdir %{_topdir}/RPMS
-14: _sourcedir %{_topdir}/SOURCES
-14: _specdir %{_topdir}/SPECS
-14: _srcrpmdir %{_topdir}/SRPMS
-14: _topdir %{getenv:HOME}/rpmbuild
rpm2cpio
コマンドでもできる(参考)
$ rpm2cpio neon-0.29.3-3.el6_4.src.rpm | cpio -id
ただ、rpm2cpio
だと展開後ファイルを、RPMお決まりのディレクトリに自分で配置しないといけないので、rpmコマンドでやるほうがよさげ。
SPECファイルを変更する
$ diff -c neon.spec neon.spec.new
*** neon.spec 2013-08-26 21:36:18.000000000 +0900
--- neon.spec.new 2014-06-14 12:55:42.396682235 +0900
***************
*** 46,52 ****
%define cabundle %{_sysconfdir}/pki/tls/certs/ca-bundle.crt
%configure --with-expat --enable-shared --disable-static \
--enable-warnings --with-ca-bundle=%{cabundle} \
! --with-ssl=gnutls --enable-threadsafe-ssl=posix \
--with-libproxy
make %{?_smp_mflags}
--- 46,52 ----
%define cabundle %{_sysconfdir}/pki/tls/certs/ca-bundle.crt
%configure --with-expat --enable-shared --disable-static \
--enable-warnings --with-ca-bundle=%{cabundle} \
! --with-ssl=openssl --enable-threadsafe-ssl=posix \
--with-libproxy
make %{?_smp_mflags}
再ビルドする
rpmbuild
コマンドでビルドする。(参考)
$ rpmbuild -ba ~/rpmbuild/SPECS/neon.spec
いろいろ足りないって言われた場合は、yum
で入れる。