Google Site SearchFN Site Search FN Blog Login FN Blog Login
Site Navigation:
 
 

How to build thunderbird RPM for RH9 (Fedora Legacy)

by Bimal Pandit on Feb 02, 2005

This is my experience that i would like to share with all of you, in case it could help someone.

I tried to install thunderbird-1.0 on my system - Red Hat 9 (Fedora Legacy), i started with tar file but then it
was accessible to the root user only, even i tried making link as

[root@bimal root]# cd /usr/local
[root@bimal local]# tar -xvzf /tmp/thunderbird-1_0/thunderbird-1.0.tar.gz
[root@bimal local]# cd thunderbird
[root@bimal thunderbird]# ln -sf /usr/local/thunderbird/thunderbird/usr/bin/

now, i switched as normal user and tried to execute thunderbird

[root@bimal thunderbird]# su - bimal
[bimal@bimalserver bimal]$ thunderbird
Xlib: connection to ":0.0" refused by server
Xlib: No protocol specified
(thunderbird-bin:9100): Gtk-WARNING **: cannot open display:
[bimal@bimalserver bimal]$

i could have overcome this too, as

[root@bimal thunderbird]# xhost +localhost

but that's not the solution!!( i think..., you know this is 'X' and security!!), so again i tried to
search the net and came accross an excellent site(tutorial)
http://fedoranews.org/tchung/thunderbird/ by Mr.Thomas Chung,

i tried it as per his suggestions but since i did all these as a root user,
while here i have also given a solution as how to buid the same
package without root, of course to install rpm package you need to be the root user!

here is what and how i have done all this...

NOTE:-
1) all my packages are in /tmp directory so i am refering as of it.

2) packages used are
   thunderbird-1.0.tar.gz
   thunderbird.png
   thunderbird.desktop
   thunderbird.spec
one can had thunderbird.png, thunderbird.desktop, thunderbird.spec files from
http://fedoranews.org/tchung/thunderbird/ by Mr.Thomas Chung

3) build on RedHat 9

PART - I - AS A ROOT

here i have taken an example of creating this rpm package as superuser "root"
so you need to login as root, on a terminal do as...

[root@bimal temp]# vi thunderbird.spec  

and changed "Release : 0.FC1" to "Release : 0.rh9" so that you will get a package named as
"thunderbird-1.0-0.rh9.i386.rpm" instead of "thunderbird-1.0-0.FC1.i386.rpm"
well here i goes...
[root@bimal temp]# cp thunderbird-1.0.tar.gz /usr/src/redhat/SOURCES/

[root@bimal temp]# cp thunderbird.png /usr/src/redhat/SOURCES/

[root@bimal temp]# cp thunderbird.desktop /usr/src/redhat/SOURCES/

[root@bimal temp]# cp thunderbird.spec /usr/src/redhat/SPECS/

[root@bimal temp]# rpmbuild -ba /usr/src/redhat/SPECS/thunderbird.spec

Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.58027

+ umask 022

+ cd /usr/src/redhat/BUILD

+ LANG=C

+ export LANG

+ rm -rf /var/tmp/thunderbird-1.0-buildroot

+ cd /usr/src/redhat/BUILD

+ rm -rf thunderbird-1.0

+ /bin/mkdir -p thunderbird-1.0

+ cd thunderbird-1.0

+ /usr/bin/gzip -dc /usr/src/redhat/SOURCES/thunderbird-1.0.tar.gz

+ tar -xf -

..omitted.. Processing files: thunderbird-1.0-0.rh9

Checking for unpackaged file(s): /usr/lib/rpm/check-files /var/tmp/thunderbird-1.0-buildroot

Wrote: /usr/src/redhat/SRPMS/thunderbird-1.0-0.rh9.src.rpm

Wrote: /usr/src/redhat/RPMS/i386/thunderbird-1.0-0.rh9.i386.rpm

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

+ umask 022

