Compiling “heartheat-2.0.2-1.src.com” to create RPM for 64-bits Linux System.

NoteI would like to express my gratitude to one of  my best friend Pramod Kumar for his help towards compiling and creating signature heartbeat RPM for CentOS 5.5 OS.

1 – First download the heartbeat-2.0.2 (Production release) source RPM.

2 –Run the following command to prepare the source rpm from tar.gz

rpm -ivh  heartbeat-2.0.2-1.src.rpmar

 Note – you might face the following prerequisite install these

——————————————————————————————————————————–

error: Failed build dependencies:

glib-devel is needed by heartbeat-2.0.2-1.x86_64

libnet is needed by heartbeat-2.0.2-1.x86_64

——————————————————————————————————————————–

3-  Installing the prerequisite – there may be other way around to installing, I am following up with  Yum method.

yum install glib-devel libnet

Loading “downloadonly” plugin

Loading “installonlyn” plugin

Setting up Install Process

Setting up repositories

core                                                                 [1/2]

core                      100% |=========================| 1.1 kB    00:00

extras                                                               [2/2]

extras                    100% |=========================| 1.1 kB    00:00

Reading repository metadata in from local files

Parsing package install arguments

Resolving Dependencies

Populating transaction set with selected packages. Please wait.

—> Downloading header for libnet10 to pack into transaction set.

libnet10-1.0.2a-10.fc5.x8 100% |=========================| 5.6 kB    00:01

—> Package libnet10.x86_64 0:1.0.2a-10.fc5 set to be updated

—> Downloading header for glib-devel to pack into transaction set.

glib-devel-1.2.10-18.2.2. 100% |=========================| 7.3 kB    00:00

—> Package glib-devel.x86_64 1:1.2.10-18.2.2 set to be updated

Running transaction check

 

Dependencies Resolved

 

=============================================================================

Package                 Arch       Version          Repository        Size

=============================================================================

Installing:

glib-devel              x86_64     1:1.2.10-18.2.2  core               38 k

libnet10                x86_64     1.0.2a-10.fc5    extras             51 k

 

Transaction Summary

=============================================================================

Install      2 Package(s)

Update       0 Package(s)

Remove       0 Package(s)

Total download size: 89 k

Is this ok [y/N]: y

Downloading Packages:

(1/2): libnet10-1.0.2a-10 100% |=========================|  51 kB    00:01

(2/2): glib-devel-1.2.10- 100% |=========================|  38 kB    00:00

Running Transaction Test

Finished Transaction Test

Transaction Test Succeeded

Running Transaction

Installing: glib-devel                   ######################### [1/2]

Installing: libnet10                     ######################### [2/2]

 

Installed: glib-devel.x86_64 1:1.2.10-18.2.2 libnet10.x86_64 0:1.0.2a-10.fc5

Complete!

[root@centos5.5 SOURCES]#

———————————————————————————————————————————

4-  Installing source rpm again after prerqusite match

 

rpm -ivh  heartbeat-2.0.2-1.src.rpm

:heartbeat              ########################################### [100%]

[root@centos5.5 SRPMS]#

5-  Run the tree command show the following structure, where the SOURCE RPM will create compressed file inside the /usr/src/redhat/Source directory and SPEC file inside the SPECS like heartbeat.spec

[root@centos5.5 redhat]# tree

|– BUILD

|– RPMS

|   |– noarch

|   `– x86_64

|– SOURCES

 `– heartbeat-2.0.2.tar.gz

|– SPECS

|   `– heartbeat.spec

`– SRPMS

