Monday, January 30, 2012

RPM Building Part 2

Okay, leaving my proxyknife rpm build in the back burner for now I am going to jump to my other source program and give it a shot at building an RPM for it.

Now the second program that I am using it M4, pretty much following the same steps from my previous post on proxykinfe I did the same configuration and steps to start my rpm build. Keeping my spec file for proxykinfe, I rebuilt the setuptree so I have a clean directory to work with. Now issuing these commands as before
  1. - cp m4-1.4.16.tar.gz ~/rpmbuild/SOURCE
  2. - cd ~/rpmbuild/SPECS
  3. - rpmdev-newspec m4
  4. - rpmbuild -ba m4.spec
After editing the spec file and running the rpmbuild command it started to build, and m4 took a long time compared to proxykinfe, none the less it finished and yet again I got errors again. :( Here are the errors that I got this time around.

error: Installed (but unpackaged) file(s) found:
   /usr/bin/m4
   /usr/share/info/dir
   /usr/share/info/m4.info-1.gz
   /usr/share/info/m4.info-2.gz
   /usr/share/info/m4.info.gz
   /usr/share/man/man1/m4.1.gz


RPM build errors:
    Installed (but unpackaged) file(s) found:
   /usr/bin/m4
   /usr/share/info/dir
   /usr/share/info/m4.info-1.gz
   /usr/share/info/m4.info-2.gz
   /usr/share/info/m4.info.gz
   /usr/share/man/man1/m4.1.gz

So after looking it over and doing some research, I found that the error was telling me that I didn't put any files into the RPM! Knowing that I added these lines to the %file section to test and the result...

Wrote: /home/chris/rpmbuild/SRPMS/m4-1.4.16-1.fc16.src.rpm
Wrote: /home/chris/rpmbuild/RPMS/x86_64/m4-1.4.16-1.fc16.x86_64.rpm
Wrote: /home/chris/rpmbuild/RPMS/x86_64/m4-debuginfo-1.4.16-1.fc16.x86_64.rpm
Executing(%clean): /bin/sh -e /var/tmp/rpm-tmp.GfdUJw
+ umask 022
+ cd /home/chris/rpmbuild/BUILD
+ cd m4-1.4.16
+ /bin/rm -rf /home/chris/rpmbuild/BUILDROOT/m4-1.4.16-1.fc16.x86_64
+ exit 0

Success!! Finally I got an RPM made, but copying all thoes files all the time when you make a RPM can be time consuming, after doing some more research I found easy to use macros to reduce similar lines

%files
%doc
%{_bindir}/*
%{_infodir}/*
%{_mandir}/man1/m4.1.gz

Some rpmlint testing to see if my spec files and rpm has any errors, so far none at the moment

 [chris@localhost SPECS]$ rpmlint -i m4.spec
0 packages and 1 specfiles checked; 0 errors, 0 warnings.


 [chris@localhost SRPMS]$ rpmlint -i m4-1.4.16-1.fc16.src.rpm
1 packages and 0 specfiles checked; 0 errors, 0 warnings.


[chris@localhost x86_64]$ rpmlint m4-debuginfo-1.4.16-1.fc16.x86_64.rpm
1 packages and 0 specfiles checked; 0 errors, 0 warnings.


Finally I have created an RPM!! This will help me with my next project using Mock and Koji, I am still going to work on my proxykinfe build still but for now I will continue on with my m4 RPM for my Mock and Koji testing.

**RPM, SRPM, and SPEC files here**

https://docs.google.com/open?id=0BxRdD36nj6CTOWMxNDg3NjctMzdlZS00YWQ5LThlMmQtZTk4YTE1YzhkNzUz

RPM Bulding Part 1


Alright folks, I am going to attempt to build a RPM package from one of my source packages. The first one I am going to attempt is proxyknife. So first we need to install these packages:

- yum groupinstall "Fedora Packager" 
- yum install rpmlint yum-utils 

Now after that we can create the rpm directories where we can work in by typing this command:

- rpmdev-setuptree 

After that is finished we can now start to work on our RPM, first we need to copy our source tarball to ~/rpmbuild/SOURCES 

- cp proxykinfe-1.7.tar.gz ~/rpmbuild/SOURCES

Now go into the SPECS directory so we can create the spec file to build the RPM:

- cd ~/rpmbuild/SPECS

In the SPECS directory we can now make the skeleton spec file for us to modify:

- rpmdev-newspec proxyknife

So with the skeleton spec file, I did some small configuration to the file to get it up and running then issued the command to build the RPM:

- rpmbuild -ba proxyknife.spec

In the beginning everything was going okay until the end where I got these bunch of errors: 


cp: cannot remove `/usr/share/proxyknife/doc/html/proxyknife.html/Customize-Request.html': Permission denied
cp: cannot remove `/usr/share/proxyknife/doc/html/proxyknife.html/Index.html': Permission denied
cp: cannot remove `/usr/share/proxyknife/doc/html/proxyknife.html/Sort-the-Result.html': Permission denied
cp: cannot remove `/usr/share/proxyknife/doc/html/proxyknife.html/index.html': Permission denied
cp: cannot remove `/usr/share/proxyknife/doc/html/proxyknife.html/Command_002dline-Exclusive-Options.html': Permission denied
cp: cannot remove `/usr/share/proxyknife/doc/html/proxyknife.html/Output.html': Permission denied
cp: cannot remove `/usr/share/proxyknife/doc/html/proxyknife.html/Invoking.html': Permission denied
cp: cannot remove `/usr/share/proxyknife/doc/html/proxyknife.html/Examples-of-startup-file.html': Permission denied
cp: cannot remove `/usr/share/proxyknife/doc/html/proxyknife.html/Via-Proxy.html': Permission denied
cp: cannot remove `/usr/share/proxyknife/doc/html/proxyknife.html/Startup-Options.html': Permission denied
cp: cannot remove `/usr/share/proxyknife/doc/html/proxyknife.html/General-Usage.html': Permission denied
cp: cannot remove `/usr/share/proxyknife/doc/html/proxyknife.html/Introduction.html': Permission denied
cp: cannot remove `/usr/share/proxyknife/doc/html/proxyknife.html/GNU-Free-Documentation-License.html': Permission denied
cp: cannot remove `/usr/share/proxyknife/doc/html/proxyknife.html/Copying-Source-Code.html': Permission denied
cp: cannot remove `/usr/share/proxyknife/doc/html/proxyknife.html/Startup-File.html': Permission denied
cp: cannot remove `/usr/share/proxyknife/doc/html/proxyknife.html/Contact.html': Permission denied
cp: cannot remove `/usr/share/proxyknife/doc/html/proxyknife.html/Advanced.html': Permission denied
cp: cannot remove `/usr/share/proxyknife/doc/html/proxyknife.html/Download-Proxylist.html': Permission denied
cp: cannot remove `/usr/share/proxyknife/doc/html/proxyknife.html/Proxylist.html': Permission denied
cp: cannot remove `/usr/share/proxyknife/doc/html/proxyknife.html/Copying-This-Manual.html': Permission denied
make[2]: *** [install-data-local] Error 1
make[2]: Leaving directory `/home/chris/rpmbuild/BUILD/proxyknife-1.7/doc'
make[1]: *** [install-am] Error 2
make[1]: Leaving directory `/home/chris/rpmbuild/BUILD/proxyknife-1.7/doc'
make: *** [install-recursive] Error 1
error: Bad exit status from /var/tmp/rpm-tmp.ef2HEI (%install)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.ef2HEI (%install)


My overall thoughts on why this is happening is maybe because I needed to be root to install this source program last time? This could be the issue why it keeps failing.

After doing some editing to my spec file I still was getting that error. After looking at the errors logs it looks like it keeps erasing the documents during the end of the make part and it is getting permission denied, that is the reason why my RPM is not building. Maybe a little more research on the issue might help so I am going to leave it as it is for now until I get some solid answers to tackle my issue.

Tuesday, January 24, 2012

Building from Source


In this blog post I am going to go though a simple example of how to build software from source. It may see like a difficult task but in reality it is very simple to do, as long as you read the documents supplied you should be fine.

For my demonstration purposes I used software from the GNU Project, there lots of different software at their website but I decided to choose these two


  • Proxyknife - This program is basically to find out open proxy ports behind users firewalls. There are many other options and functions that you can invoke while running this software that could be of use to you if you need a program like this.
  • Units - What this software does is it is a simple unit converter, I found this program to be very interesting just in the fact that it is a simple converter (KM to M, etc...) as well is is able to do simple unit calculations. Very useful tool to have if you need to do a quick conversion.


Here are the steps that I used to install this software, I followed the same procedure for both of my source software.

1) Grab the tar file from the site proxyknife-1.7.tar.gz or units-1.88.tar.gz

2) Extract the tar using "tar -xvf  proxyknife-1.7.tar.gz" or "tar -xvf units-1.88".

3) Go into the directory of the extracted folder ( It is a good idea to read the supplied documents to see if there are any other extra dev tools need).

4) Now in that same directory we are going to configure the build for are specific machine by using the command "./configure" , this will run through and usually make the "make" file to setup.

5) Then after the configure is complete type the command "make" to build the software. For my testing purposes I used the time command to see how long it took to finish the make.

[ ProxyKnife ]
$ time make
real    0m1.641s
user    0m1.260s
sys    0m0.300s

[ Units ]
$ time make
real    0m0.857s
user    0m0.790s
sys    0m0.070s

These two programs built relatively quick.

6) After the make is done type the command "make install" which will install the program.

Overall this process only took around 10mins, I did play around with the units program for a bit and it did do proper conversion, but the proxyknife need a bit more manual reading before I mess around with. The only problems that I ran into was that I was not able to install certain parts of the program unless I was root, it usually gave me a permission denied. Switching to superuser root let me install the two software's without any issues. Though it is always good idea to use your user to do things, some things do require root access just like these software.





Monday, January 16, 2012

SBR600 Introduction

Hello Everybody,
My name is Chris Choo and I am currently enrolled in SBR600 class, I am in the CTY program at Seneca@York. In my spare time I enjoy playing tennis, hockey and video games.

Before reading more about Raspberry Pi I had only seen it on a post on Engadget but to my surprise I see that this is a great product. I like the fact about the price range for this machine (25-35$) and that everyone can own a computer for such a low cost. After seeing the functionality and abilities it can accomplish there are many things this machine can run as good as a regular desktop machine. I believe that given time this will develop into an even better product to use with more support for other OS types.



Info/Links to my other Pages


Seneca Wiki Page:  http://zenit.senecac.on.ca/wiki/index.php/User:Cchoo2

Fedora Wiki Page:  https://fedoraproject.org/wiki/User:Cchoo2

IRC/LearnID: cchoo2

My IRC Chat Session: