2012年1月23日月曜日

keepalived の rpm を作る (RHEL6版)

RHEL6 用に keepalived を作ります。

前回の RHEL5 版 では、最新版でありませんでしたが、今回は最新版がコンパイルできます。
残念ながら、KLab さんのパッチは入れられません。

$ mkdir -p ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS}
$ vi ~/.rpmmacros

<~/.rpmmacros>
1
2
3
4
5
6
7
8
%_topdir        /home/mockbuild/rpmbuild
%_sourcedir     %{_topdir}/SOURCES/%{name}
%_specdir       %{_topdir}/SPECS
%_builddir      %{_topdir}/BUILD
%_rpmdir        %{_topdir}/RPMS
%_srcrpmdir     %{_topdir}/SRPMS
%_query_all_fmt %%{name}-%%{version}-%%{release}.%%{arch}
%dist           .el6pcs

$ KEEPALIVED_VER=1.2.2

$ wget -O ~/rpmbuild/SOURCES/keepalived/keepalived-${KEEPALIVED_VER}.tar.gz \
> http://www.keepalived.org/software/keepalived-${KEEPALIVED_VER}.tar.gz

$ tar xzvf ~/rpmbuild/SOURCES/keepalived/keepalived-${KEEPALIVED_VER}.tar.gz \
> keepalived-${KEEPALIVED_VER}/keepalived.spec.in

$ mv keepalived-${KEEPALIVED_VER}/keepalived.spec.in .
$ rmdir keepalived-${KEEPALIVED_VER}


$ patch << 'EOF'
> --- keepalived.spec.in  2011-01-04 19:04:29.000000000 +0900
> +++ keepalived.spec     2012-01-23 12:36:22.840700123 +0900
> @@ -2,12 +2,12 @@
# Authority: dag
>
# Ugly, but we need headers from a kernel to rebuild against
> -%define kernel %(rpm -q kernel-devel --qf '%{RPMTAG_VERSION}-%{RPMTAG_RELEASE}\\n' 2>/dev/null | head -1)
> +%define kernel %(uname -r)
>
Summary: HA monitor built upon LVS, VRRP and services poller
Name: keepalived
Version: 1.2.2
> -Release: 5
> +Release: 6%{dist}
License: GPL
Group: Applications/System
URL: http://www.keepalived.org/
> EOF

$ mv keepalived.spec.in ~/rpmbuild/SPECS/keepalived.spec

$ rpmbuild -ba ~/rpmbuild/SPECS/keepalived.spec

0 件のコメント:

コメントを投稿