`– heartbeat-2.0.2-1.src.rpm

7 directories, 3 files

[root@centos5.5 redhat]#

6 – Modify the spec file as per your requirement. Like modify the version as

Release:        2.0.2.signature

7 – Uncompress /usr/src/redhat/SOURCE/heartbeat-2.0.2.tar.gz

cd /usr/src/redhat/SOURCES/heartbeat-2.0.2

 8  – Open configure file i.e vi configure

Replace the following for avoid Werror which interrupt warning as error and does not compile. Remove the Werror from the following string under configure file

 

if test “${enable_fatal_warnings}” = yes && cc_supports_flag -Werror ; then

echo “Enabling Fatal Warnings (-Werror) on this platform”

FATAL_WARNINGS=”-Werror”

fi

 

with

 

if test “${enable_fatal_warnings}” = yes && cc_supports_flag -Werror ; then

echo “Enabling Fatal Warnings (-Werror) on this platform”

FATAL_WARNINGS=””

fi

 

(ii) if test X”$CURSESLIBS” != X”” &&  cc_supports_flag -Wcast-qual

&& cc_supports_flag -Werror; then

echo “$as_me:$LINENO: checking whether printw() requires argument of “const char *”” >&5

echo $ECHO_N “checking whether printw() requires argument of “const char *”… $ECHO_C” >&6

ac_save_LIBS=$LIBS

LIBS=”$CURSESLIBS  $LIBS”

ac_save_CFLAGS=$CFLAGS

CFLAGS=”-Wcast-qual -Werror”

cat >conftest.$ac_ext <<_ACEOF

/* confdefs.h.  */

 

With

 

if test X”$CURSESLIBS” != X”” &&  cc_supports_flag -Wcast-qual

&& cc_supports_flag -Werror; then

echo “$as_me:$LINENO: checking whether printw() requires argument of “const char *”” >&5

echo $ECHO_N “checking whether printw() requires argument of “const char *”… $ECHO_C” >&6

ac_save_LIBS=$LIBS

LIBS=”$CURSESLIBS  $LIBS”

ac_save_CFLAGS=$CFLAGS

CFLAGS=”-Wcast-qual”

cat >conftest.$ac_ext <<_ACEOF

/* confdefs.h.  */

 

9 – Delete /usr/src/Redhat/Source/heartbeat-2.0.2.tar.gz  and compress the /usr/src/redhat/SOURCES/heartbeat-2.0.2

tar –cf  heartbeat-2.0.2.tar.gz  heartbeat-2.0.2

10 – run the following command to build the rpm

rpmbuild -bb SPECS/heartbeat.spec

It may complain with the following error ( Fix the prerequisite)

 Making all in libltdl

/bin/sh: line 0: cd: libltdl: No such file or directory

make: *** [all-recursive] Error 1

error: Bad exit status from /var/tmp/rpm-tmp.71649 (%build)

RPM build errors:

Bad exit status from /var/tmp/rpm-tmp.71649 (%build)

11- installing libltdl

[root@centos5.5 SOURCES]# yum install libtool-ltdl-devel libtool-ltdl

Loading “downloadonly” plugin

Loading “installonlyn” plugin

Setting up Install Process

Setting up repositories

core                                                                 [1/2]

extras                                                               [2/2]

Reading repository metadata in from local files

Parsing package install arguments

Resolving Dependencies

Populating transaction set with selected packages. Please wait.

—> Downloading header for libtool-ltdl to pack into transaction set.

libtool-ltdl-1.5.22-2.2.i 100% |=========================|  15 kB    00:00

—> Package libtool-ltdl.i386 0:1.5.22-2.2 set to be updated

—> Downloading header for libtool-ltdl-devel to pack into transaction set.

libtool-ltdl-devel-1.5.22 100% |=========================|  13 kB    00:00

—> Package libtool-ltdl-devel.x86_64 0:1.5.22-2.2 set to be updated

Running transaction check

 

Dependencies Resolved

 

=============================================================================

Package                 Arch       Version          Repository        Size

=============================================================================

Installing:

libtool-ltdl            i386       1.5.22-2.2       core               36 k

libtool-ltdl-devel      x86_64     1.5.22-2.2       core               31 k

 

Transaction Summary

=============================================================================

Install      2 Package(s)

Update       0 Package(s)

Remove       0 Package(s)

Total download size: 67 k

Is this ok [y/N]: y

Downloading Packages:

(1/2): libtool-ltdl-1.5.2 100% |=========================|  36 kB    00:01

(2/2): libtool-ltdl-devel 100% |=========================|  31 kB    00:00

Running Transaction Test

Finished Transaction Test

Transaction Test Succeeded

Running Transaction

Installing: libtool-ltdl                 ######################### [1/2]

Installing: libtool-ltdl-devel           ######################### [2/2]

 

Installed: libtool-ltdl.i386 0:1.5.22-2.2 libtool-ltdl-devel.x86_64 0:1.5.22-2.2

Complete!

[root@centos5.5 SOURCES]#

12 – run the rpmbuild command again to build the rpm.

[root@centos5.5 SOURCES]# rpmbuild -bb /usr/src/redhat/SPECS/heartbeat.spec

Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1

Requires: /bin/sh /usr/bin/python heartbeat-pils = 2.0.2-2.Signature libbz2.so.1()(64bit) libc.so.6()(64bit) libc.so.6(GLIBC_2.2.5)(64bit) libc.so.6(GLIBC_2.3)(64bit) libcurl.so.3()(64bit) libdl.so.2()(64bit) libglib-2.0.so.0()(64bit) libltdl.so.3()(64bit) libpils.so.1()(64bit) librt.so.1()(64bit) libssl.so.6()(64bit) libstonith.so.1()(64bit) libuuid.so.1()(64bit) libxml2.so.2()(64bit) libz.so.1()(64bit) telnet

Processing files: heartbeat-pils-2.0.2-2.Signature

Provides: generic.so()(64bit) libpils.so.1()(64bit)

Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1

Requires: libbz2.so.1()(64bit) libc.so.6()(64bit) libc.so.6(GLIBC_2.2.5)(64bit) libdl.so.2()(64bit) libglib-2.0.so.0()(64bit) libltdl.so.3()(64bit) librt.so.1()(64bit) libuuid.so.1()(64bit) libz.so.1()(64bit)

Processing files: heartbeat-debuginfo-2.0.2-2.Signature

Provides: apcmaster.so.debug()(64bit) apcsmart.so.debug()(64bit) baytech.so.debug()(64bit) bcast.so.debug()(64bit) bz2.so.debug()(64bit) crc.so.debug()(64bit) cyclades.so.debug()(64bit) drac3.so.debug()(64bit) external.so.debug()(64bit) generic.so.debug()(64bit) heartbeat.so.debug()(64bit) ibmhmc.so.debug()(64bit) libapphb.so.0.0.0.debug()(64bit) libccmclient.so.1.0.0.debug()(64bit) libcib.so.0.0.0.debug()(64bit) libclm.so.1.0.0.debug()(64bit) libcrmcommon.so.0.0.0.debug()(64bit) libhbclient.so.1.0.0.debug()(64bit) liblrm.so.0.0.0.debug()(64bit) libpengine.so.0.0.0.debug()(64bit) libpils.so.1.0.0.debug()(64bit) libplumb.so.1.0.0.debug()(64bit) libplumbgpl.so.1.0.0.debug()(64bit) librecoverymgr.so.1.0.0.debug()(64bit) libstonith.so.1.0.0.debug()(64bit) libstonithd.so.0.0.0.debug()(64bit) lsb.so.debug()(64bit) mcast.so.debug()(64bit) md5.so.debug()(64bit) meatware.so.debug()(64bit) null.so.debug()(64bit) nw_rpc100s.so.debug()(64bit) ocf.so.debug()(64bit) ping.so.debug()(64bit) ping_group.so.debug()(64bit) rcd_serial.so.debug()(64bit) recmgr.so.debug()(64bit) rps10.so.debug()(64bit) serial.so.debug()(64bit) sha1.so.debug()(64bit) ssh.so.debug()(64bit) stonith.so.debug()(64bit) suicide.so.debug()(64bit) test.so.debug()(64bit) ucast.so.debug()(64bit) wti_nps.so.debug()(64bit) zlib.so.debug()(64bit)

Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1

Checking for unpackaged file(s): /usr/lib/rpm/check-files /var/tmp/heartbeat-2.0.2-build

Wrote:/usr/src/redhat/RPMS/x86_64/heartbeat-2.0.2-2.Signature.x86_64.rpm

Wrote:/usr/src/redhat/RPMS/x86_64/heartbeat-ldirectord-2.0. 2.Signature.x86_64.rpm 

Wrote:/usr/src/redhat/RPMS/x86_64/heartbeat-stonith-2.0.2-2.Signature.x86_64.rpm

Wrote: /usr/src/redhat/RPMS/x86_64/heartbeat-pils-2.0.2-2.Signature.x86_64.rpm

Wrote:/usr/src/redhat/RPMS/x86_64/heartbeat-debuginfo-2.0.2-2.Signature.x86_64.rpm

Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.48338

+ umask 022

+ cd /usr/src/redhat/BUILD

+ cd heartbeat-2.0.2

+ ‘[‘ -n /var/tmp/heartbeat-2.0.2-build -a /var/tmp/heartbeat-2.0.2-build ‘!=’ / ‘]’

+ rm -rf /var/tmp/heartbeat-2.0.2-build

+ rm -rf /usr/src/redhat/BUILD/heartbeat-2.0.2

+ exit 0

[root@centos5.5 redhat]#

Note –  Heartbeat & LVS rpm are build.

[root@centos5.5 SOURCES]# ls -trl ../RPMS/x86_64/

total 19016

-rw-r–r– 1 root root   40943 Nov 18 18:58 heartbeat-ldirectord-2.0.2-2.Signature.x86_64.rpm

-rw-r–r– 1 root root 9053786 Nov 18 18:58 heartbeat-2.0.2-2.Signature.x86_64.rpm

-rw-r–r– 1 root root 1274315 Nov 18 18:58 heartbeat-stonith-2.0.2-2.Signature.x86_64.rpm

-rw-r–r– 1 root root  123031 Nov 18 18:58 heartbeat-pils-2.0.2-2.Signature.x86_64.rpm

-rw-r–r– 1 root root 8926329 Nov 18 18:58 heartbeat-debuginfo-2.0.2-2.Signature.x86_64.rpm

[root@centos5.5 SOURCES]#

 

Advertisements

One thought on “Compiling “heartheat-2.0.2-1.src.com” to create RPM for 64-bits Linux System.

  1. Keshab December 5, 2011 at 11:38 am Reply

    Awsome !!!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: