gccgo Debian Package

Friday, November 27, 2009

gccgo Debian Package

Google Go
Download gccgo debian binary from here... gccgo_4.5.0-1_i386.deb or from sourceforge... file size: 27MB...

As building gccgo was a success, I am going to try making a debian package for gccgo...

One method is using checkinstall after make... but I am gonna take the standard method... as described here...

Ok, lets start...

Installing necessary & recommended packages...

$ sudo apt-get -y install dpkg-dev file libc6-dev make patch perl autoconf automake dh-make debhelper gnupg fort77 gpc xutils lintian pbuilder gcc g++ devscripts fakeroot debian-policy developers-reference

...done

On second thought, I will go through MOTU... Masters Of The Universe... people who maintains the Universe section of Ubuntu... I am not sure what is in store, will tell you on the way :)

I am using this video on youtube...

Adding my name and email address into .bashrc...

$ echo -e '\nexport DEBFULLNAME="ATOzTOA"\nexport DEBEMAIL="webmaster@atoztoa.com"' >> ~/.bashrc
$ . ~/.bashrc

...done

Setting up gpg (GNU Privacy Guard)... for user identification...

$ gpg --gen-key

Staying with the defaults... when it asked for verification, I said "y"... entering real name... email... no comments... "Okay"... choosing passphrase... repeating passphrase... the randomizer needs system events for generating entropy... we will do something else in the meanwhile...

Setting up pbuilder... creating file .pbuilderrc ...

$ echo 'COMPONENTS="main restricted universe multiverse"' > ~/.pbuilderrc

Creating initial environment...

$ sudo pbuilder create

...will take some time...

By that time, gpg is complete...

Now... let's get to business...

After spending sometime with the video, I think the debian tutorial will be a better starting point... but, that doesn't talk about adding name/email and setting up GPG keys... so the MOTU video was in fact the starting point...

Cleaning up gccgo...

$ cd ../gccgo
$ make clean
$ make distclean

Renaming gccgo to gccg-4.5.0...

$ mv gccgo gccgo-4.5.0

Making a tar.gz file

$ tar cfvz gccgo-4.5.0.tar.gz --exclude=.svn gccgo-4.5.0

Running dh_make... it is an utility for debianizing... (run only once!!!)

$ dh_make -f ../gccgo-4.5.0.tar.gz -s -c gpl

...verified the settings ...done

A new directory named debian is created and a set of files are created there...

Let's check out the control file...

Need to find out the build dependencies...

strace -f -o /tmp/log ./configure
# or make instead of ./configure, if the package doesn't use autoconf
for x in `dpkg -S $(grep open /tmp/log|\
perl -pe 's!.* open\(\"([^\"]*).*!$1!' |\
grep "^/"| sort | uniq|\
grep -v "^\(/tmp\|/dev\|/proc\)" ) 2>/dev/null|\
cut -f1 -d":"| sort | uniq`; \
do \
echo -n "$x (>=" `dpkg -s $x|grep ^Version|cut -f2 -d":"` "), "; \
done

...this will print out the packages needed for building...

the finished control file...

Source: gccgo
Section: devel
Priority: optional
Maintainer: ATOzTOA
Build-Depends: debhelper (>= 7), autotools-dev, flex, texinfo, binutils (>= 2.20-0ubuntu2 ), coreutils (>= 7.4-2ubuntu1 ), libacl1 (>= 2.2.47-2 ), libattr1 (>= 1 ), libc6 (>= 2.10.1-0ubuntu15 ), libc6-dev (>= 2.10.1-0ubuntu15 ), libc6-i686 (>= 2.10.1-0ubuntu15 ), libgmp3c2 (>= 2 ), libgmp3-dev (>= 2 ), libmpfr1ldbl (>= 2.4.1-1ubuntu1 ), libmpfr-dev (>= 2.4.1-1ubuntu1 ), libncurses5 (>= 5.7+20090803-2ubuntu2 ), libselinux1 (>= 2.0.85-2ubuntu2 ), linux-libc-dev (>= 2.6.31-14.48 ), locales (>= 2.9+git20090617-3 ), mime-support (>= 3.46-1ubuntu1 ), zlib1g (>= 1 )
Standards-Version: 3.8.1
Homepage: http://golang.org

