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 01 Aug 2014, 00:20
All times are UTC - 4
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Unsorted
Lobster Dotpup
Moderators: deshlab, Flash, GuestToo, Ian, JohnMurga, Lobster
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [13 Posts]  
Author Message
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15117
Location: Paradox Realm

PostPosted: Thu 07 Jul 2005, 13:35    Post subject:  Lobster Dotpup  

I am working on my first ever dot pup

You lucky pups!

- just because I know next to nothing about ash and bash - pah! - that will not stop me . . .

I have got the md5 check sum working and a text info thing - I have got it installing but have to be sure it is correctly placed (I have also created the make pup script) on GuestToos excellent create your own dot pup
but am having difficulties copying the file to the right place and unzipping it

so this line would be copied from the download
directory (but how do I say download from present directory - if I do)
Code:
cp AutoZen-1.3.1.tar.gz /root/my-applications/bin


this seems to work Ok once the file is in place . . .

Code:
tar -xzvf /root/my-applications/bin/AutoZen-1.3.1.tar.gz


here is most of the code I have been playing with


Code:
#!/bin/sh

cp AutoZen-1.3.1.tar.gz /root/my-applications/bin
# cd /
# cd /root/my-applications/bin
tar -xzvf /root/my-applications/bin/AutoZen-1.3.1.tar.gz
# gunzip /root/my-applications/bin/AutoZen-1.3.1.tar.gz
# /root/my-applications/bin/AutoZen-1.3.1/autozen
# rm AutoZen-1.3.1.tar.gz
# echo '/usr/local/bin/torsmo' > /root/.packages/torsmo-1.0.files
# echo '/usr/local/lib/X11/mini-icons/torsmo.xpm' >> /root/.packages/torsmo-1.0.files


these last two lines are not right at all BUT they are to do with registering as a Pupget which ideally I would like to do . . .

Code:
# echo '/usr/local/bin/torsmo' > /root/.packages/torsmo-1.0.files
# echo '/usr/local/lib/X11/mini-icons/torsmo.xpm' >> /root/.packages/torsmo-1.0.files


I have never used cp to copy files or mv to move them (I will probably use mv) so I am kinda of

Shocked

any help welcome Smile

_________________
Puppy WIKI
Back to top
View user's profile Send private message Visit poster's website 
GuestToo
Puppy Master

Joined: 04 May 2005
Posts: 4078

PostPosted: Thu 07 Jul 2005, 16:22    Post subject:  

i used tar to save my files with absolute paths (just 1 line in make-tar)

that way i can unzip all the files to the correct places, with just 1 line in dotpup.sh
tar -xzP --no-same-owner -f dotpup.tar.gz

so if you edit make-tar, and edit it so it saves the files you want in your dotpup ... that's all you have to do

usually what i do is hold the ctrl key and click a file or folder to copy the path to the file to the clipboard ... then i middle-click in make-tar to paste the path to the file

for example, if you want these 2 files in your dotpup, you could copy/paste the paths to the files in make-tar like this:

rm -f dotpup.tar.gz
tar czvPf dotpup.tar.gz \
/usr/local/bin/torsmo \
/usr/local/lib/X11/mini-icons/torsmo.xpm

i split up the tar line but it could all be on 1 line
the P in tar czvPf is for absolute paths

when you click make-tar, it should zip all your files and folders to dotpup.tar.gz

in dotpup.sh, this line unzips dotpup.tar.gz to the same place you got the file from:
tar -xzP --no-same-owner -f dotpup.tar.gz
you don't have to change that line

so basically, your dotpup is 90% done

you might want to have a message of some sort popup, or maybe a readme file, or something

for example, if you included a file called /root/my-documents/torsmo-readme.txt, you can have it open with rox (it will do whatever it would do if you clicked the file in a rox window ... in my case it would open with leafpad ... if you have rox set to open text files with beaver, then it will open with beaver) ... like this:

tar -xzP --no-same-owner -f dotpup.tar.gz
rox /root/my-documents/torsmo-readme.txt

that's about it ... your dotpup is finished
make the dotpup by clicking make-pup
test the dotpup by clicking dotpup.pup
if it works ok, it's done

