> > ftp://ftp.rfc-editor.org/in-notes/rfc3461.txt
>
> That's a pretty long (TM) document. Could someone point me to the relevant
> part?
Oh, the only reason I added that link here is to show that
application/dicom
is the proper mimetype to register and that expecting (not
relying on) DICOM files to end in .dcm is a sane assumption.
> If I understand that correctly I only have to add the "right" line to
> debian/mime and call dh_installmime in rules.
>
> Unfortunately my knowledge about mime types is _very_ limited :-( So a hint
> to
> the "right lines" would help a lot.
This
http://www.debian.org/doc/packaging-manuals/mime-policy/
is the relevant policy in Debian. It says:
2.2 MIME support implementation
The mime-support package provides the update-mime
program which allows packages to register programs that
can show, compose, edit or print MIME types.
Packages containing such programs must register them
with update-mime as documented in update-mime(8). They
should not depend on, recommend, or suggest
mime-support. Instead, they should just put something
like the following in the postinst and postrm scripts:
if [ -x /usr/sbin/update-mime ]; then
update-mime
fi
man 8 update-mime says:
..........................
DESCRIPTION
update-mime updates the /etc/mailcap file to reflect mime information
changed by a Debian package during installation or removal.
CREATING ENTRIES
To create entries in the mailcap file, packages need to create a file
in the /usr/lib/mime/packages directory. In this file goes the verba-
tim desired mailcap entries.
...
Commands
<program-string>
Specifies the program to run to view a file of the given con-
tent-type. This option setting connot be omitted. An implicit
"view=" can be considered before it. When writing an entry that
has no viewer, use a value of false in this space.
...
Modifiers
These options are modifiers to all the commands specified on the com-
mand line.
test=<conditional>
The "test" option may be used to test some external condition
(e.g., the machine architecture, or the window system in use) to
determine whether or not the mailcap line applies. It specifies
a program to be run to test some condition. If the test fails,
a subsequent mailcap entry will be sought. Multiple test
options are not permitted -- since a test can call a program, it
can already be arbitrarily complex.
Note: When testing for X by looking at the DISPLAY environment
variable, please use one of:
test=test -z "$DISPLAY" (no X)
or test=test -n "$DISPLAY" (have X)
Many programs recognize these strings and optimize for them.
...
Content-Type Info
These options provide additional information about the given content-
type.
description=<string>
The "description" option simply provides a textual description
that describes the type of data, to be used optionally by mail
readers that wish to describe the data before offering to dis-
play it.
...
DEPENDENCIES
Packages that wish to provide MIME access to themselves should not
depend on, recommend, or suggest mime-support. Instead, they should
just put something like the following in the postinst and postrm
scripts.
if [ -x /usr/sbin/update-mime ]; then
update-mime
fi
..........................
So, I'd suggest a line of
application/dicom; /usr/bin/xmedcon --enable-contrast --enable-mosaic -f '%s';
test=test -n "$DISPLAY"; description=DICOM Image; nametemplate=%s.dcm
to be put into "/usr/lib/mime/packages/xmedcon".
Thanks,
Karsten
--
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346
--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]