Package: gccgo
Architecture: any
Depends: ${shlibs:Depends}, ${misc:Depends}
Description: A Google Go frontend for gcc
A compiler for the Go language. The gccgo compiler is a new frontend for gcc, the widely used GNU compiler. Although the frontend itself is under a BSD-style license, gccgo is normally used as part of gcc and is then covered by the GNU General Public License.
.
Note that gccgo is not the 6g compiler; see the Installing Go instructions for that compiler.

Updated copyright file...

Updated files:

$ vim changelog
$ vim rules

Added "--enable-languages=c,c++,go --with-arch=i686" to configure section in rules...

Removed files:

$ rm README.Debian
$ rm cron.d.ex
$ rm dirs
$ rm docs
$ rm gccgo.doc-base.EX
$ rm emacsen-*.ex
$ rm init.d.ex
$ rm init.d.lsb.ex
$ rm gccgo.default.ex
$ rm manpage.*
$ rm menu.ex
$ rm watch.ex
$ rm -v pre* post*

No scheduling... no special directories... no additional documentation... no daemon... no man pages... no menu items... not watching original source... no maintainer scripts...

Ready to rebuild everything...

$ dpkg-buildpackage -rfakeroot

...now time to wait... :)

Showed some error!!! I did a mistake while manually updating a source file... need to try again...

Tried next night... as it takes more than seven hours to complete... so I will be sleeping while it runs... it showed error... no disk space :)

Need to try again...

Tried again... asked for the passphrase for my GPG key, twice... success...

Got these files as output...

gccgo_4.5.0-1.diff.gz
gccgo_4.5.0-1.dsc
gccgo_4.5.0-1_i386.changes
gccgo_4.5.0-1_i386.deb
gccgo_4.5.0.orig.tar.gz

Now it is complete... the gccgo_4.5.0-1_i386.deb file is what I need... I tried double clicking on gccgo_4.5.0-1_i386.deb... Package Installer came up... I clicked "Install Package"...