in short:
1) edit make-tar to include the files you want
2) edit dotpup.sh if you want to popup a message, and to do other stuff like make symlinks, edit config files, register with PupGet ...

i chose to have my dotpup handler unzip dotpups in a temporary dir in /root called DotPupTmpDir (i could have chosen /tmp, or the dir the dotpup was in, for example)

basically anything that's in the dotpup (which is just an ordinary zip file) will be in /root/DotPupTmpDir

for example, if you edit make-pup to add a file called readme.txt to the dotpup, then readme.txt will be in /root/DotPupTmpDir, and you could display it by adding this line to dotpup.sh:
rox readme.txt
(you could specify leafpad or beaver or mp or abiword instead of rox ... but will beaver be installed?)

everything in DotPupTmpDir will be deleted automatically when the dotpup finishes, so you may need a sleep 10 instruction to be sure your readme.txt file is there long enough for a text editor to find it ... something like this:

rox readme.txt
sleep 10

anyway, in your case, i think all you have to do is
1) edit make-tar to include the files you want
2) edit dotpup.sh to popup a message, if you like
3) edit dotpup.sh to register with PupGet
4) click make-tar
5) click make-pup

or, even shorter:
after you edit make-tar, 90% of making the dotpup is done

or you can do it using cp, mv, and tar with relative paths ... the advantage in doing it that way, is you can put files in different places, for example, the user's home dir if the user isn't root
Back to top
View user's profile Send private message 
GuestToo
Puppy Master

Joined: 04 May 2005
Posts: 4078

PostPosted: Thu 07 Jul 2005, 16:33    Post subject:  

loooking at your script, you don't need to gunzip your tar.gz file ... tar -xzvf already does that

later, when you rm the tar.gz file, it won't find it, because it won't be there ... it will have been gunzipped to AutoZen-1.3.1.tar (which will not get deleted)

if you do it the way i did it in my template (using tar with absolute paths) you can do it all with 1 line (and that line is already setup for you in my dotpup.sh template)

in other words, 1 line in make-tar to tar-gz all your files and folders ... 1 line in dotpup.sh to un-tar-gz all your files and folders
Back to top
View user's profile Send private message 
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15117
Location: Paradox Realm

PostPosted: Thu 07 Jul 2005, 22:27    Post subject:  

Thanks G2 for the explanation
Smile

which I have tried to incorporate
(--no-same-owner - did not quite understand that but seems to do something)

This is the code in my
"autozen.sh"

Code:
#!/bin/sh

cp AutoZen-1.3.1.tar.gz /root/my-applications/bin
tar -xzP --no-same-owner -f /root/my-applications/bin/AutoZen-1.3.1.tar.gz

xmessage -center "Autozen is a brain synching device
http://www.linuxlabs.com/software/AutoZen.html


This is the code in my
"make-pup"

Code:
#!/bin/sh
md5sum autozen.sh > md5sum.txt
rm -f autozen.pup
zip -9 autozen.pup dotpup.sh md5sum.txt
zip -9 autozen.pup dotpup.sh AutoZen-1.3.1.tar.gz


If I run autozen.sh from the command line
I get the creation of an Autozen-1.3.1 directory from which
the prog can be accessed
but clicking on the file from ROX does not work
I seem to be making progress

but am still confused
any help appreciated

_________________
Puppy WIKI
Back to top
View user's profile Send private message Visit poster's website 
dvw86


Joined: 04 May 2005
Posts: 636
Location: Washington State

PostPosted: Fri 08 Jul 2005, 01:02    Post subject:  

If you zip it with the file paths then you will not have to use the cp (copy) command when you unzip it.

Something like this to make the tar file.
Code:

#!/bin/sh
rm -f AutoZen-1.3.1.tar.gz
tar czvPf AutoZen-1.3.1.tar.gz \
/root/my-applications/bin/AutoZen-1.3.1


Something like this to make the dotpup.
Code:

#!/bin/sh
md5sum dotpup.sh AutoZen-1.3.1.tar.gz > md5sum.txt
rm -f autozen.pup
zip -9 autozen.pup dotpup.sh AutoZen-1.3.1.tar.gz md5sum.txt


