Saturday 23 November 2013

Release 0.1.1 - Pkgdb2 succesfful deployment of temporary instance

1. Install needed packages: 
 
sudo yum install python-virtualenv libpq*
 
2. Get pkgdb2 
 
git clone https://github.com/fedora-infra/packagedb2.git
 
3. Go inside packagedb2 folder
 
cd packagedb2
 
4. run virtual env
$ virtualenv my-pkgdb2-env
 
5. run this command
 
$ source my-pkgdb2-env/bin/activate 

your prompt will change to my-pkgdb2-env now

6. Run these commands to install dependencies:

(my-pkgdb2-env)$ pip install kitchen paver urllib3
(my-pkgdb2-env)$ pip install git+https://github.com/fedora-infra/python-fedora.git
(my-pkgdb2-env)$ pip install -r requirements.txt
(my-pkgdb2-env)$ pip install -r test_requirements.txt
 
7. if everything went without errors then run this command to download a temporary 
database for your instance
 
(my-pkgdb2-env)$ ./runtests.sh 

this will take some time
 
8. If the result came out as "OK" then start the server:
 
(my-pkgdb2-env)$ python runserver.py
 
9. Once started, open your favourite browser and type the following URL:
 
http:127.0.0.0:5000
 
I was able to get the instance up and running. Here is a screen-shot of the new pkgdb2 
 

Wednesday 20 November 2013

Release 0.1 - service sbrproject restart

The Main Goal

My main project was to port fedpkg to pidora so fedpkg would work with Pidora packages. For that I needed to install Fedora Package Database as fedpkg communicates with it and then modify it for Pidora packages.

Release 0.1

My goal for release 0.1 was to install Fedora Package Database(pkgdb) and make walk-through of it. I stumbled upon a few issues and was communicating with the package maintainers, they said we will only be supporting pkgdb for 2 months now and we are currently working on pkgdb2 which would be ready in 2 months. The instance of pkgdb2 that they have currently has a few bugs and is not ready to work with fedpkg.

What Now?

After a group meeting with Chris Tyler and package maintainers, we decided that I should proceed with the installation of pkgdb2, which, although is not ready yet, will be ready soon and maintained. It would not make sense to deploy a package which will go out of date very soon. Moreover, it would also not make sense to deploy pkgdb1 for Pidora as Fedora Package Database has several uses.

Fedora Package Database Installation - From Beginning to as far as I got

1.      Get the package database:

·         git clone https://github.com/fedora-infra/packagedb.git

2.      Install the needed packages:

·         yum -y install python-genshi TurboGears python-turbojson postgresql-server \
        postgresql-contrib python-TurboMail python-bugzilla python-fedora \
        python-psycopg2 python-sqlalchemy python-feedparser koji mod_wsgi \
        python-paver httpd mod_ssl babel python-cpio xz python-argparse \
        python-mako python-memcached py
NOTE: if you are running on fedora install python-fedora-turbogears by issuing command “yum install python-fedora-turbogears”

3.      go to packaged “cd packagedb”

·         python setup.py egg_info (you will get a few warnings ignore them)
           NOTE:please do a yum update before doing this.

4.     Copy paver to your current directory and renaming  it to paver.local
·         cp /usr/bin/paver paver.local

5.      Run this complicated command (copy/paste it carefully so only the code gets copied)
·         sed 's/__requires__ = .*/__requires__ = ["Paver", "CherryPy < 3.0"]/' < paver.local > paver

6.       Build the package:
·         paver build --install-conf=`pwd` --install-data=`pwd` --install-sbin=`pwd`

7.      start the postgresql service if it is not already started by issuing
·         service postgresql initdb
·         start the service using "service postgresql start"

8.      Create postgresql users: 

sudo -u postgres createuser -SDRPE pkgdbadmin
        Enter password for new role: <password>
        Enter it again: <password>
        sudo -u postgres createuser -SDRPE pkgdbreadonly
        Enter password for new role: <password>
        Enter it again: <password>

Get the most recent dump from the same website you grabbed fedora package from. so go to https://fedorahosted.org/releases/p/a/packagedb and download the most recent ".dump.xz" file

then run this command to import it all to the database:

xzcat pkgdb-20100318.dump.xz | sudo -u postgres psql
NOTE: this can take a while, no, rather this will take a while - give it about 3-4 hours if you are running it on a virtual machine.

9.       Run this command
·            sudo -u postgres psql pkgdb < update-schema/03_add_gitbranchname.sql

