Sunday, February 14, 2010

Auditing Another Colleagues Package - PART 2

First step from Fedora's Review Guide is to make sure that the packages/spec file passes rpmlint.

So here is the result after running the command on both the source file and the spec file

Source:
[bchao@HongKong ~]$ rpmlint viewsource-1.1-1.fc11.src.rpm
viewsource.src: W: name-repeated-in-summary viewsource
viewsource.src: W: non-standard-group Development/tools
viewsource.src: E: no-changelogname-tag
viewsource.src:25: W: setup-not-quiet
viewsource.src:44: E: files-attr-not-set
viewsource.src:45: E: files-attr-not-set
viewsource.src:46: E: files-attr-not-set
viewsource.src:47: E: files-attr-not-set
viewsource.src:48: E: files-attr-not-set
viewsource.src:49: E: files-attr-not-set
viewsource.src:50: E: files-attr-not-set
viewsource.src: W: no-cleaning-of-buildroot %clean
viewsource.src: W: mixed-use-of-spaces-and-tabs (spaces: line 1, tab: line 1)
1 packages and 0 specfiles checked; 8 errors, 5 warnings.

Spec:
[bchao@HongKong SPECS]$ rpmlint viewsource.spec
viewsource.spec:7: W: non-standard-group Development/tools
viewsource.spec:25: W: setup-not-quiet
viewsource.spec:44: E: files-attr-not-set
viewsource.spec:45: E: files-attr-not-set
viewsource.spec:46: E: files-attr-not-set
viewsource.spec:47: E: files-attr-not-set
viewsource.spec:48: E: files-attr-not-set
viewsource.spec:49: E: files-attr-not-set
viewsource.spec:50: E: files-attr-not-set
viewsource.spec: W: no-cleaning-of-buildroot %clean
viewsource.spec: W: mixed-use-of-spaces-and-tabs (spaces: line 1, tab: line 1)
0 packages and 1 specfiles checked; 7 errors, 4 warnings.

To gain more information about these errors and warnings, you would type in "rpmlint -I "

Warnings
Problem;
viewsource.spec:7: W: non-standard-group Development/tools
Fix:
Since Linux is Case sensitive, Fedora did not find the group tools, so in change I renamed it to Tools and it solved the problem.

Spec File Before
Group: Development/tools

Spec File After
Group: Development/Tools

Description
[bchao@HongKong SPECS]$ rpmlint -I non-standard-group
non-standard-group:
The value of the Group tag in the package is not valid. Valid groups are:
"Amusements/Games", "Amusements/Graphics", "Applications/Archiving",
"Applications/Communications", "Applications/Databases",
"Applications/Editors", "Applications/Emulators", "Applications/Engineering",
"Applications/File", "Applications/Internet", "Applications/Multimedia",
"Applications/Productivity", "Applications/Publishing", "Applications/System",
"Applications/Text", "Development/Debug", "Development/Debuggers",
"Development/Languages", "Development/Libraries", "Development/System",
"Development/Tools", "Documentation", "System Environment/Base", "System
Environment/Daemons", "System Environment/Kernel", "System
Environment/Libraries", "System Environment/Shells", "User
Interface/Desktops", "User Interface/X", "User Interface/X Hardware Support".

Problem
viewsource.spec:25: W: setup-not-quiet
Fix: To fix this warning, we just add the option -q (quiet) so during the setup it will not verbose everything.

Spec File Before
%setup -n %{name}

Spec File After
%setup -q -n %{name}

Description
[bchao@HongKong SPECS]$ rpmlint -I setup-not-quiet
setup-not-quiet:
Use the -q option to the %setup macro to avoid useless build output from
unpacking the sources.


Problem
viewsource.src: W: no-cleaning-of-buildroot %clean

Fix
At the beginning of the clean section I need to replace this syntax "rm -rf %{buildroot}" line with this syntax "rm -rf $RPM_BUILD_ROOT"

Description
[bchao@HongKong SPECS]$ rpmlint -I no-cleaning-of-buildroot
no-cleaning-of-buildroot:
You should clean $RPM_BUILD_ROOT in the %clean section and in the beginning of
the %install section. Use "rm -rf $RPM_BUILD_ROOT". Some rpm configurations do
this automatically; if your package is only going to be built in such
configurations, you can ignore this warning for the section(s) where your rpm
takes care of it.

