Quick And Dirty .dsl PackagesForum: Other Help Topics Topic: Quick And Dirty .dsl Packages started by: tecker Posted by tecker on June 24 2004,19:24
At the request of another member I will tell how I make my .dsl packages. I will be using the example of the xchat dsl that i made. This is how I made that package. IF YOU JUST WANT THE BASICS SEE THE SECOND POST >> First decide what you want. Somebody wanted a xchat package so I decided to make that. 1) Enable Apt-Get. It is under App -> Tools -> Enable Apt. Let that run and now dpkg and Apt-get will work. 2) Now if you want to play it safe and use "woody" packages then you can skip this step. If you want newer and closser to the the current packages you will need to change the apt sources. A) Open Xterminal and then type
B) type
C) remove the # from the line 1 & 3 and add one to line 2 D) save the file and close scite 3) At the terminal type
4) Now after that type
That "-d" tells the computer to download the packages and NOT to install the packages. 5) create a directory in your home directory (/home/damnsmall for most) based on the program to be installed (/home/damnsmall/xchat in this example) 6) In the terminal type
The first <prog> is the name of the package. The * wildcard will take care of that complex verson number. The second ./<prg> argument is the folder that contains the program. abreviate the name just so you can keep the extrated programs seperate (will explain later). 10) Now using midnight commander navigate into the created folder. you will probably see there is a 'usr' and mabye some others. These folder(s) are the same as the linux root tree. 'usr' = /usr 'usr/lib" = /usr/lib. get the picture? Find the program and locate the program executable (probably in the 'usr/bin' directory) and highlight and hit enter to run it from MC. 11) look at the error message. I might say something like
This means that the program needs this file and we need to find it. Look in the .deb package for something like "libABcd123-1.2.5-16.deb" that is similar to the package missing. If you cant find it open up glinks-h and surf to your favorite search engine (www.google.com/linux might be a good bet) and look for the file missing. that might give you some insight in to the package it is included in. Once you found it repeat steps 7 - 11 with each error that pops up. However!, copy the dependecy into the real file system folder (if the extracts creates 'usr'/lib' copy the file to the /usr/lib directory. '/usr/lib' is your best be on where to put the needed files. 12) If you are reading this after doing 7 - 11 about 15 times and have got a working program, congratulation! your program is almost ready to go. If you are reading this thinking "No way. Not going to all of that work!" Can't help there. If you are to this point and nothing works . Put a post in the myDSL forums and someone may have an answer. (most likely you will need to copy everything out of the dependencies except the documentation {wasted space, imho.] like there is an 'etc' foler in the extract you will need to copy those contents to the /etc folder) 13) Now on to packaging the program >>> Posted by tecker on June 24 2004,19:24
Creating the actual DSL fileOk now that you have figured out the files needed and the program is running (or you skiped the first post) You can now create a .dsl package. 1) In the home directory (/home/damnsmall for expample) create a folder by the name of your package and add dsl at the end (eg. "xchatdsl") 2) Copy all of the program contents from the extracted folders into the new one. For example in the new folder 'prgdsl/usr/lib' copy all of the files from the program and dependencies from each of the '<extract>/usr/lib' into this folder. Do the same for the remaining (<extract>/etc/... & <ext>/usr/bin/... & <ext>/usr/share/... ) to ther respective programs (<pkgdsl>/etc/... & <pkgdsl>/usr/bin/... & <pkg>/usr/share/...). Does this make sense yet? 3) Once all of the program and dependencies are in that folder you are ready to package. 4) Navigate into the <pkgdsl> folder in a terminal. 5) run
6) you should see something to the effect of
7) if you see that then you are ready to add the final touches. 8) If you want to launch the program from the myDSL menu when you right click then you will need to create a menu file. A) in the <pkgdsl> directory run:
b) you now should have scite with a blank slate ready to go. c) the syntax of the menu file is a follows:
d) save the file and exit. You will now be able to run from the menu. 9) Once that is made we are ready to pack. 10) to create the dsl make sure there are no other files but the folders (etc, usr, bin, var, root, you wont have all of the these but folders should be the only thing there.) no '.deb', no '.tar.gz', no files. 11) execute
12) you now should have a DSL package ready to go on a live boot. Go and test it out. Posted by tecker on June 24 2004,19:54
Creating Desktop Icons for you DSL packagesOk so you have a dsl package that works but you want a freaking desktop icon so i looks better. SIMPLE! Rigt? Sorta. You will need to repack the dsl (well, yea) but the trick can be the location. All packages that have desktop icons seem to have an empty /home/damnsmall directory. Actualy there is a hidden '.xtdesktop' folder that most time will not show up. Here is the easy method. Go to the folder where you packed the dsl (or extract your dsl, its just a renamed tar.gz) and round up an icon. 1) Create the folder
2) Create the lnk file:
3) In the file put the following
4) Edit the file to suit your needs. The X & Y cordinates are the pixels from the uper left corner the icon will be offset. Match the name of your icon to the one you will copy in. 5) save the file and exit. 6) Now copy in an icon that is either a: .png, .gif, .jpg, or .xpm (correct me if i am wrong here) 7) make sure you have everything and you are ready to go. 8) repack the dsl (watch for stray files. only folders unless the file is needed) At next boot there should be an icon ready for use on the desktop after enhancing the desktop. Creating Menu Items in a Submenu Some people find that their program can do many different things other then just one function. Rather then create multiple entries in the menu you can organize them into a sub menu. to do this just change the syntax of the menu file. Please note the following is a ficticious program.
Hope this will make some packages better. And remember that when all else fails, look at some other package. Posted by clivesay on June 24 2004,21:03
Thank you so much for taking the time to do this! Chris Posted by clivesay on June 24 2004,23:51
I have a problem that might be very basic. I think I followed the tutorial to the "T". When I try to create the dsl file ig "tar: Cowardly refusing to create an empty archive. I am running the command from the /home/damnsmall/xtet42dsl directory. Is this the wrong place? ThanksBTW - I am creating a file for xtet42 (tetris) it is very small and doesn't have dependencies. I thought this would be a good program to start with. Chris Posted by tecker on June 25 2004,00:25
ok i know that error. What you did was not specify what goes in the tar file. You did it in the right place but didn't tell tar what to add in. Did you put the wild card "*" after the name?It should look like this: "tar cvfz xtet42.dsl *" << that is the astrisk (shift+8 after the dsl filename or instead of the * you could put "./usr ./etc (rest of the folders names)" Posted by clivesay on June 25 2004,00:44
Your right. I forgot the *. I will try again. Thanks for the response!
Posted by clivesay on June 25 2004,01:46
Well, I successfully created a mydsl file. It was a simple one but, hey, you gotta start somewhere!! I do have one glitch with the menu. When I boot up, EVERYTHING is in the MyDSL menu!! Any idea why? I created the /var/tmp/mydsl.menu directory. I looked at aceofpenguins and noticed that the tmp directory was not in /var so I moved it out to see if that would make a difference but I get the same result. Any ideas? I am soooo close!! Thanks Chris Posted by hasty on June 25 2004,05:58
Great icons here< http://www.gentoo.org/dyn/icons.xml > Thanks for the run through tecker. I'll have a play at the w/e. Posted by tecker on June 25 2004,16:01
What exactly is in there. All of the files? OK let me clear this up. in the place you are going to pack from you should have one of the following for a menu: /var/tmp/mydsl.menu/ -or- /tmp/mydsl.menu/ then you should have a file in there that will create the menu setting. For example: /var/tmp/mydsl.menu/tecker in that file tecker (your name will be different, and use the name of the package) should be the following syntax
Let me break it down. The first part tell the menu item to execute a program. The second part '(Tecker)' is the name of the program that will appear in the menu. "myDSL -> Tecker" in this example. The third part '{teckprg}' is what to be executed. This could be just what you would type at the command prompt or the entire path '{/usr/bin/teckprg}' As to why all of your files appear in the menu. Is there anything in there other then the menu file. If not i do not know what to tell you. Good Luck. If you want it to be a sub menu take a look at the new section on that in the second post. Posted by clivesay on June 25 2004,17:30
Thanks, teckerI understand the menu concept. When I create the .dsl file I end up with /usr and /var. The first time, I added /tmp/mydsl.menu to the existing /var and created my menu in Scite and saved as "xtet42" in the mydsl.menu folder. When I booted up, ALL menu items showed up under MyDSL. My menu entry of "Tetris" was in the menu and did execute the program. I looked at the ace of penguins .dsl and saw that there was just a tmp directory with the menu so I untarred my .dsl file and moved the /tmp/mydsl.menu directory to the "root" along with /usr and /var and repackaged. I booted up again and had the same result I described previously. Maybe I need to unpack it again and look around. Maybe when I was trying to create the archive earlier without success a strange file was created or something. I am having a ball learning how to do this so the problems don't phase me. The mydsl extensions are making this beginner feel like he is really doing something BIG! If anyone has any additional ideas, I would appreciate it! Thanks Chris Posted by ke4nt1 on June 25 2004,18:16
There are some changes to be made when creating amenu addition to the mydsl menu.. See here... < http://damnsmalllinux.org/cgi-bin....3;st=50 > and also 3-4 posts down the list from this first one... Notably, making the /tmp directory "world read/write/executable." by using chmod 777 tmp before you tar your stuff,and be sure that while 'root.root' owns the '/tmp' dir, both the 'mydsl.menu' dir, and the file within it are owned by damnsmall.staff by using chown -R damnsmall.staff mydsl-menu/ ...run this command from WITHIN your '/tmp' dir... I always put '/tmp/mydsl.menu' off of '/' . I never place it under '/var' .. It's usually best to put the FULL PATH in your menu file for ex: '[exec] (axyFTP) {/usr/bin/axyftp}' Case is important...... Even though I build my .dsl files under /home/damnsmall, make sure your work directory and your work within it is created while you are logged in your term or emelfm as root. Hope it helps.. Mydsl-menus usually behave after these things are checked and fixed. 73 ke4nt Posted by clivesay on June 26 2004,01:37
Your fix to the menu appears to be what I was missing. Everything installed flawlessly this time!!!Thanks to both of you VERY much! In DSL style, I did go in and remove the documents. This is just a simple X Tetris game but I will send it to John to post in the repository. Someone might get use from it. Thanks, again. Chris Posted by ke4nt1 on June 26 2004,01:47
Count me in..I look forward to seeing it in the repository... Good work! 73 ke4nt Posted by clivesay on July 06 2004,02:38
Quick question for anyone who can help me. On the last three .dsl files I have tried to create I always get an error for a library file even though it is included.For example, I am creating a .dsl for tuxpaint. I have all the files copied over and try to run the executable in /usr/bin. I get an error ./tuxpaint: error while loading shared libraries: libSDL-1.2.so.0: cannot open shared object file: No such file or directory When I look for libSDL-1.2.so.0 I find it in the /usr/lib directory. BTW - I am trying to run the executable from within emelfm Any ideas? Like I said I have had this same occurance on three different .dsl compilations. Thanks Chris Posted by clivesay on July 06 2004,02:58
Here is what I did to help me when I had a lot of deb packages to sort through. This was my first jump into bash scripting!!BTW - if anyone has a shorter routine than Tecker's please feel free to share!! Remember I am a complete beginner to scripting. There might be an easier way! I will use tuxpaint as an example. After I do an "apt-get -d install tuxpaint" to collect all the debs, I cd to /var/cache/apt/archive to see all the files. Within the directory I type "ls -1 > paint". This created a "paint" text file that has a list of all the files in the /archive directory. I open the "paint" file with scite and remove any entries that are not .debs related to tuxpaint. I then type "dpkg --extract " in front of the first entry and then copy and paste that command in front of each deb file. Then after the name of the first deb file I type " ./paint". I copy that entry and then paste it after each deb. After I have pasted, I go back and put a 1,2,3,4, etc after each of the " ./paint" lines. Then I run "chmod a+x paint". Now I have an executable script that will extract all of the deb files and create the individual folders for each one. The file will look like: #!/bin/bash dpkg --extract bc_1.06-15_i386.deb ./paint1 dpkg --extract libnetpbm10_2%3a10.0-3_i386.deb ./paint2 dpkg --extract libsdl-image1.2_1.2.3-2_i386.deb ./paint3 dpkg --extract libsdl-mixer1.2_1.2.5-5_i386.deb ./paint4 dpkg --extract libsdl-ttf2.0-0_2.0.6-5_i386.deb ./paint5 dpkg --extract libsdl1.2debian-oss_1.2.7-7_i386.deb ./paint6 dpkg --extract libsdl1.2debian_1.2.7-7_i386.deb ./paint7 dpkg --extract libsmpeg0_0.4.5+cvs20030824-1_i386.deb ./paint8 dpkg --extract netpbm_2%3a10.0-3_i386.deb ./paint9 dpkg --extract ttf-freefont_20031008-1_all.deb ./paint10 dpkg --extract tuxpaint-data_1%3a0.9.13-2_all.deb ./paint11 dpkg --extract tuxpaint-stamps-default_2003.12.23-1_all.deb ./paint12 dpkg --extract tuxpaint_1%3a0.9.13-2_i386.deb ./paint13 It seems like alot of steps but is really pretty simple to throw together. I think it is easier than extracting each deb manually. I actually ran all of my commands from the root command line in emelfm. HTH someone. Chris Posted by tecker on July 06 2004,15:26
On the libSDL problem i would look at where the lib was in the package. I guessing ti was in something like /usr/X11R6/lib or similar. Check this as it may cause problems. As to The script: WHY didn't i think of that?! Hey good luck on the package.
Posted by clivesay on July 06 2004,17:22
tecker -The lib file I am talking about wasn't in the traditional lib directory as I remember. I copied it straight over from the same directory that was in the deb file. Am I better off to just install the package and then search for the lib file to see where it was actually placed? Thanks Chris Posted by clivesay on July 06 2004,19:20
Tecker - I did an install of Tuxpaint and the lib in question is in the /usr/lib directory just as it appears in the .deb. I am wondering if the error is valid. I think I may just compile the darn thing and create the .dsl and see what happens. Has anyone else had this issue where a file is shown missing when you run the executable file but everything works ok once you get everything packaged in the .dsl? If I can get tuxpaint figured out, I might make the big leap to gcompris! These are great games for kids pc's! Thanks Chris Posted by clivesay on July 06 2004,23:43
I have a working .dsl. When I did an actual install there were alot more deb files in the archive. Everything appears to work!!Chris Posted by clivesay on July 07 2004,18:31
Will using the "chown -R damnsmall.staff mydsl-menu/" cause issues if "damnsmall" is removed from the distro or if you have multiple /home/user accounts? Just curious.....Chris Posted by ke4nt1 on July 07 2004,19:29
If the user doesn't exist, then the mydsl.menu files may not createa new menu entry. I assume there will be an inert mydsl.menu directory orphaned in your /tmp . There have been no reports of any problems so far. It is possible that corruption can occur in your menus or desktop icons when proper permissions and ownerships are not followed. Since the mydsl-menu concept only truly applies to a LiveCD install, the idea of installing a .dsl extension to a multi-user HDinstall hasn't been tackled yet. Usually, a HDInstall works thru apt-get install, rather than a .dsl, although many folks report good success with using them that way, either thru untarring them from root, or using the mydsl functions in 0.7.1 Of course, once installed, dsl's are permanent in the HDinstall. A user could simply apt-get install the application, and manually add an icon and link to their username's .xtdesktop directory. Or, copy the same stuff from the damnsmall/.xtdesktop directory to a new users .xtdesktop directory after installing the .dsl roberts can provide you with more data on the actions of mydsl-menu in HDinstalls. myDSL is his creation. 73 ke4nt Posted by clivesay on July 07 2004,21:00
I ask the question because I know an effort is under way to remove the word "damn" from the cd itself. I don't want us to get locked into using "damnsmall" in script commands and such if "damnsmall" doesn't exist in future releases.Chris Posted by ke4nt1 on July 07 2004,23:54
My understanding is that there will be a symlink from damnsmall.This would allow current builds to operate properly. 73 ke4nt |