+ cd /usr/src/redhat/BUILD

+ cd thunderbird-1.0

+ rm -rf /var/tmp/thunderbird-1.0-buildroot

+ exit 0

[root@bimal temp]#
so this will create a rpm package in /usr/src/redhat/RPMS/i386/ directory while src.rpm in
/usr/src/redhat/SRPMS/ directory.

PART - II - AS A GENERAL USER
here i have taken an example of creating this rpm package as a general user "bimal"
so you need to login as your own user account, on a terminal do as...

[bimal@bimal bimal]$ mkdir rpm

[bimal@bimal bimal]$ cd rpm

[bimal@bimal bimal]$ mkdir SOURCES SPECS BUILD RPMS RPMS/i386 SRPMS

create a file ".rpmmacros" in the home directory with the entry as shown

[bimal@bimal bimal]$ vi .rpmmacros

%_topdir /home/bimal/rpm

[bimal@bimal bimal]$ cd /tmp

[bimal@bimal temp]$ vi thunderbird.spec

and changed "Release : 0.FC1" to "Release : 0.rh9"

[bimal@bimal temp]$ cp thunderbird.spec /home/bimal/rpm/SPECS/

[bimal@bimal temp]$ cp thunderbird.desktop /home/bimal/rpm/SOURCES/

[bimal@bimal temp]$ cp thunderbird.png /home/bimal/rpm/SOURCES/

[bimal@bimal temp]$ cp thunderbird-1.0.tar.gz /home/bimal/rpm/SOURCES/

[bimal@bimal temp]$ rpmbuild -ba /home/bimal/rpm/SPECS/thunderbird.spec

Executing(%prep): /bin/sh -e /var/tmp/rpm-tmp.62736

+ umask 022

+ cd /home/bimal/rpm/BUILD

+ LANG=C

+ export LANG

+ rm -rf /var/tmp/thunderbird-1.0-buildroot

+ cd /home/bimal/rpm/BUILD

+ rm -rf thunderbird-1.0

+ /bin/mkdir -p thunderbird-1.0

+ cd thunderbird-1.0

+ /usr/bin/gzip -dc /home/bimal/rpm/SOURCES/thunderbird-1.0.tar.gz

+ tar -xf -

..omitted.. Processing files: thunderbird-1.0-0.rh9

Checking for unpackaged file(s): /usr/lib/rpm/check-files /var/tmp/thunderbird-1.0-buildroot

Wrote: /home/bimal/rpm/SRPMS/thunderbird-1.0-0.rh9.src.rpm

Wrote: /home/bimal/rpm/RPMS/i386/thunderbird-1.0-0.rh9.i386.rpm

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

+ umask 022

+ cd /home/bimal/rpm/BUILD

+ cd thunderbird-1.0

+ rm -rf /var/tmp/thunderbird-1.0-buildroot

+ exit 0

[bimal@bimal temp]$

so this will create a rpm package in /home/bimal/rpm/RPMS/i386/ directory while
src.rpm in /home/bimal/rpm/SRPMS/ directory.

now to install this rpm package do as(needs root access)

[root@bimal temp]# rpm -ivh /usr/src/redhat/RPMS/i386/thunderbird-1.0-0.rh9.i386.rpm  

OR

[root@bimal temp]# rpm -ivh /home/bimal/rpm/RPMS/i386/thunderbird-1.0-0.rh9.i386.rpm

now this package(thunderbird-1.0) is available to all i mean to any common/general user!!
To check this out, login as normal user(gui mode), click on
redhat(main/start icon) --> Internet --> Mozilla Thunderbird Mail Client

in the last, many many thanks to FedoraNEWS.ORG team especially to Mr.Thomas Chung
and please dont forget to visit this site http://fedoranews.org/tchung/thunderbird/
it has got a lot of important/useful tutorials for duffers like me.

So... Got it, OK, enjoy!!!

Bimal Pandit