HowTo: Organize the Poems Project into a Distributable Package on CD
Novell Cool Solutions: Feature
Digg This -
Posted: 10 Dec 2004
|Learning to use Linux at Home and Work
Welcome to my ongoing series of HowTo articles designed to help Linux newbies get comfortable with Linux. Before trying any of these HowTos, take a few minutes to study the prerequisites so you can hit the ground running.
This HowTo shows organize the Poems Project into a distributable package on CD. This is the final HowTo in the Poems project. See the previous article for how to add a random wave file sound to play while the animation is being displayed.
When you have completed this exercise you will know how to:
- Use a text editor
- Add program icons to your desktop
- Start applications
- Write and save shell and RunRev scripts
- Indent shell scripts for ease of understanding where controls start and finish
- Make script comments to understand and reuse knowledge
- Use the Linux documentation system
- Use the RunRev documentation system
- Change to executable mode of shell scripts
- Make new folders/directories
- Structure your HOME directory folders into a sensible arrangement
- Modify your program search path to include your HOME directory
- Create shell variable holders to save values
- Check variable values and perform actions with if then else controls
- Put the result of a program into a variable holder
- Return values to calling scripts
- Pick random files from a known list
- Run shell scripts from RunRev
- Design windowing interfaces, with fields and buttons
- Attach events and actions to fields and buttons
- Ask the user to input some data or information
- Create poems and display them on demand in a shell terminal and a GUI window
- Use the Gimp to manipulate images
- Create animated gif files and display them in a GUI window
- Add new programs to your computer
- Use Audacity to manipulate sounds
- Create sound files and play them on demand through a sound card and speakers
- Use Runtime Revolution to develop windowing interfaces
- Combine all of these skills into a sophisticated application that others can use
- Compile a RunRev development into an executable program.
- Organize your shell scripts, lists, images, sounds, and RunRev program into a package directory
- Zip the directory contents
- Make a CD image
- Burn it onto a CD
- Copy the package from the CD onto another computer for use
- Add program icons to your desktop
Pretty amazing list of achievements when you see it like this. You can be pretty pleased with yourself and your employers should be impressed. The next article set in this series is going to explore something serious that can be used in the real world.
When we organized the folders for the Poem project, they were all directly under our HOME directory. Thus sounds were in $HOME/sounds. But if we want to distribute the program, we should use either a sub directory in the HOME folder or a system wide structure for the program parts and a HOME sub folder. (I keep on interchanging the words folder and directory as they mean exactly the same thing).
Each option entails some work in renaming inside our scripts. The first is easier as we just add the path name /poems after $HOME ie in RunRev ($HOME & "/poems/bin/randani.sh"). The second is probably more correct if we are making an application for general distribution, which we are not.
- First create a poems folder.
- $ mkdir $HOME/poems
- Then all the sub folders
- $ cd $HOME/poems
- $ mkdir bin sounds images images/anims
Notice something new in the last mkdir: We just listed all the folders we wanted to make, and each one was made in its turn in the line.
Now copy all the poem files into the poems sub folder tree. It should end up looking like this. (Except "tom" should be your login name.)
The shell command to make this list is
$ ls -R $HOME/poems
Now open up the poems.rev file in RunRev and change all the references to $HOME to $HOME/poems. Save the file and make a new distribution with the file name poems.
Next use your text editor to edit all the files in the $HOME/poems/bin folder and make the same changes.
Test the RunRev application to make sure you didn't miss any changes. If any missed in RunRev, redo the distribution file.
Move the distribution file to the $HOME/poems/bin folder.
Use the shell command
$ zip -r $HOME/poems $HOME/poems
This will recursively zip up the poems directory and put it into a file poems.zip
Now we make the CD. I prefer Xcdroast, but the SUSE Linux distribution I'm using has K3b, so I'll use this for the demonstration. Although you can make/burn a CD on the fly, some CD burners don't like it, so I will use the safer strategy of making an image first, then burning the image onto the CD. With a saved image you can burn lots of CDs.
When you start K3b you get this window.
I'm using an old, but robust, HP CD-Writer on my USB port, which I'm testing out for a needy person in the digital divide.
K3b needs to know the fastest writing speed which is 4x for this device.
Next you'll get a hints screen which you can read or close.
There are several different ways to choose what you want to burn. The easiest way is to click the poems.zip file and hold down the left button while dragging the mouse to the lower window pane.
You will see the file name appear in the left lower window pane, and the file size under the right hand pane.
Right clicking on the file name in the lower pane will bring up a menu of choices that you can perform.
Of course we are going to click on burn.
Click the box for "Only create image". Enter /home/YOURHOME/poems.iso where it says "Write image file to:"
Replace the word YOURHOME with your login name.
Click the Volume Description tab and enter the name "poems project".
Next you can click the Burn button at the top left.
This informative window will tell you how your burn is progressing. When it has completed successfully, click the close button.
Now we are going to burn the CD.
First right click on the poems.zip name in the lower window pane and click on Remove.
Then drag the name poems.iso from the upper panel to the lower.
Right click this file and click on Burn.
Because I'm using an older burner. I select Track At Once (TAO) Writing mode, which is safer that Disk At Once.
You can read all about these options in the help.
I don't know what will happen when you click the burn button. It may not work because your user may not have permission to open the burn device. I had that problem as shown.
I finished the session as my user and logged in as the root user. Started K3b, selected the file from my HOME folder and continued with the burn.
Since root owns everything, this worked OK as in the next picture.
The CD was ejected after it was written. You can copy the zip file to another user and unzip it in their HOME folder.
Make sure all the ownerships and permissions are correct.
Creating a desktop icon to the poems executable will allow the new user to use your new program.
You have reached the end of the Poems project.
For more information about Runtime Revolution visit http://www.novell.com/coolsolutions/feature/1863.html
Novell Cool Solutions (corporate web communities) are produced by WebWise Solutions. www.webwiseone.com