Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Fri 18 Apr 2014, 17:32
All times are UTC - 4
 Forum index » House Training » HOWTO ( Solutions )
Pet Packaging 100 & 101 & intro to 200
Moderators: Flash, Ian, JohnMurga
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 3 [38 Posts]   Goto page: 1, 2, 3 Next
Author Message
technosaurus


Joined: 18 May 2008
Posts: 4134

PostPosted: Thu 13 Nov 2008, 02:14    Post subject:  Pet Packaging 100 & 101 & intro to 200
Subject description: how to make good pet packages from beginner to intermediate
 

Prerequisite - A working installation of Puppy Linux with the appropriate devxXXX.sfs loaded/installed
General pet Packaging 100 - suitable for alpha testing - minimal command line
0. Find your source package (I recommend getting sources from http://packages.debian.org/source/etch/ ... use the one ending in orig.tar.gz)
1. Download the package to ../anydirectory/package-name.tar.gz
2. Open it in ROX and extract all to ../anydirectory/package-name
3. Click on the directory you just extracted to open it
4. Right click select -->menu-->terminal here
--------- <--This begins the command line part - don't worry its easy
5. build the package using default configuration
Code:
./configure
make
new2dir make install

(this script will walk you through almost everything including menu entry and icons if you get errors you probably just need a dependency or you've got an instance of RTFM)

General .pet Packaging 101 (a little more command line a lot less bloat)
0. Find your source package (I recommend getting sources from http://packages.debian.org/source/etch/ ... use the one ending in orig.tar.gz)
1. From a terminal download the package:
2. Extract the package
3. Change to the directory you just extracted
4. configure the package
*read the readme.txt or equivalent in the package-name directory for any additional tags
5. make the package
6. create pets including DEV, DOC, NLS
In Step-3 of new2dir: choose option 3 to split out the pet into:
.pet (for all users)
DEV.pet (developer files)
DOC.pet (documentation)
NLS.pet (localizations)
Here is the code for steps 1-6.
Code:
wget http://www.someurl.com/distro/src/package_name.tar.gz
tar xzvf package-name.tar.gz
cd package-name
./configure --prefix=/usr --build=i486-t2-linux-gnu
make
new2dir make install


during this last step you have the option to build pet packages automatically - if you are wanting to strip down the package for size or add/remove anything you should skip the packaging and use the dir2pet script later but it could take some time and this is a good time to post a pet for beta testing, so I will assume that pet packages were made for the next part.

Now we can expand and verify the file structure of the .pet; expand inefficiently compressed files (so that puppy's sfs system can compress them more); strip the binaries and further strip it down manually before adding our extra files and repackaging
Code:
pet2tgz package-name.pet
tar xzfv package-name.tar.gz
cd package-name
find ./usr/man/ -type l -name "*.gz" | xargs -r gunzip -f
find ./usr/man/ ! -type l -name "*.gz" | xargs -r gunzip
find . | xargs file | grep ELF | cut -f 1 -d : | xargs strip --strip-unneeded


The rest is manual grokking such as removing unused or unneeded files or replacing them with smaller ones - this will vary from package to package
Finally we can add any extra files we feel are necessary. Examples are post install scripts, customizations or entire dependency .pets (in directory form) if they won't likely be used by any other .pets without this one
Code:
dir2pet package-name

click on the .pet in ROX to install it for testing
don't forget to install DEV.pet if it is a dependency for your next .pet and return to step 0. (It should be removed though before you remaster a puplet)

Multiple .pet Packaging 200 - now we want to do multiple packages
1. make a file called 'sources' containing the urls of all of your sources (this is especially useful if you have a lot of sources or if you want to stay up to date with the latest upstream source using a /latest/ or /current/ path in the url instead of a specific version)
2. now create an executable script called 'getsources' in the directory you want to download to (there is a template in /root/Choices/Templates)
Quote:
#!/bin/bash
# download_sources
for file in $(cat sources) ; do
wget $file
done
Code:
getsources
for i in *.tar.gz; do tar xzvf "$i"; done

5. this is where I would have to go back to the manual methods above or do some more research with grep to automatically do the rest of the steps and check dependencies similar to T2

One problem you may run across in these types of situations are programs with many dependencies and complex build options if what you learned in pet packaging 100 and 101 didn't work the first step would be:
Code:
./configure --help

or for only package specific options
Code:
./configure --help=short

or for "short" help of all included packages
Code:
./configure --help=recursive


Making user friendly packagesPrevent users from having to download all the dependencies,
Once you have finished doing "new2dir make install" for your package and its dependencies you will have a bunch of folders named:
...486...DEV...DOC...NLS
Copy the contents of each of the ...486 dependencies' folder to that of your main package's ...486 folder and then run dir2pet on it.
For bonus points do the same for ...DEV...DOC...NLS

Hopefully this gives you the solution to any problems you may have had, if not it's time to look in those text files that they included in the package for some strange reason... usually README or some such file or track down a developer page, wiki, tutorial, howto or if worse comes to worst sometimes a random gentoo forum discussion or bug report from back in march of 2006 that google randomly turns up

...will edit later to update with your comments since I am not 100% sure on all of my syntax - you can't escape the sin tax

Last edited by technosaurus on Tue 16 Dec 2008, 18:00; edited 3 times in total
Back to top
View user's profile Send private message 
dawnsboy


Joined: 03 Dec 2008
Posts: 248
Location: Indiana - Republic of New Canada

PostPosted: Sun 07 Dec 2008, 17:37    Post subject:  

Thank you very much for this tutorial on creating pet packages from source. I followed the instructions and accomplished the following:

Created a *.pet package
Installed the package with petget
Package registered with petget
Program operated flawlessly after installation

What I did not accomplish:

Place item in jwm menu

Petget claimed to have created a menu entry in the Fun category of the menu ( I made the appropriate entries when running the script). I restarted the window manager but no new menu entry. I rebooted the computer but no new menu entry. I ran "fixmenus" and restarted the window manager but no new menu entry. I located the *.desktop file for the newly installed package in /usr/share/applications and opened it with a text editor. All of the information is correct. The *.desktop file is displayed in ROX with the assigned icon. Clicking on that file launches the application. Even so I am unable to get a new menu entry for this application.

I am using Puppy 4.1.1. Can you tell me how to place an entry in the menu for this item that won't be removed anytime I run fixmenus? Thanks.
Back to top
View user's profile Send private message 
jrb


Joined: 11 Dec 2007
Posts: 1017
Location: Smithers, BC, Canada

PostPosted: Sun 07 Dec 2008, 18:35    Post subject:  

dawnsboy,
Open your .destop file and check the Categories=. Open another .desktop of an application which is in the same menu area you wish yours to go into. Make sure yours has the same category listed. While your there compare the other parts of your .desktop too. Make sure they are arranged the same way as the working .desktop.
Back to top
View user's profile Send private message 
dawnsboy


Joined: 03 Dec 2008
Posts: 248
Location: Indiana - Republic of New Canada

PostPosted: Sun 07 Dec 2008, 21:42    Post subject:  

Thanks! That did the trick. I had opened a *.desktop file to view the basic structure and compared it to the one created for the package I had just installed. Everything looked good. But after following up on your suggestion I discovered that "Fun" (which is a menu category) is not a category for *.desktop files. Apparently games, action games etc will do just fine though.
Back to top
View user's profile Send private message 
technosaurus


Joined: 18 May 2008
Posts: 4134

PostPosted: Sun 07 Dec 2008, 22:29    Post subject:  

I added a section for making user friendly pet packages to include dependencies in your pets.
Back to top
View user's profile Send private message 
Pizzasgood


Joined: 04 May 2005
Posts: 6270
Location: Knoxville, TN, USA

PostPosted: Mon 08 Dec 2008, 16:47    Post subject:  

Quote:
3. Double click on the directory you just extracted to open it
I think you just mean "Click" since Puppy is thankfully single-click by default.

Quote:
tar xzvf *.gz
Tar doesn't like extracting multiple packages. Something like this works though:
Code:
for i in *.tar.gz; do tar xzvf "$i"; done



Stickied, by the way.

_________________
Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib

Back to top
View user's profile Send private message Visit poster's website 
technosaurus


Joined: 18 May 2008
Posts: 4134

PostPosted: Mon 08 Dec 2008, 18:58    Post subject:  

@Pizzasgood - Thanks, updated in the original post
_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
Evil20071


Joined: 07 Jun 2008
Posts: 425
Location: Piedmont, SC,.United States

PostPosted: Thu 18 Dec 2008, 01:08    Post subject:  

Could you tell me where to get the appropriate devxXXX.sfs for 4.1.2 and what the heck to do with it? sfs files never have gotten along with me well. I don't know what to do with them.
_________________
Click for Detailed PC info

Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger 
ICQ Number 
adiemd

Joined: 17 Dec 2008
Posts: 2

PostPosted: Thu 18 Dec 2008, 10:57    Post subject:  adiemd  

hi javascript:emoticon(')
General .pet Packaging 101 (a little more command line a lot less bloat)
0. Find your source package (I recommend getting sources from http://packages.debian.org/source/etch/ ... use the one ending in orig.tar.gz)
1. From a terminal download the package:
2. Extract the package
3. Change to the directory you just extracted
4. configure the package
*read the readme.txt or equivalent in the package-name directory for any additional tags
5. make the package
6. create pets including DEV, DOC, NLS
In Step-3 of new2dir: choose option 3 to split out the pet into:
.pet (for all users)
DEV.pet (developer files)
DOC.pet (documentation)
NLS.pet (localizations)
Here is the code for steps 1-6.
Code:
wget http://www.someurl.com/distro/src/package_name.tar.gz
tar xzvf package-name.tar.gz
cd package-name
./configure --prefix=/usr --build=i486-t2-linux-gnu
make
new2dir make install
i've done all of this but its doesn't work at all
what should i do?
thank Sad javascript:emoticon('Sad')
Back to top
View user's profile Send private message 
Evil20071


Joined: 07 Jun 2008
Posts: 425
Location: Piedmont, SC,.United States

PostPosted: Thu 18 Dec 2008, 13:46    Post subject:  

What kinda error you getting? I just learned something that might need to be added:

Sit Heel Speak wrote:
Evil20071 wrote:
Ok. I got that same error but I have another issue. When I do the ./config portion, I get this:

Code:
# ./configure --disable-nls --prefix=/bash-3.2/
bash: ./configure: No such file or directory

I didn't notice it till I tried the second go around. What do I do here?
The --prefix= parameter can't take a partial path, it rather must specify full path, for example

--prefix=/mnt/hda1/newgnu/bash/bash-3.2/output

It is a good idea to get into the habit, early in your compiling career, of never specifying as output dir the same dir where the source resides (and you run ./configure from). Hence you would first issue

mkdir /mnt/hda1/newgnu/bash/bash-3.2/output

and if you screw up, delete the whole output subdir --in fact, delete the whole bash-3.2 folder, and re-unpack the tar.gz and re-make the output subdir, i.e. begin fresh right from the start.

HTH, SHS


From my thread about compiling GNU BASH.

_________________
Click for Detailed PC info

Back to top
View user's profile Send private message Visit poster's website AIM Address Yahoo Messenger MSN Messenger 
ICQ Number 
adiemd

Joined: 17 Dec 2008
Posts: 2

PostPosted: Fri 19 Dec 2008, 05:01    Post subject:  

ok it seem all in the folder i.e /sda3/....-i386.pet is empty and when i use dir2pet in the line #installwatch -o..........pkg.lst it come a message install watch........pkg.lst not found and when i install pet package form it it doesn't come or show in menu list such as multimedia...... ie gxine and the program it doesn't open how it is
Back to top
View user's profile Send private message 
Pizzasgood


Joined: 04 May 2005
Posts: 6270
Location: Knoxville, TN, USA

PostPosted: Fri 19 Dec 2008, 20:19    Post subject:  

You get devx files from here:
ftp://ibiblio.org/pub/linux/distributions/puppylinux/sfs_modules-4/

Install method depends on how you run Puppy. For anything but a full-hd install, you just download the file to /mnt/home/. Note: it must be in the root of the partition containing your pup_save.2fs file. Now you may need to run the boot manager (Menu->System->Boot Manager) and tell Puppy to load it on bootup, unless you have it set to just load anything ending in 412.sfs. Now reboot, and you should be good to go.



If it's a full-hd install, you download it wherever, then click it to mount it. Open a terminal inside and run cp -a * / to copy the contents into /. Then click it again to unmount it. Now you can delete it if you want.

You can also do the whole process from the commandline like this:
Code:
mount -o loop /path/to/devx_412.sfs /mnt/data
cp -a /mnt/data/* /
umount /mnt/data




@adiemd: make sure you're running the new2dir command from inside the source directory, and if you run the dir2pet command by hand, make sure you give it the correct directory (the one created by new2dir, which should contain the binaries, not the source).

_________________
Between depriving a man of one hour from his life and depriving him of his life there exists only a difference of degree. --Muad'Dib

Back to top
View user's profile Send private message Visit poster's website 
technosaurus


Joined: 18 May 2008
Posts: 4134

PostPosted: Tue 28 Apr 2009, 11:58    Post subject:  

Update - I have come up with a couple of bash scripts that will do (most of) this for you (turns a source package into a sfs, 486-pet, DEV-pet, NLS-pet & DOC-pet .... where applicable)

http://www.murga-linux.com/puppy/viewtopic.php?t=41758

still in development, but it will already do many basic packages

_________________
Web Programming - Pet Packaging 100 & 101
Back to top
View user's profile Send private message 
Aitch


Joined: 04 Apr 2007
Posts: 6825
Location: Chatham, Kent, UK

PostPosted: Wed 22 Jul 2009, 20:16    Post subject:  

Wow, techno

Thanks, I read that thread.....

You almost make me feel like stepping out of the flying saucer and walking across the pacific Laughing Laughing

It almost has me wanting to try something, but this is just WAY over my head....

Where can I read something that may give me a clue what your wonderful work can help me do?

I like both ttuuxxx's 214xx & big_bass's slaxer_pup.......but the great beyond beckons and I find it scary......help! Wink Very Happy

Aitch Smile
Back to top
View user's profile Send private message 
disciple

Joined: 20 May 2006
Posts: 6378
Location: Auckland, New Zealand

PostPosted: Fri 31 Jul 2009, 21:58    Post subject:  

One major problem with dir2pet is that it doesn't seem to catch symlinks most (all?) of the time. This particularly means that if you compile a library e.g. libsomething.so.0.6.0, you'll need to add the symlink libsomething.so.0 (or is it libsomething.so, or perhaps both ?) to the package, otherwise if someone tries to compile against it they'll get an error "-lsomething not found", and probably not have a clue how to fix it.
_________________
DEATH TO SPREADSHEETS
- - -
Classic Puppy quotes
- - -
Beware the demented serfers!
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 3 [38 Posts]   Goto page: 1, 2, 3 Next
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » House Training » HOWTO ( Solutions )
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0960s ][ Queries: 13 (0.0059s) ][ GZIP on ]