I need help packaging an app for the various puppies[SOLVED]

Talk about and post software packages known to work or packaged for Puppy.
Post Reply
Message
Author
jafadmin
Posts: 1249
Joined: Thu 19 Mar 2009, 15:10

I need help packaging an app for the various puppies[SOLVED]

#1 Post by jafadmin »

I have managed to create a basic .pet that works with the puppies that use .pets, but I'm having trouble setting the "OpenWith" and the file association from the .pet install file.

Is there a recommended script to run as a helper?

Also, I am having very little luck getting an install pkg made for FD64. I can get it to install the app and paths, but no menu entries, and none of the aforementioned tasks. :?

Any help would be greatly appreciated.
Last edited by jafadmin on Wed 05 Feb 2020, 04:02, edited 1 time in total.

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#2 Post by musher0 »

Hi jafadmin.

It's not that complicated, but one needs to remain really focused.

1) OpenWith stuff
All the "OpenWith" entries for ROX are located at
/root/.config/rox.sourceforge.net/OpenWith

Since you did not mention the type of app or the file-type, the best suggestion I have is:
open a couple of the sub-dirs there and study them a bit.
E.g. for ogg files, look inside the
/root/.config/rox.sourceforge.net/OpenWith/.application_ogg
and
/root/.config/rox.sourceforge.net/OpenWith/.audio_x-vorbis+ogg

-------------------
2) MIME types
There is a limited MIME-type directory at
/root/.config/rox.sourceforge.net/MIME-types
for file-types: pdf, png, gnumeric, etc.
It's made up of bash scripts and you can edit them.

but the main one is at
/usr/share/mime/

This one has sub-divisions for apps, inodes, packages, etc.,
E.g. /usr/share/mime/app[/usr/share/mime/application

They are xml files created automatically.
It is suggested that the user not edit them.


-------------
As you probably already know, you'll have to mirror the above dirs / sub-dirs
in the dir you have for preparing your pet archive, before you type dir2pet blabla.

Best I can come up with, I'm afraid.

For more help, maybe try to get a hold of don570, he's a whiz with OpenWith stuff
in ROX.

IHTH
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

User avatar
Mike Walsh
Posts: 6351
Joined: Sat 28 Jun 2014, 12:42
Location: King's Lynn, UK.

#3 Post by Mike Walsh »

@ jafa:-

Just to add to what musher0 has already stated, don't forget that you can set any app to open either with an entire 'class' of mime-type, or just a specific, individual one.....though I confess, this is one aspect of packaging that doesn't always receive my fullest attention!

For help with FD64 stuff, I'd drop jamesbond a PM; he's quite amenable to offering assistance with his creation. Certain aspects of FatDog are a bit 'off-the-wall' anyway, so best to get advice straight from the horse's mouth, as it were....after all, much of it has been built with totally original, 'one-off' scripting, etc. Things don't always work in FatDog in quite the way you'd expect 'em to..!


Mike. :wink:

jafadmin
Posts: 1249
Joined: Thu 19 Mar 2009, 15:10

#4 Post by jafadmin »

@musher0,
musher0 wrote: Since you did not mention the type of app or the file-type, the best suggestion I have is:
open a couple of the sub-dirs there and study them a bit.
E.g. for ogg files, look inside the
/root/.config/rox.sourceforge.net/OpenWith/.application_ogg
and
/root/.config/rox.sourceforge.net/OpenWith/.audio_x-vorbis+ogg
This is for the LUKS app I'm working on. My thought was to make the app respond to the ".luks" file extension (if specified) and automatically open to the password prompt if a "SomeFile.luks" is selected in RoxFiler.
The final release version accepts a filespec argument on the CL and will open with focus on that file.

It is fairly easy to set this up manually in puppy, and I have done so using the "Set Run Action" & "Open With" options in Rox, but I would rather set this behavior automatically upon install so the user doesn't have to struggle with it.

From the looks of things I'll probably need to create new mime type?

Thanks again for your help.
Mike Walsh wrote: For help with FD64 stuff, I'd drop jamesbond a PM; he's quite amenable to offering assistance with his creation.
Thanks. I agree about the @jamesbond advice, and sent a PM to him several days ago, but I suspect he stays pretty busy and it may be several days before he responds.
Last edited by jafadmin on Sun 02 Feb 2020, 05:07, edited 1 time in total.

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#5 Post by musher0 »

Additional suggestion, to see how a pet archive with an OpenWith content is structured:

Maybe look at SFR's PackIT, from here.
Unpack it somewhere safe, then browse through the dir structure,
observe the symlinks and such. how they're made.
I'm sure I'd learn a thing or two! :)