(Reading database ... 171010 files and directories currently installed.)
Unpacking gccgo (from gccgo_4.5.0-1_i386.deb) ...
dpkg: error processing gccgo_4.5.0-1_i386.deb (--install):
trying to overwrite '/usr/share/man/man1/cpp.1.gz', which is also in package cpp 4:4.4.1-1ubuntu2
dpkg-deb: subprocess paste killed by signal (Broken pipe)
Processing triggers for install-info ...
install-info: warning: no info dir entry in `/usr/share/info/menu.info.gz'
Processing triggers for man-db ...
Errors were encountered while processing:
gccgo_4.5.0-1_i386.deb

Trying to force overwrite...

$ sudo dpkg --force-overwrite -i gccgo_4.5.0-1_i386.deb
(Reading database ... 171010 files and directories currently installed.)
Unpacking gccgo (from gccgo_4.5.0-1_i386.deb) ...
dpkg: warning: overriding problem because --force enabled:
trying to overwrite '/usr/share/man/man1/cpp.1.gz', which is also in package cpp 4:4.4.1-1ubuntu2
dpkg: warning: overriding problem because --force enabled:
trying to overwrite '/usr/share/man/man1/gcc.1.gz', which is also in package gcc 4:4.4.1-1ubuntu2
dpkg: warning: overriding problem because --force enabled:
trying to overwrite '/usr/share/man/man1/g++.1.gz', which is also in package g++ 4:4.4.1-1ubuntu2
dpkg: warning: overriding problem because --force enabled:
trying to overwrite '/usr/share/man/man1/gcov.1.gz', which is also in package gcc 4:4.4.1-1ubuntu2
dpkg: warning: overriding problem because --force enabled:
trying to overwrite '/usr/bin/gcc', which is also in package gcc 4:4.4.1-1ubuntu2
dpkg: warning: overriding problem because --force enabled:
trying to overwrite '/usr/bin/g++', which is also in package g++ 4:4.4.1-1ubuntu2
dpkg: warning: overriding problem because --force enabled:
trying to overwrite '/usr/bin/i486-linux-gnu-g++', which is also in package g++ 4:4.4.1-1ubuntu2
dpkg: warning: overriding problem because --force enabled:
trying to overwrite '/usr/bin/cpp', which is also in package cpp 4:4.4.1-1ubuntu2
dpkg: warning: overriding problem because --force enabled:
trying to overwrite '/usr/bin/gcov', which is also in package gcc 4:4.4.1-1ubuntu2
dpkg: warning: overriding problem because --force enabled:
trying to overwrite '/usr/bin/i486-linux-gnu-gcc', which is also in package gcc 4:4.4.1-1ubuntu2
dpkg: warning: overriding problem because --force enabled:
trying to overwrite '/usr/lib/libgomp.so.1.0.0', which is also in package libgomp1 0:4.4.1-4ubuntu8
dpkg: warning: overriding problem because --force enabled:
trying to overwrite '/usr/lib/libgomp.so.1', which is also in package libgomp1 0:4.4.1-4ubuntu8
dpkg: warning: overriding problem because --force enabled:
trying to overwrite '/usr/lib/libstdc++.so.6', which is also in package libstdc++6 0:4.4.1-4ubuntu8
Setting up gccgo (4.5.0-1) ...
Processing triggers for install-info ...
install-info: warning: no info dir entry in `/usr/share/info/menu.info.gz'
Processing triggers for man-db ...

...success!!!

The issue: gccgo is getting installed to the same location as gcc, so it needs to overwrite the existing gcc files... I will have to modify the configuration... later...

$ gccgo hello.go
$ ./a.out
Hello, world; or Καλημέρα κόσμε; or こんにちは 世界

Trying remove...

$ sudo dpkg -r gccgo
(Reading database ... 172072 files and directories currently installed.)
Removing gccgo ...
Processing triggers for man-db ...
Processing triggers for install-info ...
install-info: warning: no info dir entry in `/usr/share/info/menu.info.gz'

...sucess!!!

Trying install again... success!!!

Trying purge...

$ sudo dpkg -P gccgo
(Reading database ... 172072 files and directories currently installed.)
Removing gccgo ...
Processing triggers for man-db ...
Processing triggers for install-info ...
install-info: warning: no info dir entry in `/usr/share/info/menu.info.gz'

Trying install again... success!!!

Now, I need to try installing on a fresh installation... lets go to the Live CD...

Oops... Kubuntu 9.10 Live CD is not botting in my machine, maybe lack of resources...

Booted Ubuntu 9.10... installed the debian package...

No dependencies... it got installed like a breeze... working fine too... :)

So, the gccgo debian package, gccgo_4.5.0-1_i386.deb, is ready to be released...

I have uploaded the file... please try it out and comment...

Download from here... gccgo_4.5.0-1_i386.deb or from sourceforge... file size: 27MB...

See also... » gccgo mini-HOWTO

» gccgo - another Google Go compiler - Part 1

» Google Go - A First Look

» Booting Ubuntu 9.10 - Part 1 (The Downfall)

» Booting Ubuntu 9.10 - Part 2 (The Koala Reborn)

» Effective Use of VIM - Part 1

» Ubuntu 9.10 Karmic Koala on the move

» Sudo without Password in Ubuntu

» Internet Explorer in Ubuntu

» Mounting FAT32 Partitions with Full User Permission in Ubuntu

» Yahoo Messenger! in Ubuntu


ATOzTOA : Latest Headlines


0 comments:

Post a Comment