Something like this for the dotpup.sh
Code:

#!/bin/sh
tar -xzP --no-same-owner -f AutoZen-1.3.1.tar.gz
xmessage -center "Autozen is a brain synching device
http://www.linuxlabs.com/software/AutoZen.html


You may have to play with these a little to get them to work but this is where I would start.
Back to top
View user's profile Send private message 
GuestToo
Puppy Master

Joined: 04 May 2005
Posts: 4078

PostPosted: Fri 08 Jul 2005, 03:08    Post subject:  

there are many ways of making a dotpup work
my template is about as simple as you can get

my template:
http://www.murga.org/~puppy/viewtopic.php?p=2509#2509

basically, you zip all the files you want into a tar.gz file ... later, when the dotpup runs, it unzips the files that are in the tar.gz file

pretty simple

you can write you own scripts ... or you can use my template

to use my template, all you do is download the template dotpup and install it ... it should put the dotpup creator template in /root/tmp/gtkfind

what you do is edit the file make-tar and put in the files you want in the dotpup

and that's it ... your dotpup is 99% done

you do not add files or rename files to the gtkfind folder ... you do not make your own tar file (make-tar already does it for you, automatically)

for example, suppose you create a file called lobster.txt, and put it in /root

suppose you want to make a dotpup that will install your lobster.txt file on other people's computers

you edit the make-tar file ... so it will look something like this:

rm -f dotpup.tar.gz
tar czvPf dotpup.tar.gz \
/root/lobster.txt

(the tar line could all be on one line, if you like)

if you click make-tar, it makes a tar.gz file called dotpup.tar.gz with all your files in it (in this case, it will have lobster.txt in it)

dotpup.sh already will unzip all your files that are in dotpup.tar.gz automatically and put them all where they belong ... so your dotpup is 99% done

if you want your dotpup to display lobster.txt in leafpad or beaver when the dotpup is clicked, you can add an instruction to do that ... add the instruction rox /root/lobster.txt to dotpup.sh, so dotpup.sh will look something like this:

tar -xzP --no-same-owner -f dotpup.tar.gz
rox /root/lobster.txt

now, when dotpup.sh runs (it runs automatically when the dotpup is clicked), it will:
1) unzip dotpup.tar.gz which has all your files in it
2) it will open lobster.txt in leafpad or beaver

the P option for tar unzips the files using absolute paths ... so all your files will be put exactly where they were originally

the --no-same-owner option makes the user who unzips the files the owner of the files, rather than the user who originally made them

you do not want to rename any of the files in the template folder ... you would have to go through all the scripts and change the file names in each one

so all you have to do:
1) edit make-tar and tell it what files you want in the dotpup
2) edit dotpup.sh and tell it to display lobster.txt

that's it ... that's all you have to do
click make-tar ... then click make-pup ... and you have a file called dotpup.pup ... when your dotpup is working ok, you can rename it

you do not have to rename any files in the template dir
you do not have to add any files to the template dir
you do not have to make any zip files or tar.gz files or cp any files or mv any file or tar any files or unzip any files or untar any files ... it's all done for you automatically

all you have to do is tell make-tar what files you want to put in the dotpup
and tell dotpup.sh if you want to display a message or register with PupGet, or anything like that

or you can write your own scripts that do pretty much the same thing ... but it's already all done for you, you really don't have to

i haven't tried the visual dotpup maker yet
Back to top
View user's profile Send private message 
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15117
Location: Paradox Realm

PostPosted: Fri 08 Jul 2005, 05:10    Post subject:  

Cool

Thanks - appreciate the time and effort you both took to create these answers.
Again I have simplified the files . . .

Embarassed
I need some basic knowledge . . .

1. If I run file autozen.sh from the command line
like so

Code:
./autozen.sh


it works (creates a directory with all the files in it)

However if I click on ./autozen.sh in ROX
nothing happens.
So I feel I know how to set permission and Set Run Action

but perhaps not?

I can not really go on to "make-pup" UNTIL the autozen.sh is working
and it has to work from ROX . . .

