Gnome desktop and mime stuff help

Michael A. Peters mpeters at mac.com
Tue Nov 30 09:34:53 UTC 2004


On 11/29/2004 11:10:57 PM, Ville Skyttä wrote:
> On Tue, 2004-11-30 at 05:01 +0000, Michael A. Peters wrote:
> > On 11/29/2004 05:31:09 PM, Michael A. Peters wrote:
> > > I'm searching for docs on the "right way" of doing Gnome
> desktop/mime
> > > etc. entries.
> >
> > I think I figured it out
> 
> Care to post some pointers here for future reference?

The Makefile was correct in what it wanted to do - since the stuff  
wasn't defined in /etc/gnome-vfs-mime-magic it needed to be added. Spec  
files I had looked at before didn't add anything to that because they  
were already in that file. Tilp isn't so lucky.

It already was defined in /usr/share/file/magic (at least in fc3)

So what I did was patched the Makefile that was causing problems to do  
nothing, had the %install section install the necessary pieces in /usr/ 
share/product/magic, and had the %post script check the files and do  
the Makefile wanted to do.

%post
# update magic stuff from broken Makefile
MAGIC=/etc/magic
GNOME_MAGIC=/etc/gnome-vfs-mime-magic
KDE_MAGIC=/usr/share/mimelnk/magic
if [ ! -f ${MAGIC} ]; then
        MAGIG=/usr/share/file/magic
fi
if [ -f ${MAGIC} ]; then
        # see if it needs updating
        if ! grep "\*\*TI85\*\*" ${MAGIC}; then
                cat %_datadir/tilp/magic/magic >> ${MAGIC}
        fi
fi
if [ -f ${GNOME_MAGIC} ]; then
        # see if it needs updating
        if ! grep "\*\*TI" ${GNOME_MAGIC}; then
                cat %_datadir/tilp/magic/gnome-vfs-mime-magic >>  
${GNOME_MAGIC}
        fi
fi
if [ -f ${KDE_MAGIC} ]; then
        # see if it needs updating
        if ! grep "\*\*TI85" /usr/share/mimelnk/magic; then
                cat %_datadir/tilp/magic/kde.magic >> ${KDE_MAGIC}
        fi
fi
update-desktop-database %{_datadir}/applications

That works - the package (tilp - linking software for Ti Calculators)  
is working as expected in GNOME (well, the SilverLink USB cable doesn't  
work, not even as root - complains that the device is busy) but it  
works just fine with the black serial link cable (as root after  
install, as user after adjusting /etc/security/console.perms)

I don't have a KDE install to try there.

-=-
Another odd thing - it wanted to put itself into an "other" menu  
despite having the category set as

Categories=Application;Accessories;

I poked around in /usr/share/applications
it seems to have it show up in Accessories, it needs to be

Categories=Application;Utility;X-Red-Hat-Extra;

which is odd - seems kind of distro specific.
But when I patched the .desktop file to change the Category to that -  
it then showed up in the Accessories menu of the Application menu.





More information about the fedora-devel-list mailing list