10.     Memcached is an optional daemon that can be run to speed up the server.  It functions by caching certain data that is read many times so that we don't have to access the database as frequently.  To use it you need to install and start it

·               su -c yum install memcached
·               su -c /etc/init.d/memcached start

11.      Move pkgdb.cfg.sample to pkgdb.cfg
·               mv pkgdb.cfg.sample pkgdb.cfg

12.      Modify the pkgdb.cfg file
·                  sqlalchemy.dburi="postgres://pkgdbadmin:(password)@localhost/pkgdb"
·            server.static_media_dir="(the path to packagedb directory e.g /home/hitman/packaged)"

13.      Modify /etc/httpd/conf/httpd.conf
·          vi /etc/httpd/conf/httpd.conf
        <Directory "/home/hitman/packagedb">
            AllowOverride None
            Options None
            Order allow,deny
            Allow from all
          </Directory>

14.    Turn SELINUX in permissive mode (just to check)
·      setenforce 0

15. Copy the httpd-pkgdb.conf file to your apache conf.d directory

·      sudo cp httpd-pkgdb.conf /etc/httpd/conf.d/

16.    Restart httpd server
·      service httpd restart

17.    ATTEMPT to access the Fedora Package Database Webpage
·         https://localhost/pkgdb/

18. Get the errors from the error log and try to resolve them.
·         tail /etc/httpd/logs/ssl_error_log