Problem
viewsource.spec: W: mixed-use-of-spaces-and-tabs (spaces: line 1, tab: line 1)

Fix
Replace all the spaces between the words and use tab, there were about 8 of these warnings that follows.

Description
[bchao@HongKong SPECS]$ rpmlint -I mixed-use-of-spaces-and-tabs
mixed-use-of-spaces-and-tabs:
The specfile mixes use of spaces and tabs for indentation, which is a cosmetic
annoyance. Use either spaces or tabs for indentation, not both.


Error
Problem
viewsource.src:44: E: files-attr-not-set

Fix
To fix this problem, in the %files section I need to add attributes to the files that were listed under it.

Spec File Before
%files
/var/www/html/viewsource/viewsource.py
/var/www/html/viewsource/viewsource.config
/var/www/html/viewsource/index.html
/var/www/html/viewsource/viewsource.pyo
/var/www/html/viewsource/viewsource.pyc
/etc/httpd/conf.d/viewsource.conf
/var/www/html/viewsource/README.viewsource.fedora
%defattr(-,root,root,-)
%doc LICENSE

Spec File After
%files
%defattr(-,root,root,-)
/var/www/html/viewsource/viewsource.py
/var/www/html/viewsource/viewsource.config
/var/www/html/viewsource/index.html
/var/www/html/viewsource/viewsource.pyo
/var/www/html/viewsource/viewsource.pyc
/etc/httpd/conf.d/viewsource.conf
/var/www/html/viewsource/README.viewsource.fedora
%defattr(-,root,root,-)
%doc LICENSE


Description
[bchao@HongKong SPECS]$ rpmlint -I files-attr-not-set
files-attr-not-set:
A file or a directory entry in a %files section does not have attributes set
which may result in security issues in the resulting binary package depending
on the system where the package is built. Add default attributes using
%defattr before it in the %files section, or use per line %attr's.

After fixing these problems, all errors and warnings has been fixed. So I rebuilt the RPM file from the fixed spec file.

On the side note a proper description is needed and as well the change log was empty, so I added an entry for the fix

So now after entering information in the change log I build the spec with the following command
rpmbuild -ba viewsource.spec

So now I ran rpmlint on the new source file and was prompted with the following error.

[bchao@HongKong SRPMS]$ rpmlint viewsource-1.1-2.fc11.src.rpm
viewsource.src: W: name-repeated-in-summary viewsource
1 packages and 0 specfiles checked; 0 errors, 1 warnings.

Here is the description of the error

[bchao@HongKong SRPMS]$ rpmlint -I name-repeated-in-summary
name-repeated-in-summary:
The name of the package is repeated in its summary. This is often redundant
information and looks silly in various programs' output. Make the summary
brief and to the point without including redundant information in it.

To fix the problem, in the Summary section, I need to replace the information in there and add something else.

In the description section, I went to the Viewsource site David Humphrey setup and copied part of the description and replaced it in the spec file.

Now after rebuilding the spec file, there aren't any errors any more. So far I haven't gone through the rest of the Fedora review guide, but so far this is a start. The new viewsource files will be up in our repository.

Friday, February 12, 2010

Auditing Another Colleagues Package

Two tasks for the week.
1. Package the pre-release of GCC 4.5 and has it work with my dehydra package.
2. Audit a fellow Colleagues Package and make sure it follows the "Fedora Review" guidelines. And the package I choose to review was viewsource, packaged by my friend jddeni

So far, I haven't had much success to both of them. Sadly I am unable to connect to our RPM Repo to grab the source RPM **AHEM** REPO Master **AHEM**, because I am getting the following error.


So I thought maybe I should remove the current DXR-Project RPM Repo package and reinstall it. So I did a "yum remove DXR-PROJECT" to remove the files from our /etc/yum.repos.d/ directory linking to our repo. Then grabbed the file again from our nice website that our repo master Alex "scripted" up. Sadly again, it ended with bad news, so I think our repo master needs to recompile the repo data in the directory.

So, next I went onto scotland and grabbed the file myself. I went to the directory that hosts all our class projects RPM files and copied the viewsource file onto my desktop.

I ran the the command "rpm -i viewsource-1.1-1.fc11.src.rpm" and was prompted with the following warning.

warning: viewsource-1.1-1.fc11.src.rpm: Header V4 DSA signature: NOKEY, key ID caffd37d

