Tuesday, November 19, 2013

Raspberrypi-vc Packaging 0.1 (2nd entry)

Building the package in the arm machine.

I got my Pi up and running and downloaded the spec file I used for my Pi. The BuildArch was set to armv6hl but everything is still the same. The build was successful and wrote 2 rpms. The build time was relatively slow compared to PC, of course, but it was successful.

I tried installing the rpm using $rpm -i raspberrypi-vc-debuginfo-0.1-5.rpm and got no output. No output means good output, usually in Linux. As I have told. 
For the next entry and my 0.1 release, I will finish my spec file properly and try out adding a %build section and the %install section. Also, will try to send for review.

Next entry goals (0.1 3rd entry):
  • Updated (clean) spec file.
  • Try to put something in %build and %install section.
  • Investigate the %install section from src rpm spec file.
  • 0.1 Release

Monday, November 18, 2013

Raspberrypi-vc Packaging 0.1 (1st entry)

The project I chose is packaging the raspberrypi-vc package to build from source. Here are the links necessary regarding the information about this project (includes project planning).

I started by obtaining the source rpm. The spec file was long and very complicated to understand to my level. In reviewing the specfile, I noticed a bunch of subpackages that are also being built along the process. This files are libraries and development tools. Here's how it is laid out:


each %package tag  will build a sub package. Each subpackage needed a directory containing the files necessary for the building process:



each %file needs the name of the subpackage that will be built.

The goal of the project is to make an rpm which was built from. I created a new spec file just like I did in the labs. I did it with the simplest form and with no macros just to test it out if it could work. *Note, I am using my pc to build the rpm (raspberrypi-vc is intented for arm architectures).



I copied the tags from the src specfile but I manually input the source. Just for testing purposes.
After doing $rpmbuild -ba, I got an error : make: *** No targets specified and no makefile found.  Stop.
error: Bad exit status from /var/tmp/rpm-tmp.jDPPf5 (%build)
It means that there are no files that the command $make could identify in the %build section (make %{?_smp_mflags}). In the original spec file, the commands for %build section was not present. Thus I removed the make and the spec file was built successfully without errors.

 Wrote: /home/jfgiagonia/rpmbuild/RPMS/x86_64/raspberrypi-vc-debuginfo-0.1-5.rpfr19.x86_64.rpm

The build from source was successful but with everything strip down. The % build and %install section was empty and there are no changelogs. The next step is try to build it on Pi.

Sources:

SBR600 Project Page -> Look for 'Change Raspberrypi-package...'










Friday, November 8, 2013

Python Lab


Scripting is my very least skill in computers. I found bash to be very difficult to learn but I have somewhat knowledge about it. Comparing to python, I would say this is easier and faster to learn. Although, this is still a challenge for me.

I looked at some of the blog posts to help me understand the 'guess' script and I found amartinenco's script to be the most understandable. So I tried to modifying my script and trying it on my own and this is what I came up:

#!/usr/bin/python
#
# Modify this script to be a number-guessing
# game.
# 1. The secret number should be random (1-100)
# 2. Input should be handled if it's not numeric
# 3. The user should be asked to guess until they
#    get the right number.
# 4. When the user guesses the right number, the
#    number of guesses should be printed
#
# Bonus: Make the script give up if the number hasn't
#        been guessed in 15 tries.

# imports sys program to script
import sys
# imports random program to the sript
import random
secret=random.randint(1,100)



game_finished = 0
count = 1
print "Guess the number from 1-100. You have 15 tries"

while (game_finished == 0):
  try:
     guess=int(raw_input("Enter a guess: "))

     if guess < 1 or guess > 100:
        print "Must be in the (1-100) range"
     else:
        if guess < secret:
           count = count + 1
       print "Too low!"        
        elif guess > secret:
           count = count + 1
       print "Too high!"        
        else:
           print "Correct!"
           game_finished = 1
           print "It took you %i tries to guess the correct number" % (int(count))
     if count == 16:
       print "number of tries exceeded(15). exiting"
       sys.exit()
  except ValueError:
     print "The entered input is invalid"

The only difference from where the script I got from was the exit script when the tries have been exceeded. Python is easier and more exciting to learn compared to other scripts I have learned. As for the future, I would try to have an in depth look at this language as this would be a great skill for the future.

End.


Wednesday, November 6, 2013

SBR600 Project

Greetings!

I have checked the package, raspberrypi-vc package from the koji site and I am lost. This would be a challenge as i do not know which package I need to work on and how to start it. This post is a call for help if you may know what is the first thing I should do.

The objective of my project is to make the raspberrypi-vc package build from source. The expected result is a raspberrypi-vc package that will be built from source, and will be compatible with the current Pidora packaging.

Challenges:
1. Know the purpose of the package.
2. how to obtain the the package.