Thursday, September 30, 2010

Testing j-value with a big package

I guess Chris Tyler is not convinced about j1 is faster than j3 or j2. There are two such cases, include my own, were posted on the Planet. I decide to test a big package. I chose gcc-c++. The size of the rpm source package is about 50M. It seems not that big. So the other day I tried to run rpmbuild on this package. It run more than 2 hours and didn't finish. I had to kill it.

I decide to write a small script to run automatically. First I use a simple for loop (for i in 1 2 3 4 5). But how to catch the time. If I use time before rpmbuild, I need to redirect the output to catch the time. The redirection file will be huge. But I only need the last 3 lines. The funny thing is that 3 lines of time is not redirected (when I test using a small package). So I better use time stamp, recording time before build (date +%s) and recording time after. Then out put the difference.

To change the j value in .rpmmacro file, I couldn't think of a better solution. OPS435 was quite some time ago. I simply just echo the 3 lines to the file before run the rpmbuild command. I think it's not a good approach in scripting. But I want to start run the test sooner. After I tested the script, I started to run the build this evening and planed to run over night. I set to run 5 cases (from 1 to 5). I don't know if it will finish by tomorrow morning. I will add the result here as soon as the test is done.

......The test result finally comes out.  The output is like this:

This is testing of j1.
Time spent is:  37835 seconds
This is testing of j2.
Time spent is:  38562 seconds
This is testing of j3.
Time spent is:  39019 seconds
This is testing of j4.
Time spent is:  39316 seconds
This is testing of j5.
Time spent is:  39301 seconds

It seems j1 is still faster. I wonder what could be an explaination for that.

Saturday, September 25, 2010

Create spec file for Wireshark

At this stage of SBR600, we are going to create our own spec file to build some package from the source tar ball. I started with Bind. Then jumped to other packages. Finally I decide to stick to Wireshark.

My first stop is GTK+ package. The build exit with error because I didn't have GTK+ installed. I run yum install gtk+. Then run rpmbuild again. I still got the same error. The requirement of GTK+ is version 2.4.0+, and what I installed is version 1.9.2. I didn't know what to do. I left it there.

During the lab time, I got help from the teacher that I should install gtk2. Now the build went further. Then I run into rpant(?) error, which is about hard coded library file names. I stopped there since lab time is up.

I picked it up again at home. My home computer is 32 bit kernel. I didn't get the error I got from the school computer. (I will investigate that error when I have spare time.) So I played with %file section a little bit and I got my first build through without errors. The rpm How to page is very helpful.

Then I run rpmlint on the rpm file. From SPECS dir run: rpmlint -i ../RPMS/i686/*. I got 47 errors and 42 warnings. There are three types of major errors. One is about debug info. It complains that "/usr/lib/debug/usr/lib/wireshark/..."; another type of error complains some library files didn't call ldconfig; yet another type was that "standard library file was included in the package". I didn't have much idea how to deal with them. I went to IRC try to get help from Chris Tyler. He suggested me to remove all the debug files. For calling ldconfig, he told me to add %post and %postun sections and call ldconfig there. I also modified %{_mandir} setting to address the standard library complains.

So that's it. I got 5 warnings and no errors when I run rpmlint again. The warning mainly about devel files packed into normal lib files. I don't know how to deal with it. I have my spec file and rpm file in my matrix account: (do I need put other files?)

matrix.senecac.on.ca/~zwang98/SPECS
matrix.senecac.on.ca/~zwang98/RPMS

In conclusion, I spent quite some time to accomplish this task. It was frustrating at some point. Also, if each build run 8 - 10 minutes, 2, 3 hours go very fast. In the end, however, I feel I scratch the surface of rpm build process. I may consider to do a quick reading of Maximum RPM. I don't know ...

Tuesday, September 21, 2010

Bind build

I am using an old Dell at home. It's a Dimension 4700. I built Bind-9.7.1 package. The result is a little bit unusual because the -j1 is a bit faster than other settings.

-j1
real    2m16.900s
user    1m21.478s
sys     0m29.533s
-j2
real    2m17.327s
user    1m22.982s
sys     0m29.513s
-j3
real    2m17.568s
user    1m23.123s
sys     0m29.414s
-j4
real    2m17.716s
user    1m23.237s
sys     0m29.498s
-j5
real    2m17.602s
user    1m23.132s
sys     0m29.581s

Saturday, September 11, 2010

SBR600-lab1

1. Nled

It's straightforward. I did it quickly. But then I have to reinstall a fresh fedora13. (During my second package build, I did
            yum remove libcurl
in attemption to reinstall libcurl. Then the system won't start.) I reinstalled fedora13 from a live CD and did yum update. I download the nled tar ball, and unpacked the source. When I run make, I didn't have the compiler. So I have to yum install gcc, and then yum install "*ncurses.h". This time 'make' runs through.

2. Apache

I installed wget first, and then did the following:
  • wget http://apache.mirror.rafal.ca/httpd/httpd-2.2.16.tar.gz
  • tar xvzf httpd-2.2.16.tar.gz 
  • cd httpd-2.2.16
  • ./configure --prefix=$HOME/httpd
  • make
  • make install 
 
Now I have Apache Server installed in my home directory.

3. bzflag

bzflag is a 3D multiplayer free online game. It's tank game.

The first try: from SourceForge I got the bzglag. When I run the configure, it says you must install libcurl. I did yum install libcurl. Then I run the configure again. It still says you must install libcurl. I left it there.

The second try: I got a tip from the Prof. He suggested me to install libcurl-devel. I did yum install libcurl-devel. Then I run the configure again. It went through. Just the outcome says "no SDL!" "no client binary". It sounded not good. I didn't know the catch so I run make and make install. But the game executable is not generated. It generated bzadmin and bafs in /usr/local/bin. I left it there once more.

The third try: I got a chance to talk to Chris on IRC later on. He said I should install SDL (yum install "SDL*-devel"). This time it worked. I started the game. I join the game and I started the server. But I don't know how to play the game.

Tuesday, September 7, 2010

First Blog for SBR600

This is Joe (Zhiqing) Wang. This is my 5th semester in Seneca College. I started in CNS program but transferred to CTY co-op program not long ago. My first college education was Mathematics (what was I thinking?). I went through a one-year-training in computer programming at a private college. I worked at a software company a few years back. My goal is quit simple: to land a job in Network Administration arena.

I am just starting SBR600. The first task of the course is to set things up. I started IRC. Here is a portion of the conversation from Freenote at #seneca channel:


I also have my wiki pages from Seneca and from Fedora:

http://zenit.senecac.on.ca/wiki/index.php/User:Zwang98
https://fedoraproject.org/wiki/User:Zwang98

They are just empty pages now. I will edit them as the course moving forward.