By this warning, I'm thinking that the source package was not signed correctly. I notified my colleagues about the situation and hopefully they can fix it so I can finish off this weeks tasks.

Look forward to my second post talking about packaging a pre-release of GCC4.5

Monday, February 8, 2010

A Different Approach On BackPorting GCC

Referring to my previous posts on my attempt to backport features from GCC 4.5 to GCC 4.4, I am figuring out another way to overcome some obstacles I encountered.

One of my ways is re-download the GCC 4.4 branch again and patch it. But this time I will copy over the GCC 4.5 Makefile.in and put it in the GCC 4.4 directory.

So to download the branch, I simply followed the steps I did from my previous post using SVN.

This adventure took about 12 mins to complete. After completing the download, I copied over the Makefile.in into the new downloaded directory.


I used the patches I have created from the last time I tried backported. The first run of the patch went smoothly till it tried to patch the Makefile.in. It notified me that the script detected the Makefile.in has already been patched with this patch before and asked me if I wanted to continue.

Because I have no idea what I am doing, I typed in the letter "y" and pressed enter to continue (the default option is [n]) to continue. But I'll keep trucking through till I figure it out, hopefully in my next post I've gone past this phase.

Saturday, February 6, 2010

Dehydra Package: Reviewing The Fedora Review Guidelines

In order for us to put my dehydra package on the next Fedora Release we need to make sure it passes the Fedora Review Guidelines.

So I went through my SPEC file to see what needs to be fixed or corrected so it can pass the Fedora Review Phase. So far I went through the checklist and I think everything is OK. I did the rpmlint test on all the RPM files, and they all passed with no errors only a couple warnings.

** if any of you have the time, can you please also check my package if it would pass the review board and just make a comment, thanks BoChao :)

[bchao@HongKong SPECS]$ rpmlint dehydra.spec
dehydra.spec:7: W: non-standard-group Applications/Programming
dehydra.spec:32: W: configure-without-libdir-spec
0 packages and 1 specfiles checked; 0 errors, 2 warnings.

Since its 4am in the morning, I don't think Chris Tyler would be awake so I jumped on IRC and joined the #fedora-devel channel on the freenode server.

**You can connect to the irc via web: Link

Here is a snippet of our conversation: IRC Chat


After that conversation, I went back to my spec file and added the comments he suggested.

And Now We have dehydra-0.9-3

Sadly this is not ready to be release to public till I get my other project up and running which is backporting GCC4.5 to 4.4

Here is my updated dehydra spec file

Wednesday, February 3, 2010

BackPort GCC 4.4 - Attempt 2

After working with my Professor Chris Tyler last night to help me overcome the hurdles I've been encountering with Backporting GCC 4.5 features to GCC 4.4.

The problems I am facing are lines in the Makefile.in reject files that do not match the original Makefile.in.

So after working together for a few others we decided to contact Diego again for some assistance. Due to his busy schedule, it may take him a while to respond to our problem.

While I am waiting, I will download a new GCC 4.4 branch, copy the Makefile.in from the GCC 4.5 branch and try to patch GCC 4.4 with the 4.5 file.

Chris noted that I could face alot of problems while doing it.

Here is an exert from our class meeting on IRC

------------------------
22:00 < BoChao> I fired an email to Diego, awaiting for response and also he isn't on IRC at the moment. So maybe tomorrow during business hours I will check with him
22:01 <@ctyler> ok. assuming you can't get with him this week, what shape are things in?
22:01 <@ctyler> do you see any alternate approaches?
22:01 * ctyler been thinking about that this evening, not coming up with much yet
22:01 < BoChao> i was thinking of maybe getting the branch again
22:02 <@ctyler> seems reasonable, but backup the current stuff first
22:02 < BoChao> and copy the makefile.in from the 4.5 release and put it in the 4.4 backport
22:02 < BoChao> then patch from that
22:02 < BoChao> and see what kind of results i get
22:03 <@ctyler> interesting approach, worth a shot but you'll have to remove a bunch of stuff, and it will be hard to see what needs to be removed
22:03 <@ctyler> because there's stuff in there to drive other features besides plugins
22:03 < BoChao> ahh
22:03 < BoChao> i guess I'm up for a challenge
22:04 <@ctyler> cool :-)
---------------------------------

Time to put this in gear