[Tue Nov 19 23:09:07.816671 2013] [:error] [pid 2494] [remote ::1:6073] mod_wsgi (pid=2494): Target WSGI script '/home/hitman/Public/packagedb/pkgdb.wsgi' cannot be loaded as Python module.
[Tue Nov 19 23:09:07.816714 2013] [:error] [pid 2494] [remote ::1:6073] mod_wsgi (pid=2494): Exception occurred processing WSGI script '/home/hitman/Public/packagedb/pkgdb.wsgi'.
[Tue Nov 19 23:09:07.816733 2013] [:error] [pid 2494] [remote ::1:6073] Traceback (most recent call last):
[Tue Nov 19 23:09:07.816757 2013] [:error] [pid 2494] [remote ::1:6073] File "/home/hitman/Public/packagedb/pkgdb.wsgi", line 24, in
[Tue Nov 19 23:09:07.816809 2013] [:error] [pid 2494] [remote ::1:6073] modulename="pkgdb.config")
[Tue Nov 19 23:09:07.816821 2013] [:error] [pid 2494] [remote ::1:6073] File "/usr/lib/python2.7/site-packages/turbogears/config.py", line 219, in update_config
[Tue Nov 19 23:09:07.816892 2013] [:error] [pid 2494] [remote ::1:6073] configdict = config_obj(configfile, modulename).dict()
[Tue Nov 19 23:09:07.816904 2013] [:error] [pid 2494] [remote ::1:6073] File "/usr/lib/python2.7/site-packages/turbogears/config.py", line 174, in config_obj
[Tue Nov 19 23:09:07.816923 2013] [:error] [pid 2494] [remote ::1:6073] modname + '.cfg')
[Tue Nov 19 23:09:07.816933 2013] [:error] [pid 2494] [remote ::1:6073] File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 862, in resource_filename
[Tue Nov 19 23:09:07.817317 2013] [:error] [pid 2494] [remote ::1:6073] return get_provider(package_or_requirement).get_resource_filename(
[Tue Nov 19 23:09:07.817329 2013] [:error] [pid 2494] [remote ::1:6073] File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 180, in get_provider
[Tue Nov 19 23:09:07.817345 2013] [:error] [pid 2494] [remote ::1:6073] import(moduleOrReq)
[Tue Nov 19 23:09:07.817360 2013] [:error] [pid 2494] [remote ::1:6073] ImportError: No module named pkgdb


This is how far I got when installing Fedora Package Datbase.





Tuesday 19 November 2013

Fedora Package Installation - Latest update November 19th


I had issue with the paver command when I was installing so I asked it on github.

https://github.com/fedora-infra/packagedb/issues/13

This was the problem:
paver build --install-conf=`pwd` --install-data=`pwd` --install-sbin=`pwd`
Traceback (most recent call last):
  File "/usr/bin/paver", line 9, in <module>
    load_entry_point('Paver==1.1.1', 'console_scripts', 'paver')()
  File "/usr/lib/python2.7/site-packages/paver/tasks.py", line 816, in main
    _launch_pavement(args)
  File "/usr/lib/python2.7/site-packages/paver/tasks.py", line 785, in _launch_pavement
    execfile(environment.pavement_file, mod.__dict__)
  File "pavement.py", line 16, in <module>
    from turbogears.finddata import find_package_data
  File "/usr/lib/python2.7/site-packages/turbogears/__init__.py", line 9, in <module>
    from turbogears.config import update_config
  File "/usr/lib/python2.7/site-packages/turbogears/config.py", line 4, in <module>
    pkg_resources.require("CherryPy<3.0")
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 690, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 592, in resolve
    raise VersionConflict(dist,req) # XXX put more info here
pkg_resources.VersionConflict: (CherryPy 3.2.2 (/usr/lib/python2.7/site-packages), Requirement.parse('CherryPy<3.0')

Toshio Replied today giving me a fix, so I was able to move on further. the fix was to copy paver script on the local folder and replace the version and run the paver script locally.


$ cp /usr/bin/paver paver.local
$ sed 's/__requires__ = .*/__requires__ = ["Paver", "CherryPy < 3.0"]/' < paver.local > paver
$ ./paver build --install-conf=`pwd` --install-data=`pwd` --install-sbin=`pwd`

However, now, the pkgdb-sync-yum command is broken. I have asked him again on github and waiting for his reply.

[root@localhost server-scripts]# chmod 755 pkgdb-sync-yum
[root@localhost server-scripts]# ./pkgdb-sync-yum update -h
Traceback (most recent call last):
File "./pkgdb-sync-yum", line 51, in
import pkg_resources
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 2655, in
working_set.require(requires)
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 648, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 546, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: fedora-packagedb

I moved on with the steps ignoring that step and found myself having 500 error when trying to access the website. I am hoping that it is connected to the update.

Sunday 17 November 2013

RPM SIgning lab - SBR600

Followed the tutorial on the website: http://zenit.senecac.on.ca/wiki/index.php/Signing_and_Creating_a_Repository_for_RPM_Packages

executed the command gpg --key-gen,
it asked me a bunch of questions and at the end it created the RSA public key.
pub   2048R/FA60C533 2013-11-17 [expires: 2014-01-16]

after this, i just navigated to where I had my RPMS and signed it using this command

#rpm --addsign less-451-1.fc18.i686.rpm
Enter pass phrase:
Pass phrase is good.
less-451-1.fc18.i686.rpm:

here is a link to my signed RPM


[hitman@localhost i686]$ rpm --addsign grep-2.9-1.fc18.i686.rpm
Enter pass phrase:
Pass phrase is good.
grep-2.9-1.fc18.i686.rpm:
[hitman@localhost i686]$



Here is a link to my signed RPMs:


grep-2.9-1.fc18.i686.rpm
less-451-1.fc18.i686.rpm


Created the gpg key by issuing the command

gpg --export --armour msmahmood@myseneca.ca > gpgkey.txt

gpgkey.txt can be viewed here

GPG is a very handy tool, probably the only tool i know that can encrypt files, maybe there are others, however, this was pretty easy to use.

Thursday 14 November 2013

Koji Lab SBR600

I already had fedora-packager installed so I did not need to do that.



Ran the command:

/usr/bin/fedora-packager-setup 


Everything was properly set up to use koji.


GREP


[hitman@localhost SRPMS]$ time koji build f18 --scratch grep-2.9-1.fc18.src.rpm
Uploading srpm: grep-2.9-1.fc18.src.rpm
[====================================] 100% 00:00:05 1019.85 KiB 177.57 KiB/sec
Created task: 6182383
Task info: http://koji.fedoraproject.org/koji/taskinfo?taskID=6182383
Watching tasks (this may be safely interrupted)...
6182383 build (f18, grep-2.9-1.fc18.src.rpm): free
6182383 build (f18, grep-2.9-1.fc18.src.rpm): free -> open (arm02-builder10.arm.fedoraproject.org)
  6182385 buildArch (grep-2.9-1.fc18.src.rpm, i686): open (buildvm-15.phx2.fedoraproject.org)
  6182384 buildArch (grep-2.9-1.fc18.src.rpm, x86_64): open (buildvm-21.phx2.fedoraproject.org)
  6182385 buildArch (grep-2.9-1.fc18.src.rpm, i686): open (buildvm-15.phx2.fedoraproject.org) -> closed
  0 free  2 open  1 done  0 failed
  6182384 buildArch (grep-2.9-1.fc18.src.rpm, x86_64): open (buildvm-21.phx2.fedoraproject.org) -> closed
  0 free  1 open  2 done  0 failed
6182383 build (f18, grep-2.9-1.fc18.src.rpm): open (arm02-builder10.arm.fedoraproject.org) -> closed
  0 free  0 open  3 done  0 failed



6182383 build (f18, grep-2.9-1.fc18.src.rpm) completed successfully



real    3m4.840s
user    0m2.116s
sys    0m0.200s

It took me about 1 minute less than then it took me to build it locally using mock. Which is a big difference considering the package is small, if it was a huge package, it probably would have taken me a bit longer.

building grep for Powerpc arch, it built it for both 32 and 64 as can be seen.

[hitman@localhost SRPMS]$ time ppc-koji build f18 --scratch grep-2.9-1.fc18.src.rpm
Uploading srpm: grep-2.9-1.fc18.src.rpm
[====================================] 100% 00:00:05 1019.85 KiB 170.42 KiB/sec
Created task: 1530737
Task info: http://ppc.koji.fedoraproject.org/koji/taskinfo?taskID=1530737
Watching tasks (this may be safely interrupted)...
1530737 build (f18, grep-2.9-1.fc18.src.rpm): free
1530737 build (f18, grep-2.9-1.fc18.src.rpm): free -> open (ppc-builder2)
  1530738 buildArch (grep-2.9-1.fc18.src.rpm, ppc): open (ppc-builder6)
  1530739 buildArch (grep-2.9-1.fc18.src.rpm, ppc64): free
  1530739 buildArch (grep-2.9-1.fc18.src.rpm, ppc64): free -> open (ppc-builder2)
  1530738 buildArch (grep-2.9-1.fc18.src.rpm, ppc): open (ppc-builder6) -> closed
  0 free  2 open  1 done  0 failed
  1530739 buildArch (grep-2.9-1.fc18.src.rpm, ppc64): open (ppc-builder2) -> closed
  0 free  1 open  2 done  0 failed
1530737 build (f18, grep-2.9-1.fc18.src.rpm): open (ppc-builder2) -> closed
  0 free  0 open  3 done  0 failed

1530737 build (f18, grep-2.9-1.fc18.src.rpm) completed successfully

real    6m32.512s
user    0m5.032s
sys    0m0.338s

I did not get any errors but it did take me 6 minutes to build it.
 I am trying to build it for s390 architecture, but it gave me some error that i did not know about, now i am waiting for it to build again.

------------------------UPDATE-------------------------------------------------------------------------------
Made some changes to the spec file of grep and update the "Requires:" field

When i was building from the spec file I was noticing these "Requires:" field that I was not including but my package was still building without issues

Requires(interp): /bin/sh /bin/sh
Requires(rpmlib): rpmlib(CompressedFileNames) <= 3.0.4-1 rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1
Requires(post): /bin/sh info
Requires(preun): /bin/sh info
Requires: libc.so.6 libc.so.6(GLIBC_2.0) libc.so.6(GLIBC_2.1) libc.so.6(GLIBC_2.1.3) libc.so.6(GLIBC_2.2) libc.so.6(GLIBC_2.2.3) libc.so.6(GLIBC_2.3) libc.so.6(GLIBC_2.3.4) libc.so.6(GLIBC_2.4) libpcre.so.1 rtld(GNU_HASH)
Processing files: grep-debuginfo-2.9-1.fc18.i686
Provides: grep-debuginfo = 2.9-1.fc18 grep-debuginfo(x86-32) = 2.9-1.fc18
Requires(rpmlib): rpmlib(FileDigests) <= 4.6.0-1 rpmlib(PayloadFilesHavePrefix) <= 4.0-1 rpmlib(CompressedFileNames) <= 3.0.4-1


I searched the libraries for these packages and found out that I was not including rpm-devel and glibc. I changed my spec file and I was able to build it on s390 archs

here is a link to my new spec.file
grep.spec 
  

  
[hitman@localhost SRPMS]$ time s390-koji build f18 --scratch grep-2.9-1.fc18.src.rpm
Uploading srpm: grep-2.9-1.fc18.src.rpm
[====================================] 100% 00:00:05 1019.81 KiB 174.00 KiB/sec
Created task: 1260172
Task info: http://s390.koji.fedoraproject.org/koji/taskinfo?taskID=1260172
Watching tasks (this may be safely interrupted)...
1260172 build (f18, grep-2.9-1.fc18.src.rpm): free
1260172 build (f18, grep-2.9-1.fc18.src.rpm): free -> open (fedora3.s390.bos.redhat.com)
  1260173 buildArch (grep-2.9-1.fc18.src.rpm, s390): free
  1260174 buildArch (grep-2.9-1.fc18.src.rpm, s390x): free
  1260173 buildArch (grep-2.9-1.fc18.src.rpm, s390): free -> open (fedora1.s390.bos.redhat.com)
  1260173 buildArch (grep-2.9-1.fc18.src.rpm, s390): open (fedora1.s390.bos.redhat.com) -> closed
  1 free  1 open  1 done  0 failed
  1260174 buildArch (grep-2.9-1.fc18.src.rpm, s390x): free -> open (fedora1.s390.bos.redhat.com)
  1260174 buildArch (grep-2.9-1.fc18.src.rpm, s390x): open (fedora1.s390.bos.redhat.com) -> closed
  0 free  1 open  2 done  0 failed
1260172 build (f18, grep-2.9-1.fc18.src.rpm): open (fedora3.s390.bos.redhat.com) -> closed
  0 free  0 open  3 done  0 failed

1260172 build (f18, grep-2.9-1.fc18.src.rpm) completed successfully

real    9m16.539s
user    0m5.653s
sys    0m0.369s 


Ok this took me about an hour to figure out and about 10 minutes to build.

LESS

Time for less!
  
 [hitman@localhost SRPMS]$ time koji build f18 --scratch less-451-1.fc18.src.rpm
Uploading srpm: less-451-1.fc18.src.rpm
[====================================] 100% 00:00:02 305.66 KiB 145.18 KiB/sec
Created task: 6182535
Task info: http://koji.fedoraproject.org/koji/taskinfo?taskID=6182535
Watching tasks (this may be safely interrupted)...
6182535 build (f18, less-451-1.fc18.src.rpm): open (arm02-builder06.arm.fedoraproject.org)
  6182537 buildArch (less-451-1.fc18.src.rpm, i686): open (buildvm-21.phx2.fedoraproject.org)
  6182536 buildArch (less-451-1.fc18.src.rpm, x86_64): open (buildvm-26.phx2.fedoraproject.org)
  6182536 buildArch (less-451-1.fc18.src.rpm, x86_64): open (buildvm-26.phx2.fedoraproject.org) -> closed
  0 free  2 open  1 done  0 failed
  6182537 buildArch (less-451-1.fc18.src.rpm, i686): open (buildvm-21.phx2.fedoraproject.org) -> closed
  0 free  1 open  2 done  0 failed
6182535 build (f18, less-451-1.fc18.src.rpm): open (arm02-builder06.arm.fedoraproject.org) -> closed
  0 free  0 open  3 done  0 failed

6182535 build (f18, less-451-1.fc18.src.rpm) completed successfully

real    2m14.817s
user    0m1.682s
sys    0m0.121s

No issues yet and pretty fast as well. lets try it for other archs..

[hitman@localhost SRPMS]$ time ppc-koji build f18 --scratch less-451-1.fc18.src.rpm
Uploading srpm: less-451-1.fc18.src.rpm
[====================================] 100% 00:00:02 305.66 KiB 149.45 KiB/sec
Created task: 1530907
Task info: http://ppc.koji.fedoraproject.org/koji/taskinfo?taskID=1530907
Watching tasks (this may be safely interrupted)...
1530907 build (f18, less-451-1.fc18.src.rpm): free
1530907 build (f18, less-451-1.fc18.src.rpm): free -> open (ppc-builder6)
  1530908 buildArch (less-451-1.fc18.src.rpm, ppc): open (ppc-builder6)
  1530909 buildArch (less-451-1.fc18.src.rpm, ppc64): open (ppc-builder1)
  1530908 buildArch (less-451-1.fc18.src.rpm, ppc): open (ppc-builder6) -> closed
  0 free  2 open  1 done  0 failed
  1530909 buildArch (less-451-1.fc18.src.rpm, ppc64): open (ppc-builder1) -> closed
  0 free  1 open  2 done  0 failed
1530907 build (f18, less-451-1.fc18.src.rpm): open (ppc-builder6) -> closed
  0 free  0 open  3 done  0 failed

1530907 build (f18, less-451-1.fc18.src.rpm) completed successfully

real    7m26.703s
user    0m5.605s
sys    0m0.338s

2 down, 1 to go


[hitman@localhost SRPMS]$ time s390-koji build f18 --scratch less-451-1.fc18.src.rpm
Uploading srpm: less-451-1.fc18.src.rpm
[====================================] 100% 00:00:02 305.66 KiB 140.13 KiB/sec
Created task: 1260196
Task info: http://s390.koji.fedoraproject.org/koji/taskinfo?taskID=1260196
Watching tasks (this may be safely interrupted)...
1260196 build (f18, less-451-1.fc18.src.rpm): free
1260196 build (f18, less-451-1.fc18.src.rpm): free -> open (fedora1.s390.bos.redhat.com)
  1260197 buildArch (less-451-1.fc18.src.rpm, s390): free
  1260198 buildArch (less-451-1.fc18.src.rpm, s390x): free
  1260197 buildArch (less-451-1.fc18.src.rpm, s390): free -> open (fedora3.s390.bos.redhat.com)
  1260198 buildArch (less-451-1.fc18.src.rpm, s390x): free -> open (fedora1.s390.bos.redhat.com)
  1260197 buildArch (less-451-1.fc18.src.rpm, s390): open (fedora3.s390.bos.redhat.com) -> closed
  0 free  2 open  1 done  0 failed
  1260198 buildArch (less-451-1.fc18.src.rpm, s390x): open (fedora1.s390.bos.redhat.com) -> closed
  0 free  1 open  2 done  0 failed
1260196 build (f18, less-451-1.fc18.src.rpm): open (fedora1.s390.bos.redhat.com) -> closed
  0 free  0 open  3 done  0 failed

1260196 build (f18, less-451-1.fc18.src.rpm) completed successfully

real    4m10.215s
user    0m3.400s
sys    0m0.218s

Nice, built without issues.
I am beginning to like this stuff!
I think Koji is a good tool, it makes it a lot easier to build on other architectures without actually having one, it would probably also save time for bigger packages.

Mock Lab SBR600

Mock creates chroots and builds packages in them. Its only task is to reliably populate a chroot and attempt to build a package in that chroot.

So I began by installing mock
  • yum install mock
Then added my user-name to the group mock
  • usermod -aG mock hitman
Then just ran the mock command to build grep under chroot.
  • mock -r fedora-18-i386 grep-2.9-1.fc18.src.rpm 
 Surprisingly, It build without any issues in the first shot! Maybe because I put a lot of work in my SPEC files and made sure build requires and macros are properly given.

INFO: mock.py version 1.1.32 starting...
Start: init plugins
INFO: selinux enabled
Finish: init plugins
Start: run
INFO: Start(grep-2.9-1.fc18.src.rpm)  Config(fedora-18-i386)
Start: lock buildroot
Start: clean chroot
Finish: clean chroot
Finish: lock buildroot
Start: chroot init
Start: lock buildroot
Mock Version: 1.1.32
INFO: Mock Version: 1.1.32
INFO: calling preinit hooks
INFO: enabled root cache
INFO: enabled yum cache
Start: cleaning yum metadata
Finish: cleaning yum metadata
INFO: enabled ccache
Start: device setup
Finish: device setup
Start: yum update
Start: Outputting list of available packages
Finish: Outputting list of available packages
Finish: yum update
Start: creating cache
Finish: creating cache
Finish: lock buildroot
Finish: chroot init
INFO: Installed packages:
Start: build phase for grep-2.9-1.fc18.src.rpm
Start: device setup
Finish: device setup
Start: build setup for grep-2.9-1.fc18.src.rpm
Finish: build setup for grep-2.9-1.fc18.src.rpm
Start: rpmbuild -bb grep-2.9-1.fc18.src.rpm
Start: Outputting list of installed packages
Finish: Outputting list of installed packages
Finish: rpmbuild -bb grep-2.9-1.fc18.src.rpm
Finish: build phase for grep-2.9-1.fc18.src.rpm
INFO: Done(grep-2.9-1.fc18.src.rpm) Config(fedora-18-i386) 4 minutes 3 seconds
INFO: Results and/or logs in: /var/lib/mock/fedora-18-i386/result
Finish: run



Took me about 4 minutes 3 seconds as can be seen from the output above.

Then I ran mock to build the other package less
  • mock -r fedora-18-i386 less-451-1.fc18.src.rpm
INFO: mock.py version 1.1.32 starting...
Start: init plugins
INFO: selinux enabled
Finish: init plugins
Start: run
INFO: Start(less-451-1.fc18.src.rpm)  Config(fedora-18-i386)
Start: lock buildroot
Start: clean chroot
INFO: chroot (/var/lib/mock/fedora-18-i386) unlocked and deleted
Finish: clean chroot
Finish: lock buildroot
Start: chroot init
Start: lock buildroot
Mock Version: 1.1.32
INFO: Mock Version: 1.1.32
INFO: calling preinit hooks
INFO: enabled root cache
Start: unpacking root cache
Finish: unpacking root cache
INFO: enabled yum cache
Start: cleaning yum metadata
Finish: cleaning yum metadata
INFO: enabled ccache
Start: device setup
Finish: device setup
Start: yum update
Start: Outputting list of available packages
Finish: Outputting list of available packages
Finish: yum update
Finish: lock buildroot
Finish: chroot init
INFO: Installed packages:
Start: build phase for less-451-1.fc18.src.rpm
Start: device setup
Finish: device setup
Start: build setup for less-451-1.fc18.src.rpm
Finish: build setup for less-451-1.fc18.src.rpm
Start: rpmbuild -bb less-451-1.fc18.src.rpm
Start: Outputting list of installed packages
Finish: Outputting list of installed packages
ERROR: Exception(less-451-1.fc18.src.rpm) Config(fedora-18-i386) 0 minutes 25 seconds
INFO: Results and/or logs in: /var/lib/mock/fedora-18-i386/result
ERROR: Command failed. See logs for output.
 # ['bash', '--login', '-c', 'rpmbuild -bb --target i686 --nodeps builddir/build/SPECS/less.spec']


About time something had to go wrong. Let me check the result and modify my specs.

Did some research and found this article, they were talking about re-installing ncurses? so I figured, maybe it needs ncurses-devel. I added "BuildRequires: ncurses-devel" and ran mock again. It build without any issues.


 [hitman@localhost SRPMS]$ mock -r fedora-18-i386 less-451-1.fc18.src.rpm
INFO: mock.py version 1.1.32 starting...
Start: init plugins
INFO: selinux enabled
Finish: init plugins
Start: run
INFO: Start(less-451-1.fc18.src.rpm)  Config(fedora-18-i386)
Start: lock buildroot
Start: clean chroot
INFO: chroot (/var/lib/mock/fedora-18-i386) unlocked and deleted
Finish: clean chroot
Finish: lock buildroot
Start: chroot init
Start: lock buildroot
Mock Version: 1.1.32
INFO: Mock Version: 1.1.32
INFO: calling preinit hooks
INFO: enabled root cache
Start: unpacking root cache
Finish: unpacking root cache
INFO: enabled yum cache
Start: cleaning yum metadata
Finish: cleaning yum metadata
INFO: enabled ccache
Start: device setup
Finish: device setup
Start: yum update
Start: Outputting list of available packages
Finish: Outputting list of available packages
Finish: yum update
Finish: lock buildroot
Finish: chroot init
INFO: Installed packages:
Start: build phase for less-451-1.fc18.src.rpm
Start: device setup
Finish: device setup
Start: build setup for less-451-1.fc18.src.rpm
Finish: build setup for less-451-1.fc18.src.rpm
Start: rpmbuild -bb less-451-1.fc18.src.rpm
Start: Outputting list of installed packages
Finish: Outputting list of installed packages
Finish: rpmbuild -bb less-451-1.fc18.src.rpm
Finish: build phase for less-451-1.fc18.src.rpm
INFO: Done(less-451-1.fc18.src.rpm) Config(fedora-18-i386) 0 minutes 30 seconds
INFO: Results and/or logs in: /var/lib/mock/fedora-18-i386/result
Finish: run

Just took about 30 seconds. That is pretty neat!
Here is a link to my changed spec file.
less.spec

I think Mock tool is amazing, one thing I liked about it is, you can build packages on different architectures using mock which is nice.

The whole lab took be about 45 minutes to complete.


Monday 11 November 2013

Installing Fedora Package Database


1.      Get the package database from
·         https://fedorahosted.org/releases/p/a/packagedb

2.      you will get a tarball, extract it using
·         tar -xvf fedora-packagedb-0.6.0

3.      Install the needed packages:
·         yum -y install python-genshi TurboGears python-turbojson postgresql-server \
        postgresql-contrib python-TurboMail python-bugzilla python-fedora \
        python-psycopg2 python-sqlalchemy python-feedparser koji mod_wsgi \
        python-paver httpd mod_ssl babel python-cpio xz python-argparse \
        python-mako python-memcached (you can probably copy paste this)

4.      go to fedora-packagedb-0.6.0
·         run: python setup.py egg_info (you will get a few warnings ignore them) NOTE:please do a yum update before doing this.
·         paver build --install-conf=`pwd` --install-data=`pwd` --install-sbin=`pwd`

5.      start the postgresql service if it is not already started by issuing
·         service postgresql initdb
·         start the service using "service postgresql start"

6.      Create postgresql users: 
sudo -u postgres createuser -SDRPE pkgdbadmin
        Enter password for new role: <password>
        Enter it again: <password>
          sudo -u postgres createuser -SDRPE pkgdbreadonly
        Enter password for new role: <password>
        Enter it again: <password>

Get the most recent dump from the same website you grabbed fedora package from. so go to https://fedorahosted.org/releases/p/a/packagedb and download the most recent ".dump.xz" file

then run this command to import it all to the database:

xzcat pkgdb-20100318.dump.xz | sudo -u postgres psql
NOTE: this can take a while, no, rather this will take a while - give it about 3-4 hours if you are running it on a virtual machine.

After this the instructions said to modify the HTTP server to run the python script, this is what I am having trouble with, it gives me a 403 error. and I am trying to get a hold of Raymond Chan as he is the guru when it comes to Linux System Administration. Once It is resolved I will update the blog, if anybody else have any solution please comment

#################UPDATE November 16th#################

I created an Account in Fedora and was going to ask my question, however, they suggested to ask package related questions in buzilla. I started answering questions there to the best of my ability

https://ask.fedoraproject.org/question/35812/fedora-19-etcresovconf-auto-renewed/?answer=35894#post-id-35894

I asked my question in the bugzilla but there is no package called "packagedb" there, they redirected me to ask either on git hub or email the persons responsible for the package.

https://bugzilla.redhat.com/show_bug.cgi?id=1030792


I asked on Github and I am going to send and email to a.badger@gmail.com
for the same question.

https://github.com/fedora-infra/packagedb/issues/13

#################UPDATE November 16th#################

abadger replied really quick. Check the updates on this page.
https://github.com/fedora-infra/packagedb/issues/13
###############################################################################################

paver build command gives me this. Not sure what to make of it, I will ask the package admin about this

paver build --install-conf=`pwd` --install-data=`pwd` --install-sbin=`pwd`
Traceback (most recent call last):
  File "/usr/bin/paver", line 9, in <module>
    load_entry_point('Paver==1.1.1', 'console_scripts', 'paver')()
  File "/usr/lib/python2.7/site-packages/paver/tasks.py", line 816, in main
    _launch_pavement(args)
  File "/usr/lib/python2.7/site-packages/paver/tasks.py", line 785, in _launch_pavement
    execfile(environment.pavement_file, mod.__dict__)
  File "pavement.py", line 16, in <module>
    from turbogears.finddata import find_package_data
  File "/usr/lib/python2.7/site-packages/turbogears/__init__.py", line 9, in <module>
    from turbogears.config import update_config
  File "/usr/lib/python2.7/site-packages/turbogears/config.py", line 4, in <module>
    pkg_resources.require("CherryPy<3.0")
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 690, in require
    needed = self.resolve(parse_requirements(requirements))
  File "/usr/lib/python2.7/site-packages/pkg_resources.py", line 592, in resolve
    raise VersionConflict(dist,req) # XXX put more info here
pkg_resources.VersionConflict: (CherryPy 3.2.2 (/usr/lib/python2.7/site-packages), Requirement.parse('CherryPy<3.0')

Monday 4 November 2013

Centos- Issue with mounting ntfs filesystems- (mount: unknown filesystem type ‘ntfs’)

Step1: su

Step2: wget http://packages.sw.be/rpmforge-release/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
Step3: rpm -Uhv rpmforge-release-0.3.6-1.el5.rf.i386.rpm

Step4: yum install fuse fuse-ntfs-3g dkms dkms-fuse

Step5: mkdir /mnt/usb

final step: mount -t ntfs-3g /dev/sdc1 /mnt/usb
 
 
Source:
http://rajivpandit.wordpress.com/2012/10/31/mount-ntfs-on-linux-centos/comment-page-1/#comment-2727

How to add "Discord" in Steam's Big Picture Mode

 With the release of Steam deck a lot of people are turning into Steam Deck Big Picture Mode(BPM) to enjoy an exclusive gaming experience, t...