Hope you will not lose patience with me Smile

_________________
Puppy WIKI
Back to top
View user's profile Send private message Visit poster's website 
Bruce B


Joined: 18 May 2005
Posts: 11080
Location: The Peoples Republic of California

PostPosted: Fri 08 Jul 2005, 15:22    Post subject:  

Lobster, my feeling is for your first dotpup, you should try and do it exactly according to GuestToo's dotpup template. (I think you have the template.)

If you have questions about the template they (your questions) will be easy to clarify.

Leave out the registering portion, because that is advanced techniques and not a part of the template.

Consider the first dotpup as practice, I'll test the dotpup when you get it ready.
Back to top
View user's profile Send private message 
Bruce B


Joined: 18 May 2005
Posts: 11080
Location: The Peoples Republic of California

PostPosted: Fri 08 Jul 2005, 15:30    Post subject:  

Lobster wrote:

Embarassed
I need some basic knowledge . . .


Good reading on Linux concepts by Barry K

May I recommend a beginners bash tutorial?

.

Last edited by Bruce B on Fri 08 Jul 2005, 15:40; edited 1 time in total
Back to top
View user's profile Send private message 
GuestToo
Puppy Master

Joined: 04 May 2005
Posts: 4078

PostPosted: Fri 08 Jul 2005, 15:34    Post subject:  

a script called abc.sh will behave differently from a script called abc

(i found this out the hard way)

for example, if you make a script called abc:

#!/bin/sh
xmessage -center "`pwd`"

right click it and make it executable, if you need to, and right click it and Copy to abc.sh

if you click either script it will popup a window showing your working directory

when you click abc ... it says your working dir is the dir that abc is in

when you click abc.sh ... it says that your working dir is /root, your $HOME dir

the reason it's doing this is that abc is an executable file ... a dot sh file is being run from a rox Run Action

a workaround would be the same technique that roxapps use ... put these lines at the top of the script:

APPDIR=`dirname "$0"`
cd "$APPDIR"
APPDIR="`pwd`"

this will cd to the dir abc.sh is actually in, and set APPDIR to the absolute path of the dir
Back to top
View user's profile Send private message 
rarsa


Joined: 29 May 2005
Posts: 3053
Location: Kitchener, Ontario, Canada

PostPosted: Fri 08 Jul 2005, 16:54    Post subject:  

Actually for scripting I found this tutorial to be quite good.

It does not cover the scripting language 100% but it's a good start.

And I cannot resist but share that I was talking the other day to Steve Bourne! In person, waiting to to get some drinks at a conference we both attended.

I may even get smarter by osmossis.
Back to top
View user's profile Send private message Visit poster's website 
Lobster
Official Crustacean


Joined: 04 May 2005
Posts: 15117
Location: Paradox Realm

PostPosted: Fri 08 Jul 2005, 21:02    Post subject: Step back to step forward  

Quote:


May I recommend a beginners bash tutorial?

.


Thanks guys Smile

That seems good

I decided to have a go at dot pup because it seems easy and straight forward.

Rolling Eyes

Somehow during this I have managed to make dotpups uninstallable . . .
Originally I had tried the visual dot pup maker from xanatos
but the scripts and templates seemed to be simpler (the visual dot pup maker is still under development I hope)

Things that seemed clear are beginning to seem complex . . .
Problems that an experienced basher would not blink at have caused me difficulties.
I am gonna digest some of this info. Take a step back and try again soon.

I appreciate everyones efforts thus far.

Smile

_________________
Puppy WIKI
Back to top
View user's profile Send private message Visit poster's website 
Flash
Official Dog Handler


Joined: 04 May 2005
Posts: 10954
Location: Arizona USA

PostPosted: Fri 08 Jul 2005, 21:32    Post subject:  

Thanks, rarsa and Lobster for those links. I've put them in the Beginners index, under Programming
Back to top
View user's profile Send private message 
Display posts from previous:   Sort by:   
Page 1 of 1 [13 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Advanced Topics » Additional Software (PETs, n' stuff) » Unsorted
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.1040s ][ Queries: 12 (0.0037s) ][ GZIP on ]