BFN.
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

musher0
Posts: 14629
Joined: Mon 05 Jan 2009, 00:54
Location: Gatineau (Qc), Canada

#6 Post by musher0 »

jafadmin wrote:(...)
From the looks of things I'll probably need to create new mime type?

Thanks again for your help.
(...)
I don't know anything about "luks", so I'll stop after this post.

In answer to your question:
Maybe not. It seems the general MIME type of *.luks files is
application/x-raw-disk-image
Source

Good luk. :lol:
musher0
~~~~~~~~~~
"You want it darker? We kill the flame." (L. Cohen)

jafadmin
Posts: 1249
Joined: Thu 19 Mar 2009, 15:10

#7 Post by jafadmin »

musher0 wrote: Maybe look at SFR's PackIT, from here.
Unpack it somewhere safe, then browse through the dir structure,
observe the symlinks and such. how they're made.
I'm sure I'd learn a thing or two! :)
Thx, doing that now. As the cool kids say, "there's a lot to unpack there". :lol:
musher0 wrote: In answer to your question:
Maybe not. It seems the general MIME type of *.luks files is
application/x-raw-disk-image
Great catch! Thanks, again.

williams2
Posts: 337
Joined: Fri 14 Dec 2018, 22:18

#8 Post by williams2 »

You can create a new mime type eg *.luks or *.luks.ext3
by editing /usr/share/mime/packages/puppy.xml
for example:

Code: Select all

<mime-type type="application/luks">
    <comment>encrypted file system</comment>
    <glob pattern="*.luks"/>
</mime-type>
then type

Code: Select all

update-mime-database /usr/share/mime
then restart rox or X

Now, if you right click a .luks file, you should be able to set a run action for it.
Setting a run action will create a file in /root/.config/rox.sourceforge.net/MIME-types/
So you could put a file in /root/.config/rox.sourceforge.net/MIME-types/ to set the run action, assuming you created the mime type in /usr/share/mime/.

Fatdog may be slightly different.

jamesbond
Posts: 3433
Joined: Mon 26 Feb 2007, 05:02
Location: The Blue Marble

#9 Post by jamesbond »

Good advice from williams2.
williams2 wrote:You can create a new mime type eg *.luks or *.luks.ext3
by editing /usr/share/mime/packages/puppy.xml
for example:

Code: Select all

<mime-type type="application/luks">
    <comment>encrypted file system</comment>
    <glob pattern="*.luks"/>
</mime-type>
then type

Code: Select all

update-mime-database /usr/share/mime
then restart rox or X

Now, if you right click a .luks file, you should be able to set a run action for it.
Setting a run action will create a file in /root/.config/rox.sourceforge.net/MIME-types/
So you could put a file in /root/.config/rox.sourceforge.net/MIME-types/ to set the run action, assuming you created the mime type in /usr/share/mime/.

Fatdog may be slightly different.
It's mostly the same, actually.
1. Instead of editing puppy.xml, you edit fatdog.xml --- but in both puppy and fatdog, I would recommend you create new file instead, called it /usr/share/mime/packages/luks.xml with the following content:

Code: Select all

<?xml version="1.0"?>
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>

<mime-type type="application/luks">
    <comment>encrypted file system</comment>
    <glob pattern="*.luks"/>
</mime-type>

</mime-info>
And then run update-mime-database.

2. For Rox, it is also the same, but if you want pre-set the Rox click action, this is what you should do:

Create a file "/etc/xdg/rox.sourceforge.net/MIME-types/application_luks", make sure this file is executable (it can be a shell script). When you click the .luks file, this file will be executed and the first parameter ($1) will be the filename that gets clicked.

