| View previous topic :: View next topic |
| Author |
Message |
aldube Xandrosianschwing
Joined: 02 Jan 2005 Posts: 2332 Location: Calgary, Alberta, Canada
|
Posted: Mon Jan 30, 2006 9:58 am Post subject: (Tutorial)Newbie Guide for Building Applications from Source |
|
|
Part 1: Building Xandros DEB Applications from Debian Sarge Web Repository Sources:
First thing you're going need is tools if you're going to build anything; the same applies for Linux if your going to build Xandros applications using source code.
First of all you need to start Xandros Networks (an application that can be found on the Xandros desktop).
Secondly you need to install the following development tools (found in left side under New Applications & then Development):
| New Applications --> Development wrote: | C/C++ Development Tools
Debian Development Tools
KDE Development Tools
TCL/TK Development Tools |
Thirdly; while we're in Xandros Networks; we're going to add a source to XN; (top menu) Edit --> Set Application Sources ... --> Add (button); and copy & paste the following to the (Please enter source line:)
| Code: | | deb-src http://http.us.debian.org/debian sarge main contrib non-free |
Click on the buttons OK & OK and now XN will read & index the new sources.
Next thing we need to get familliar with is the Console application Launch --> System --> Console / Administrator Tools --> Console (Administrator); there are 2 versions; Console is the safer version you can play around with in your Home folder (Home Folder is the first thing you see when you start Xandros File Manager).
You can now start a Console session to try it out;
Will list off the contents of the folder
Will create a directory/folder (directory & folder are interchangable terms in Linux, but most Linux users (I know) prefer to use the term "folder").
Will change to the work folder
Will backup a folder.
Will shutdown the Console Session; of course clicking on the x button at top right corner will do the same thing (if you get lost during a Console session you can always start a new one Console session and start from your original position).
Ok; So now let's try something easy in the Console window; for the purpose of a small download we'll download & compile the application aget (a commandline download accelerator & manager for high speed internet users).
| Code: | # cd work
# apt-get source aget |
The command apt-get is how you download application packages & sources off the internet; source tells apt-get to download source code; | Code: | # ls
aget-0.4 aget_0.4-6.diff.gz aget_0.4-6.dsc aget_0.4.orig.tar.gz
# cd aget-0.4 |
As you can see from the ls command anything with a .diff.gz, .dsc, .tar.gz extentions are files and it's the aget-0.4 that's the new folder that apt-get source created.
| Code: | # su
enter root (Administrator) password
# dpkg-buildpackage -b -uc
# exit |
The command dpkg-buildpackage needs higher level root access to run, so we use the command su to swich to root user then use the command exit afterwards to end root access after the application has been compiled with dpkg-buildpackage.
| Code: | # cd ..
# ls
aget-0.4 aget_0.4-6.dsc aget_0.4-6_i386.deb
aget_0.4-6.diff.gz aget_0.4-6_i386.changes aget_0.4.orig.tar.gz
# su
enter root (Administrator) password
# dpkg -i aget
# exit
# mkdir newdebs
# mv aget_0.4-6_i386.deb newdebs
# aget
usage: aget [options] url
options:
-p port number
-l local file name
-n suggested number of threads
-f force using suggested number of threads
-h this screen
-v version info |
As you will see a new file has appeared in your work folder aget_0.4-6_i386.deb; dpkg is a command for installing & managing DEB package files; -i option tells dpkg to install the DEB package aget_0.4-6_i386.deb; the mv command will move your newly created aget DEB to the folder newdebs; the new command aget gives a breif summary on how to use it (all you really need to worry about is the url which is the internet address to the file you want to download starting with http:// and ending with the file you want to download.)
And this concluded part 1 of my tutorial.  _________________ Linux simply works for me...
Registered Linux User 384461
Last edited by aldube on Mon Jan 30, 2006 2:40 pm; edited 3 times in total |
|
| Back to top |
|
 |
aldube Xandrosianschwing
Joined: 02 Jan 2005 Posts: 2332 Location: Calgary, Alberta, Canada
|
Posted: Mon Jan 30, 2006 10:19 am Post subject: |
|
|
Part 2: Building Applications from Source Code Tarballs (.tar.gz & .tar.bz2):
There are 3 common techniques for compiling & installing applications from source code in Debian (which Xandros 3 is based on).
Technique #1;
| Code: | # ./configure
# make
# make install |
You will find this technique listed in every Linux forum and advertised on websites all over the Internet. This is probably the worst way to install an application and can potentially be more harmful than installing non-Xandros DEBs with no pinning on your Xandros OS and there's bascly no way to undo or remove the application after it's been installed, so all Windows converts & Xandros newbies stay away from this method.
Technique #2;
| Code: | # ./configure
# make
# checkinstall -D |
This method creates & installs a DEB on your Xandros OS and is safer to use than Technique #1; the downside of using this method is that most Windows converts & Xandros newbies don't know what dependencies to install or compile for the application and what dependencies to plug into the DEB's control file (even experienced Debian Linux users can have a hard time figuring this one out), so it would be adviseable that Windows converts & Xandros newbies steer clear of Technique #2 as well.
Technique #3;
| Code: | Copy the debian folder from the application's older version of the source code from a Xandros or Sarge repository and plug it into your newer source code folder; modify the debian subfolder; and then use the command:
# dpkg-buildpackage -b -uc
to create the DEB(s) for you. |
This method is a lot easier to create DEBs from scratch for Windows converts & Xandros newbies, as all or most of the dependencies are taken cared of for you, and if this method fails to compile the application then Techniques #1 & #2 wouldn't of worked any better anyways; sometimes applications require dependencies that Xandros doesn't have, but we'll save those details & techniques for a more advanced application compilling lesson.
There are more techniques; however, those techniques are more complicated & for more experienced Debian Linux users.
This part of the tutorial will focus on Technique #3; the application we're going to build is clamav.
Start a Console session:
| Code: | # cd work
# aget -n 1 http://superb.dl.sourceforge.net/sourceforge/clamav/clamav-0.88.tar.gz
# ls
clamav-0.88.tar.gz newdebs
# tar -xvzf clamav-0.88.tar.gz
# ls
clamav-0.88 clamav-0.88.tar.gz newdebs |
As you can see It wasn't a waste compilling aget as I can incorparate it into my tutorial without having to switch to firefox; -n 1 is for downloading 1 thread (number of simultaneous downloads), as some website administrators don't like it when you download using more than 1 thread, so we'll be kind to this one. tar is an archive utility like winzip; if you were extracting a .tar.bz2 file then you would use the flags -xvjf instead of -xvzf; if you wan't to learn more about this tool then simply use the command tar --help in the console window. As you can see a new folder called clamav-0.88 has been created.
| Code: | # apt-get source clamav
# ls
clamav-0.84 clamav_0.84.orig.tar.gz newdebs
clamav_0.84-2.sarge.5.diff.gz clamav-0.88
clamav_0.84-2.sarge.5.dsc clamav-0.88.tar.gz |
As you can see a second folder has been created clamav-0.84.
Ok; now we're going to start Xandros File Manager from the Launch menu:
| Quote: | Left click into the work folder.
Left click into the clamav-0.84 folder.
Right click on the debian folder --> copy
Left click on the top left Go back one page button.
Left click into the clamav-0.88 folder.
Right click where there's no icons --> paste
Left click into the debian folder.
And if you see a patches folder; then right click on patches --> delete
Right click on changelog open with --> text editor
and change the top line:
clamav (0.84-2.sarge.5) stable-security; urgency=low
to
clamav (0.88-1) stable-security; urgency=low
File --> Save; File --> Quit
Right click on changelog~ --> delete |
There's no patches folder to delete in this particular example, but other application sources may have this folder, so keep an eye out for it when using this method of compilling applications. Notice that after you saved changelog, a new file changelog~ was created; changelog~ is a copy of the old changelog file before saving.
Now; from your work folder; execute the following commands and you will get the following error:
| Quote: | # cd clamav-0.88
# su
enter root (Administrator) password
# dpkg-buildpackage -b -uc
dpkg-buildpackage: source package is clamav
dpkg-buildpackage: source version is 0.88-1
dpkg-buildpackage: source maintainer is Stephen Gran <sgran@debian.org>
dpkg-buildpackage: host architecture is i386
dpkg-checkbuilddeps: Unmet build dependencies: libbz2-dev libmilter-dev libgmp3-dev libwrap0-dev libcurl3-dev
dpkg-buildpackage: Build dependencies/conflicts unsatisfied; aborting.
dpkg-buildpackage: (Use -d flag to override.)
Build command 'cd clamav-0.88 && dpkg-buildpackage -b -uc' failed.
E: Child process failed |
Take notice in the line(s) that say:
| Quote: | | dpkg-checkbuilddeps: Unmet build dependencies: libbz2-dev libmilter-dev libgmp3-dev libwrap0-dev libcurl3-dev |
and do the following commands:
| Code: | # apt-get install libbz2-dev libmilter-dev libgmp3-dev libwrap0-dev libcurl3-dev
# dpkg-buildpackage -b -uc
# exit
# cd ..
# ls
clamav-0.84 clamav-daemon_0.88-1_i386.deb
clamav_0.84-2.sarge.5.diff.gz clamav-docs_0.88-1_all.deb
clamav_0.84-2.sarge.5.dsc clamav-freshclam_0.88-1_i386.deb
clamav_0.84.orig.tar.gz clamav-milter_0.88-1_i386.deb
clamav-0.88 clamav-testfiles_0.88-1_all.deb
clamav_0.88-1_i386.changes libclamav1_0.88-1_i386.deb
clamav_0.88-1_i386.deb libclamav-dev_0.88-1_i386.deb
clamav-0.88.tar.gz newdebs
clamav-base_0.88-1_all.deb
|
And now you have 9 brand new clamav-0.88-1 DEBs in your work folder all configured and ready to install on any Xandros 3 system.
The following command should install all the clamav DEBs on your system:
| Code: | # su
enter root (Administrator) password
# dpkg -i *
# exit |
To install these DEBs on another Xandros 3 system; all you need todo is copy all these DEBs into a folder on that system and execute the following commands:
| Code: | # su
enter root (Administrator) password
# dpkg -i *
# apt-get -f install
# exit |
Well; that's all I'm going todo for now.  _________________ Linux simply works for me...
Registered Linux User 384461 |
|
| Back to top |
|
 |
mike80808 Xanscended

Joined: 14 Apr 2003 Posts: 3891 Location: St. Louis, MO
|
Posted: Sun Feb 05, 2006 11:55 pm Post subject: |
|
|
If you build a new DEB package that isn't already in the repositories, I suggest you contact me and arrange to get your DEB into the ArchLUG repository.
It will save the next person having to build it as well. And you've already built it, so you're not out anything by giving it away. _________________ Thanks for all the fishes, Xandros. |
|
| Back to top |
|
 |
woodsmoke Xanalandingdonger
Joined: 30 Jul 2005 Posts: 4970 Location: United States
|
Posted: Mon Feb 06, 2006 12:36 am Post subject: |
|
|
welll,
I'm gonna expose my ignernce......
what about my "idea" about a "gradebook" package....I've always used a "spreadsheet" but the "grading" packages are really just "fancified" spreadsheets.....
So.....I could....kinda make a fancy front end for the spreadsheet and "package" it?
and maybe a "pictorial" seating chart?
Maybe "tweak" Kopete to make an online thing for assignments?
so there could be a "teacher's editon"?
This is all just dinkin....there are a lot more serious folks who have some serious work to do....but....as I progress....that is the one thing that has always come back to me...
ain't xandros great!
woodsmoke _________________ If the eco-ists would only shut up, I wonder if the sound of their droning would be replaced by the sound of normal people fitting solar panels and making soup from nettles and twigs.(J Clarkson) |
|
| Back to top |
|
 |
aldube Xandrosianschwing
Joined: 02 Jan 2005 Posts: 2332 Location: Calgary, Alberta, Canada
|
Posted: Mon Feb 06, 2006 11:39 am Post subject: |
|
|
| woodsmoke wrote: | | So.....I could....kinda make a fancy front end for the spreadsheet and "package" it? |
If you know some programming languages; I suppose you could create source code from scratch or modify already existing source code then package it.
Keep in mind this thread was created as a starting point for building existing source code applications only; I won't be coverring how to modify source code itself todo other things. Anything more than what's listed in this thread is probably too complicated todo for newbies.  _________________ Linux simply works for me...
Registered Linux User 384461 |
|
| Back to top |
|
 |
akbillj Xplorer
Joined: 17 Mar 2006 Posts: 23 Location: Fairbanks, AK
|
Posted: Sun Mar 19, 2006 8:17 pm Post subject: first try at aget |
|
|
when I ran "dpkg -i aget" I was presented with following message:
billj@XAN2GFTYO0:~/work$ su
Password:
XAN2GFTYO0:/home/billj/work# dpkg -i aget
dpkg: error processing aget (--install):
cannot access archive: No such file or directory
Errors were encountered while processing:
aget
XAN2GFTYO0:/home/billj/work#
So I am not doing well in my first attempts to follow your instructions! Thanks for the tutorials though, I will overcome. Thank you all for your help. _________________ The little people make the big people big.
 |
|
| Back to top |
|
 |
mike80808 Xanscended

Joined: 14 Apr 2003 Posts: 3891 Location: St. Louis, MO
|
Posted: Mon Mar 20, 2006 4:05 pm Post subject: |
|
|
"dpkg -i" only installs a deb file you already have, and in your case would look in the current directory. I guess it did not find it.
"apt-get install" locates the appropriate repository, resolves the dependencies and then installs them.
Use the "-d" option if you want just to download the deb package. _________________ Thanks for all the fishes, Xandros. |
|
| Back to top |
|
 |
geekydude Xandrosianschwing
Joined: 29 May 2005 Posts: 2513 Location: Portland, OR
|
Posted: Thu Jul 13, 2006 11:35 pm Post subject: |
|
|
How do I build packages like Mplayer skins or the Mplayer essential codecs?
I'm not sure how these can be made into packages.
How does it know where to put packages that do not come from Debian source?
Thanks! _________________ geekydude
registered Linux user number 410045.
The source will be with you...always.... |
|
| Back to top |
|
 |
woodsmoke Xanalandingdonger
Joined: 30 Jul 2005 Posts: 4970 Location: United States
|
Posted: Fri Jul 14, 2006 12:30 am Post subject: |
|
|
geekydude.....
I don't know how they do them here....but you may or may not remember a player that was on Lycos....Sonique.....
There literally were "templates" for that one... "picture thingys" where you put your "picture" that became what you saw as the skin....
I tried but never did figure that out.... but that was a Windoze thing....
but hey...it may be that there is a "template"..... that you color your own way....and then use a "command" to "get" or whatever the picture is and "place" it in the code.... kind of like the old bitmapping in basic....boy THAT is a long time ago...
you're a braver person than ME..... good luck, I'm looking forward to your first effort!
ain't Xandros GREAt!
woodsmoke _________________ If the eco-ists would only shut up, I wonder if the sound of their droning would be replaced by the sound of normal people fitting solar panels and making soup from nettles and twigs.(J Clarkson) |
|
| Back to top |
|
 |
aldube Xandrosianschwing
Joined: 02 Jan 2005 Posts: 2332 Location: Calgary, Alberta, Canada
|
Posted: Fri Jul 14, 2006 8:57 am Post subject: |
|
|
| geekydude wrote: | How do I build packages like Mplayer skins or the Mplayer essential codecs?
I'm not sure how these can be made into packages.
How does it know where to put packages that do not come from Debian source?  |
I believe the codecs have to be included at build time when compiling Mplayer, as for the skins "I don't know" because I've never bothered with skins of any kind.
I remember a fully featured Mplayer (all codecs) being uncompilable for Xandros 3.0.2 due to dependencies that couldn't be resolved.
If you've got time to kill, you may want to try installing those tough to compile applications into a Ubuntu dapper layer like what I've done in Xandros 4 http://forums.xandros.com/viewtopic.php?t=25028.  _________________ Linux simply works for me...
Registered Linux User 384461 |
|
| Back to top |
|
 |
bryantrv Xandrosianschwing
Joined: 24 Mar 2005 Posts: 2898 Location: DeLand, Florida US
|
Posted: Fri Jul 14, 2006 9:51 am Post subject: |
|
|
Great tutorial!
I'll add that when I have to install something from a tar file that uses the ./configure make make install method, I use an application called checkinstall- which is, I believe, available in the unsupported repository.
With checkinstall, you do
./configure
make
su (password)
checkinstall
it then grinds around for a bit and asks questions about the package.
Checkinstall then makes a .deb file and install that, rather than simply installing it directly. The reason I like that is that it makes it easier to remove, and I *think* it pays attention to the pinning settings. _________________ --
Chris Bryant
http://www.kindofpeckish.com
http://opensourcemachine.org
http://bryantrv.com
http://rx4rv.com |
|
| Back to top |
|
 |
aldube Xandrosianschwing
Joined: 02 Jan 2005 Posts: 2332 Location: Calgary, Alberta, Canada
|
Posted: Fri Jul 14, 2006 10:35 am Post subject: |
|
|
The checkinstall method works fine so long as you can identify all the dependencies for the application in question; for the simpler applications it's quite easy todo.  _________________ Linux simply works for me...
Registered Linux User 384461 |
|
| Back to top |
|
 |
geekydude Xandrosianschwing
Joined: 29 May 2005 Posts: 2513 Location: Portland, OR
|
Posted: Fri Jul 14, 2006 4:11 pm Post subject: |
|
|
| aldube wrote: | | geekydude wrote: | How do I build packages like Mplayer skins or the Mplayer essential codecs?
I'm not sure how these can be made into packages.
How does it know where to put packages that do not come from Debian source?  |
I believe the codecs have to be included at build time... |
The codecs are supplied separately in the repositories, so I was attempting to figure out how they did it.
Does anyone know where I may look for such info?
Edit: Yes, I've been googling, but haven't found anything yet. _________________ geekydude
registered Linux user number 410045.
The source will be with you...always.... |
|
| Back to top |
|
 |
Arne Anka Xanspiration

Joined: 21 Mar 2004 Posts: 4186 Location: Stockholm, Sweden
|
Posted: Fri Jul 14, 2006 5:50 pm Post subject: |
|
|
This is a simple way to do it:
1. Download an older win32codecs package (lets call it win32codecs_1.0.0-1_i386.deb).
2. Extract DEB content, dpkg-deb -x win32codecs_1.0.0-1_i386.deb win32codecs_1.0.0-1_i386
3. Extract DEB package property files, dpkg-deb -e win32codecs_1.0.0-1_i386.deb win32codecs_1.0.0-1_i386/DEBIAN
4. Replace the content of win32codecs_1.0.0-1_i386/usr/lib/win32 with your own codecs.
5. cd win32codecs_1.0.0-1_i386
6. Update md5sum property file, find usr -exec md5sum {} \; 2> /dev/null > DEBIAN/md5sum
7. cd ..
8. Recreate the package, dpkg-deb -b win32codecs_1.0.0-1_i386 win32codecs_1.0.0-1_i386.deb
There is a bit more to it if you intend to spread it to others to avoid confusion and conflicts. But for private use the above should do.
More info abot the structure of DEB packages can be found here ("Debian GNU/Linux FAQ" and "Developers' manuals" contains all you need to know)
http://www.debian.org/doc/ |
|
| Back to top |
|
 |
geekydude Xandrosianschwing
Joined: 29 May 2005 Posts: 2513 Location: Portland, OR
|
Posted: Fri Jul 14, 2006 6:50 pm Post subject: |
|
|
| Arne Anka wrote: | This is a simple way to do it:
1. Download an older win32codecs package (lets call it win32codecs_1.0.0-1_i386.deb).
2. Extract DEB content, dpkg-deb -x win32codecs_1.0.0-1_i386.deb win32codecs_1.0.0-1_i386
3. Extract DEB package property files, dpkg-deb -e win32codecs_1.0.0-1_i386.deb win32codecs_1.0.0-1_i386/DEBIAN
4. Replace the content of win32codecs_1.0.0-1_i386/usr/lib/win32 with your own codecs.
5. cd win32codecs_1.0.0-1_i386
6. Update md5sum property file, find usr -exec md5sum {} \; 2> /dev/null > DEBIAN/md5sum
7. cd ..
8. Recreate the package, dpkg-deb -b win32codecs_1.0.0-1_i386 win32codecs_1.0.0-1_i386.deb
There is a bit more to it if you intend to spread it to others to avoid confusion and conflicts. But for private use the above should do.
More info abot the structure of DEB packages can be found here ("Debian GNU/Linux FAQ" and "Developers' manuals" contains all you need to know)
http://www.debian.org/doc/ |
Thanks, I'll give it a shot...
This is my first attempt at creating debs, so I'll let you know how it turns out!  _________________ geekydude
registered Linux user number 410045.
The source will be with you...always.... |
|
| Back to top |
|
 |
|