Pet Packaging 100 & 101 & intro to 200

How to do things, solutions, recipes, tutorials
Message
Author
User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

Pet Packaging 100 & 101 & intro to 200

#1 Post by technosaurus »

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: Select all

./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: Select all

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: Select all

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: Select all

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)
#!/bin/bash
# download_sources
for file in $(cat sources) ; do
wget $file
done

Code: Select all

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: Select all

./configure --help
or for only package specific options

Code: Select all

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

Code: Select all

./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, 22:00, edited 3 times in total.

dawnsboy

#2 Post by dawnsboy »

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.

User avatar
jrb
Posts: 1536
Joined: Tue 11 Dec 2007, 19:56
Location: Smithers, BC, Canada

#3 Post by jrb »

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.

dawnsboy

#4 Post by dawnsboy »

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.

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#5 Post by technosaurus »

I added a section for making user friendly pet packages to include dependencies in your pets.

User avatar
Pizzasgood
Posts: 6183
Joined: Wed 04 May 2005, 20:28
Location: Knoxville, TN, USA

#6 Post by Pizzasgood »

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.
tar xzvf *.gz
Tar doesn't like extracting multiple packages. Something like this works though:

Code: Select all

for i in *.tar.gz; do tar xzvf "$i"; done

Stickied, by the way.
[size=75]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[/size]
[img]http://www.browserloadofcoolness.com/sig.png[/img]

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#7 Post by technosaurus »

@Pizzasgood - Thanks, updated in the original post
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
Evil20071
Posts: 489
Joined: Sat 07 Jun 2008, 19:50
Location: Piedmont, SC,.United States
Contact:

#8 Post by Evil20071 »

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.
[url=http://totalelectronics.us]TotalElectronics.us[/url]

adiemd
Posts: 2
Joined: Wed 17 Dec 2008, 19:24

adiemd

#9 Post by 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 :( javascript:emoticon(':(')

User avatar
Evil20071
Posts: 489
Joined: Sat 07 Jun 2008, 19:50
Location: Piedmont, SC,.United States
Contact:

#10 Post by Evil20071 »

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: Select all

# ./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.
[url=http://totalelectronics.us]TotalElectronics.us[/url]

adiemd
Posts: 2
Joined: Wed 17 Dec 2008, 19:24

#11 Post by adiemd »

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

User avatar
Pizzasgood
Posts: 6183
Joined: Wed 04 May 2005, 20:28
Location: Knoxville, TN, USA

#12 Post by Pizzasgood »

You get devx files from here:
ftp://ibiblio.org/pub/linux/distributio ... 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: Select all

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).
[size=75]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[/size]
[img]http://www.browserloadofcoolness.com/sig.png[/img]

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#13 Post by technosaurus »

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
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

User avatar
Aitch
Posts: 6518
Joined: Wed 04 Apr 2007, 15:57
Location: Chatham, Kent, UK

#14 Post by Aitch »

Wow, techno

Thanks, I read that thread.....

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

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: :D

Aitch :)

disciple
Posts: 6984
Joined: Sun 21 May 2006, 01:46
Location: Auckland, New Zealand

#15 Post by disciple »

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.
Do you know a good gtkdialog program? Please post a link here

Classic Puppy quotes

ROOT FOREVER
GTK2 FOREVER

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#16 Post by technosaurus »

To compile statically against dietlibc

Code: Select all

CC="diet gcc -nostdinc
Last edited by technosaurus on Sun 11 Jul 2010, 17:06, edited 1 time in total.
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

jikkypeter
Posts: 1
Joined: Fri 09 Oct 2009, 06:38

this is jikkypeter

#17 Post by jikkypeter »


User avatar
Aitch
Posts: 6518
Joined: Wed 04 Apr 2007, 15:57
Location: Chatham, Kent, UK

#18 Post by Aitch »

jikkypeter

What is the point of that??

Are you a google spammer? - they don't need you.... :lol:

Aitch :)

User avatar
technosaurus
Posts: 4853
Joined: Mon 19 May 2008, 01:24
Location: Blue Springs, MO
Contact:

#19 Post by technosaurus »

Here is a fairly simple way to compile other programs that makes them easily configurable as a RoxApp

run ./configure --help
you should see a list that includes --prefix= , --bindir= etc...
you will want to set all of these to /usr/local/apps/$MY_PROGRAM_NAME

here is an example:

Code: Select all

CFLAGS=" -pipe -Os " CXXFLAGS=" -pipe -Os " LDFLAGS=" -Wl,-O2,-s " \
./configure --prefix=/usr/local/apps/abiword --bindir=/usr/local/apps/abiword \
--sysconfdir=/usr/local/apps/abiword --localstatedir=/usr/local/apps/abiword \
--libdir=/usr/local/apps/abiword ....<--more-options>
make
new2dir make install
(Then in /usr/local/apps/$MY_PROGRAM_NAME make a symlink for AppRun to the main executable and a symlink for .DirIcon to any image)

I only recommend this for programs - not libraries
If you want to include additional libraries this way I would recommend first compiling the libraries with ./configure --enable-static --disable-shared before compiling your program (that way only the necessaryparts get included - sometimes only a couple of kb of a multi-MB library)
Check out my [url=https://github.com/technosaurus]github repositories[/url]. I may eventually get around to updating my [url=http://bashismal.blogspot.com]blogspot[/url].

phogi
Posts: 15
Joined: Fri 05 Mar 2010, 20:06

#20 Post by phogi »

I'm attempting to follow the directions in the first method. My goal is to implement a driver I found for my synaptics touchpad that is on my laptop. The issue is erratic pointer behavior, and random hangs. Makes it all quite difficult to use (so I just plugged in a usb mouse). But, this driver supposedly will take care of those problems.

I'm running puppy 4.3.1 on a Compaq presario V5000.

So, everything goes fine until I get to the command line step. I type in ./configure, it tells me something like 'no such file.'

I'm assuming that some dependency is not filled for the command line program to work, or the directions I'm following are for a model of command line usage which is no longer in effect.

So, what do I need to do to make it work?

Post Reply