3. To make a Fatdog package, use makepkg. See here. Go to "Step 3 - making a package out of loose files". If you are familiar with Slackware packaging system, you're in luck - Fatdog's one is exactly the same.
Fatdog64 forum links: [url=http://murga-linux.com/puppy/viewtopic.php?t=117546]Latest version[/url] | [url=https://cutt.ly/ke8sn5H]Contributed packages[/url] | [url=https://cutt.ly/se8scrb]ISO builder[/url]

jafadmin
Posts: 1249
Joined: Thu 19 Mar 2009, 15:10

#10 Post by jafadmin »

Merci beaucoup mon amis

Solid gold help, you guys!

Now to get busy on packaging the release candidate :wink:

williams2
Posts: 337
Joined: Fri 14 Dec 2018, 22:18

#11 Post by williams2 »

I'm not sure if you want .luks or .luks.3fs files

You can put this in the luks.xml file (two glob pattern lines):

Code: Select all

<glob pattern="*.luks"/>
<glob pattern="*.luks.[2-4]fs"/>
and the mime type should work with:
xyz.luks
xyz.luks.2fs
xyz.luks.3fs
xyz.luks.4fs

or this:
<glob pattern="*luks.[2-4]fs"/>
would work with eg:
xyz-luks.3fs

What ever way you want.

This might follow the xdg standards better:
<mime-type type="application/x-luks">
or maybe:
<mime-type type="application/x-luks-image">

It will work either way, it's just that sometimes
doing things in a non-standard way
can cause problems 4 or 5 years later.

williams2
Posts: 337
Joined: Fri 14 Dec 2018, 22:18

#12 Post by williams2 »

You can use a file's magic number instead of or in addition to globbing.

Probably not necessary. There are practical examples in
packages/freedesktop.org.xml

You can set the globbing priority too, so it would prefer globbing to the file's magic number.
Also probably not necessary.

User avatar
Flash
Official Dog Handler
Posts: 13071
Joined: Wed 04 May 2005, 16:04
Location: Arizona USA

#13 Post by Flash »

Jafadmin, is your problem solved?

jafadmin
Posts: 1249
Joined: Thu 19 Mar 2009, 15:10

#14 Post by jafadmin »

Flash wrote:Jafadmin, is your problem solved?
Partially :?

I seem to have the ".pet" install package working fairly well, but I'm still wrestling with the FatDog install package. I can't even get the app listed in the 'Utility' menu, yet.

Here is the initial '.pet' for the release candidate if folks want to critique it.
Attachments
LotsaLuks-0.1.0r.pet
(8.48 KiB) Downloaded 184 times

williams2
Posts: 337
Joined: Fri 14 Dec 2018, 22:18

#15 Post by williams2 »

I don't think the mime file will work.
I think you need to put a file in /usr/share/mime/packages/
named luks.xml or maybe jafluks.xml (trying to avoid a file name that someone else might use.) Like this:

Code: Select all

<?xml version="1.0"?>
<mime-info xmlns='http://www.freedesktop.org/standards/shared-mime-info'>
  <mime-type type="application/luks">
    <comment>Luks encrypted file</comment>
    <glob pattern="*.luks"/>
  </mime-type>
</mime-info>
The pet would automatically put this file in /usr/share/mime/packages/
so all pinstall.sh needs to do is this:

Code: Select all

#! /bin/sh
update-mime-database /usr/share/mime
And then you need to restart rox or X.

This will restart rox:

Code: Select all

#!/bin/sh
cd
rox -D /
rox -p=
rox -p /root/Choices/ROX-Filer/PuppyPin
It will close all rox windows and restart the pinboard.
Fatdog uses a different pinboard file, I think.
Restarting X might be easier. (restartwm)?

Usually when you setup a rox run action
something happens to the particular file you click.
Like clicking bionic.iso would mount bionic.iso
and clicking xzy.gz will unzip xyz.gz

You seem to have it setup to run your program without the file name as a parameter. Nothing wrong with that, if that's what you intended to do.

williams2
Posts: 337
Joined: Fri 14 Dec 2018, 22:18

#16 Post by williams2 »

Sorry, your way does work.
It's a slightly different way to do the same thing.

jafadmin
Posts: 1249
Joined: Thu 19 Mar 2009, 15:10

#17 Post by jafadmin »

I think I'm on the right track, now. Many thanks to all of you 8)

jafadmin

jafadmin
Posts: 1249
Joined: Thu 19 Mar 2009, 15:10

#18 Post by jafadmin »

The result: Here

Post Reply