Commit 7bdc32e2 authored by Brian White's avatar Brian White

git-debimport mime-support_3.31-1.tar.gz

parent aee4ed6e
#! /bin/sh
###############################################################################
#
# This file is an executable that demonstrates some methods for creating
# new entries in the /etc/mailcap file. More information is available from
# the 'install-mime' man page.
#
# This was written by Brian White <bcwhite@pobox.com> and has been placed
# in the public domain.
#
###############################################################################
# It's probably a good idea to put an "if" around this so it will work
# even if the mime-support package is not installed
if [ -x /usr/sbin/install-mime ]
then
# A really basic way to access text files
install-mime --install --package=mime-support --content=text/plain \
--description="Plain ASCII Text" --textualnewlines=t \
--view=more --compose="ae %s" --edit="ae %s" --needsterminal=t \
--comment="Make sure this entry is last in the priority list!"
# Viewing debian packages (under XWindows) will list their files in a window
install-mime --install --package=mime-support --content=application/x-debian-package \
--description="A Debian Package" --nametemplate="%s.deb" \
--test='test -n "$DISPLAY"' \
--view='/usr/bin/X11/xterm -T "Debian Package" -e /bin/sh -c "/usr/lib/mime/debian-view %s"'
# Viewing debian packages will list their files to stdout (put _after_ above)
install-mime --install --package=mime-support --content=application/x-debian-package \
--view="/usr/lib/mime/debian-view %s" --needsterminal=t \
--comment="This entry should appear after any entries with test conditions. \
Otherwise, none of the others will ever get a chance to run."
# Some basic "xv" commands
install-mime --install --package=xv --content=image/gif \
--description="GIF Image" --nametemplate="%s.gif" \
--test='test -n "$DISPLAY"' \
--view="/usr/bin/X11/xv %s"
install-mime --install --package=xv --content=image/jpeg \
--description="JPEG Image" --nametemplate="%s.jpg" \
--test='test -n "$DISPLAY"' \
--view="/usr/bin/X11/xv %s"
fi
mime-support (3.31-1) unstable; urgency=medium
* fixed mistakenly-enabled debug output (closes: #296501)
-- Brian White <bcwhite@pobox.com> Tue, 22 Feb 2005 19:06:47 -0500
mime-support (3.30-1) unstable; urgency=medium
* added more mime types
* minor updates to man pages
-- Brian White <bcwhite@pobox.com> Tue, 22 Feb 2005 00:48:40 -0500
mime-support (3.29-1) unstable; urgency=medium
* added more mime types (closes: #284830)
* made common extensions first (closes: #264536)
* removed duplicate application/x-sh (closes: #281083)
-- Brian White <bcwhite@pobox.com> Tue, 4 Jan 2005 09:30:14 -0500
mime-support (3.28-1) unstable; urgency=medium
* added more mime types (closes: #259706)
......
This diff is collapsed.
.\" Hey, Emacs! This is an -*- nroff -*- source file.
.\" Install-mime and this manpage were written by Brian White and
.\" have been placed in the public domain.
.\"
.TH INSTALL-MIME 8 "16th Aug 1998" "Debian Project" "Install MIME Programs"
.SH NAME
install\-mime
.B [obsolete]
\- create or update MIME information
.SH SYNOPSIS
.B install\-mime
[\-\-install] [\-\-remove] [\-\-list]
[\-\-package=<pkg\-name>] [\-\-content=<content\-type>]
[\-\-comment=<string>]
[\-\-test=<conditional>] [\-\-needsterminal=<t/f>]
[\-\-copiousoutput=<t/f>] [\-\-description=<string>]
[\-\-textualnewlines=<t/f>] [\-\-x11\-bitmap=<pathname>]
[\-\-nametemplate=<string>] [\-\-view=<program\-string>]
[\-\-compose=<program\-string>] [\-\-composetyped=<program\-string>]
[\-\-edit=<program\-string>] [\-\-print=<program\-string>]
.SH DESCRIPTION
.PP
.B install-mime
makes, updates or removes entries from the
.B /etc/mailcap
file.
.B install-mime
is
.B obsolete!
Please use
.B update-mime
instead.
.SS OPTIONS
All options are in the form --<opt>[=<value>]. Values can be a
'pkg-name' (any valid package name -- sans version numbers -- as
accepted by dpkg), 'content-type' (any valid content-type as
recognized by MIME), 'conditional' (a valid shell command line), 't/f'
(a true/false or t/f value), 'string', (any arbitrary ascii string),
\&'pathname' (a path to an existing file), and 'program-string' (how to
call a program with the given content-type as supported by MIME).
.SS Actions
These options specify what is to be done.
.TP
.BI \-\-install
Installs the given commands along with their modifiers into the
database and
.I mailcap
file. This option requires the
.B \-\-package
and
.B \-\-content
options.
.TP
.BI \-\-remove
Removes all entries for the named package from the database and
.I mailcap
file. This option requires the
.B \-\-package
option.
.TP
.BI \-\-list
Lists all entries in the database. The
.B \-\-package
and
.B \-\-content
options can be specified to restrict which items will be listed.
.SS Install Info
.TP
.BI \-\-package=<pkg-name>
Specifies the name of the package under which to create or remove
entries. This option is mandatory for both the
.B --install
and
.B --remove
actions.
.TP
.BI \-\-comment=<string>
Specifies a comment string to print out if it is necessary to prompt
the user to chose a priority for these commands. Strings can be as
long as you want. All newlines and tabs will be removed and the
string reformatted for the width of the screen.
.TP
.BI \-\-content=<content-type>
Specifies the MIME content-type the action applies to. This option is
mandatory for the
.B --install
action.
.SS Commands
These options specify what to do for the given content-type.
.TP
.BI \-\-view=<program-string>
Specifies the program to run to view a file of the given content-type.
.TP
.BI \-\-compose=<program-string>
The "compose" command may be used to specify a program that can be
used to compose a new body or body part in the given format. Its
intended use is to support mail composing agents that support the
composition of multiple types of mail using external composing agents.
The result of the composing program may be data that is not yet
suitable for mail transport -- that is, a Content-Transfer-Encoding
may need to be applied to the data.
.TP
.BI \-\-composetyped=<program-string>
The "composetyped" command is similar to "compose", but is to be used
when the composing program needs to specify the Content-type header
field to be applied to the composed data. The "compose" option is
simpler, and is preferred for use with existing (non-mail-oriented)
programs for composing data in a given format. The "composetyped"
option is necessary when the Content-type information must include
auxiliary parameters, and the composition program must then know
enough about mail formats to produce output that includes the mail
type information.
.TP
.BI \-\-edit=<program-string>
The "edit" command may be used to specify a program that can be used
to edit a body or body part in the given format. In many cases, it
may be identical in content to the "compose" command.
.TP
.BI \-\-print=<program-string>
The "print" command may be used to specify a program that can be used to
print a message or body part in the given format.
.SS Modifiers
These options are modifiers to all the commands specified on the
command line.
.TP
.BI \-\-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.
.TP
.BI \-\-needsterminal=<t/f>
The "needsterminal" option, if true, indicates that the commands must
be run on an interactive terminal. This is needed to inform window-
oriented user agents that an interactive terminal is needed. (The
decision is not left exclusively to the command because in some
circumstances it may not be possible for such programs to tell whether
or not they are on interactive terminals.) The needsterminal command
applies to the view, compose and edit commands, if they exist. Note
that this is NOT a test -- it is a requirement for the environment in
which the program will be executed, and should typically cause the
creation of a terminal window when not executed on either a real
terminal or a terminal window. (default=false)
.TP
.BI \-\-copiousoutput=<t/f>
The "copiousoutput", if true, indicates that the output from the
view-command will be an extended stream of output, and is to be
interpreted as advice to the UA (User Agent mail-reading program) that
the output should be either paged or made scrollable. Note that it is
probably a mistake if needsterminal and copiousoutput are both
specified. (default=false)
.SS Content-Type Info
These options provide additional information about the given
content-type. These will be applied to all entries of that type
whether defined on the same invocation of
.B mime-support
or another.
.TP
.BI \-\-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 display it.
.TP
.BI \-\-textualnewlines=<t/f>
The "textualnewlines" option, if set to true, indicates that this type
of data is line-oriented and that, if encoded in a binary format, all
newlines should be converted to canonical form (CRLF) before encoding,
and will be in that form after decoding. In general, this is needed
only if there is line-oriented data of some type other than text/* or
non-line- oriented data that is a subtype of text. (default=false)
.TP
.BI \-\-x11-bitmap=<pathname>
The "x11-bitmap" option names a file, in X11 bitmap (xbm) format,
which points to an appropriate icon to be used to visually denote the
presence of this kind of data.
.TP
.BI \-\-nametemplate=<string>
The "nametemplate" option gives a file name format, in which %s will be
replaced by a short unique string to give the name of the temporary
file to be passed to the viewing command. This is only expected to be
relevant in environments where filename extensions are meaningful,
e.g., one could specify that a GIF file being passed to a gif viewer
should have a name ending in ".gif" by using "nametemplate=%s.gif".
.SS Program settings
These options change the behavior of
.B mime-support
itself. They have no effect on the final results of the program.
.TP
.BI \-\-quiet
The "quiet" flag will keep
.B mime-support
from generating any unnecessary messages.
.TP
.BI \-\-noparmcheck
The "noparmcheck" flag will tell
.B mime-support
to ignore any unrecognized parameters on the command line. This flag
is useful
.I only
for allowing install scripts using newer options to work
semi-gracefully with older versions of
.B mime-support.
It should
.I not
be used for any other purpose and should be removed as soon as
possible.
.SH CONFLICTS
.B Mime-support
will correctly handle situations where multiple packages wish to
provide viewers, editors, and/or composers for the same mime-type.
When such a conflict arises, the user will be presented with a list of
current entries for that type and asked at what priority the new
program is to be inserted.
.I Note:
Because
.I install-mime
can become interactive, it is essential that
.I stdout
not be redirected. Use the
.B --quiet
option instead.
.SH DEPENDENCIES
Packages that wish to provide MIME access to themselves should not
depend on, recommend, or suggest
.B mime-support,
but rather just put something like the following in the
.I postinst
and
.I prerm
scripts.
.ft CW
.nf
.ne 4
\& if [ -x /usr/sbin/install-mime ]
\& then
\& install-mime [...]
\& fi
.ft R
.SH "SEE ALSO"
RFC-1524 (/usr/doc/mime-support/rfc1524.txt)
.SH AUTHOR
.B install\-mime
was written by Brian White <bcwhite@pobox.com>
.SH COPYRIGHT
.B install\-mime
is in the public domain (the only true "free").
......@@ -45,6 +45,17 @@ After modifying this file, be sure to run
to propagate the changes into the
.I /etc/mailcap
file.
Remember that this files takes
.I package
names and not
.I executable
names. If you want to define rules that reference specific programs,
the best way is to include them in
.I ~/.mailcap
or the user section of the
.I /etc/mailcap
file.
.SH LIMITATIONS
There is currently no way to break out a certain type from a wildcard
rule. If, for example, both xv and gimp were to specify "image/*"
......
......@@ -27,7 +27,7 @@ application/batch-SMTP
application/beep+xml
application/cals-1840
application/commonground
application/cu-seeme csm cu
application/cu-seeme cu
application/cybercash
application/dca-rft
application/dec-dx
......@@ -35,8 +35,8 @@ application/docbook+xml
application/dsptype tsp
application/dvcs
application/edi-consent
application/edifact
application/edi-x12
application/edifact
application/eshop
application/font-tdpfr
application/futuresplash spl
......@@ -53,33 +53,33 @@ application/index.vnd
application/iotp
application/ipp
application/isup
application/mac-compactpro cpt
application/marc
application/mac-binhex40 hqx
application/mac-compactpro cpt
application/macwriteii
application/marc
application/mathematica nb
application/mathematica-old
application/msaccess mdb
application/msword doc dot
application/news-message-id
application/news-transmission
application/octet-stream bin
application/ocsp-request
application/ocsp-response
application/octet-stream bin
application/oda oda
application/ogg ogg
application/parityfec
application/pics-rules prf
application/pdf pdf
application/pgp-encrypted
application/pgp-keys key
application/pdf pdf
application/pgp-signature pgp
application/pics-rules prf
application/pkcs10
application/pkcs7-mime
application/pkcs7-signature
application/pkix-cert
application/pkixcmp
application/pkix-crl
application/pkixcmp
application/postscript ps ai eps
application/prs.alvestrand.titrax-sheet
application/prs.cww
......@@ -90,7 +90,7 @@ application/rdf+xml rdf
application/remote-printing
application/riscos
application/rss+xml rss
application/rtf rtf
application/rtf
application/sdp
application/set-payment
application/set-payment-initiation
......@@ -107,9 +107,10 @@ application/vemmi
application/whoispp-query
application/whoispp-response
application/wita
application/wordperfect wpd
application/wordperfect5.1 wp5
application/x400-bp
application/xhtml+xml xht xhtml
application/xhtml+xml xhtml xht
application/xml xml xsl
application/xml-dtd
application/xml-external-parsed-entity
......@@ -215,7 +216,7 @@ application/vnd.lotus-wordpro
application/vnd.mcd
application/vnd.mediastation.cdkey
application/vnd.meridian-slingshot
application/vnd.mif mif
application/vnd.mif
application/vnd.minisoft-hp3000-save
application/vnd.mitsubishi.misty-guard.trustweb
application/vnd.mobius.daf
......@@ -252,6 +253,20 @@ application/vnd.noblenet-web
application/vnd.novadigm.EDM
application/vnd.novadigm.EDX
application/vnd.novadigm.EXT
application/vnd.oasis.opendocument.chart odc
application/vnd.oasis.opendocument.database odb
application/vnd.oasis.opendocument.formula odf
application/vnd.oasis.opendocument.graphics odg
application/vnd.oasis.opendocument.graphics-template otg
application/vnd.oasis.opendocument.image odi
application/vnd.oasis.opendocument.presentation odp
application/vnd.oasis.opendocument.presentation-template otp
application/vnd.oasis.opendocument.spreadsheet ods
application/vnd.oasis.opendocument.spreadsheet-template ots
application/vnd.oasis.opendocument.text odt
application/vnd.oasis.opendocument.text-master odm
application/vnd.oasis.opendocument.text-template ott
application/vnd.oasis.opendocument.text-web oth
application/vnd.osa.netdeploy
application/vnd.palm
application/vnd.pg.format
......@@ -267,6 +282,7 @@ application/vnd.publishare-delta-tree
application/vnd.pvi.ptid1
application/vnd.pwg-xhtml-print+xml
application/vnd.rapid
application/vnd.rim.cod cod
application/vnd.s3sms
application/vnd.seemail
application/vnd.shana.informed.formdata
......@@ -332,24 +348,25 @@ application/vnd.xara
application/vnd.xfdl
application/vnd.yellowriver-custom-menu
application/x-123 wk
application/x-abiword abw
application/x-apple-diskimage dmg
application/x-bcpio bcpio
application/x-bittorrent torrent
application/x-cdf cdf
application/x-cdlink vcd
application/x-chess-pgn pgn
application/x-chm chm
application/x-core
application/x-cpio cpio
application/x-csh csh
application/x-debian-package deb
application/x-director dcr dir dxr
application/x-doom wad
application/x-dms dms
application/x-doom wad
application/x-dvi dvi
application/x-executable
application/x-flac flac
application/x-font pfa pfb gsf pcf pcf.Z
application/x-freemind mm
application/x-futuresplash spl
application/x-gnumeric gnumeric
application/x-go-sgf sgf
......@@ -364,6 +381,7 @@ application/x-httpd-php4 php4
application/x-ica ica
application/x-internet-signup ins isp
application/x-iphone iii
application/x-iso9660-image iso
application/x-java-applet
application/x-java-archive jar
application/x-java-bean
......@@ -371,11 +389,12 @@ application/x-java-jnlp-file jnlp
application/x-java-serialized-object ser
application/x-java-vm class
application/x-javascript js
application/x-kdelnk
application/x-jmol jmz
application/x-kchart chrt
application/x-kdelnk
application/x-killustrator kil
application/x-kpresenter kpr kpt
application/x-koan skp skd skt skm
application/x-kpresenter kpr kpt
application/x-kspread ksp
application/x-kword kwd kwt
application/x-latex latex
......@@ -384,8 +403,8 @@ application/x-lzh lzh
application/x-lzx lzx
application/x-maker frm maker frame fm fb book fbdoc
application/x-mif mif
application/x-ms-wmz wmz
application/x-ms-wmd wmd
application/x-ms-wmz wmz
application/x-msdos-program com exe bat dll
application/x-msi msi
application/x-netcdf nc
......@@ -399,11 +418,10 @@ application/x-python-code pyc pyo
application/x-quicktimeplayer qtl
application/x-redhat-package-manager rpm
application/x-rx
application/x-sh
application/x-sh sh
application/x-shar shar
application/x-shellscript
application/x-shockwave-flash swf swfl
application/x-sh sh
application/x-stuffit sit
application/x-sv4cpio sv4cpio
application/x-sv4crc sv4crc
......@@ -464,7 +482,61 @@ audio/x-scpls pls
audio/x-sd2 sd2
audio/x-wav wav
chemical/x-pdb pdb
chemical/x-alchemy alc
chemical/x-cache cac cache
chemical/x-cache-csf csf
chemical/x-cactvs-binary cbin cascii ctab
chemical/x-cdx cdx
chemical/x-cerius cer
chemical/x-chem3d c3d
chemical/x-chemdraw chm
chemical/x-cif cif
chemical/x-cmdf cmdf
chemical/x-cml cml
chemical/x-compass cpa
chemical/x-crossfire bsd
chemical/x-csml csml csm
chemical/x-ctx ctx
chemical/x-cxf cxf cef
#chemical/x-daylight-smiles smi
chemical/x-embl-dl-nucleotide emb embl
chemical/x-galactic-spc spc
chemical/x-gamess-input inp gam gamin
chemical/x-gaussian-checkpoint fch fchk
chemical/x-gaussian-cube cub
chemical/x-gaussian-input gau gjc gjf
chemical/x-gaussian-log gal
chemical/x-gcg8-sequence gcg
chemical/x-genbank gen
chemical/x-hin hin
chemical/x-isostar istr ist
chemical/x-jcamp-dx jdx dx
chemical/x-kinemage kin
chemical/x-macmolecule mcm
chemical/x-macromodel-input mmd mmod
chemical/x-mdl-molfile mol
chemical/x-mdl-rdfile rd
chemical/x-mdl-rxnfile rxn
chemical/x-mdl-sdfile sd sdf
chemical/x-mdl-tgf tgf
#chemical/x-mif mif
chemical/x-mmcif mcif
chemical/x-mol2 mol2
chemical/x-molconn-Z b
chemical/x-mopac-graph gpt
chemical/x-mopac-input mop mopcrt mpc dat zmt
chemical/x-mopac-out moo
chemical/x-mopac-vib mvb
chemical/x-ncbi-asn1 asn
chemical/x-ncbi-asn1-ascii prt ent
chemical/x-ncbi-asn1-binary val aso
chemical/x-ncbi-asn1-spec asn
chemical/x-pdb pdb ent
chemical/x-rosdal ros
chemical/x-swissprot sw
chemical/x-vamas-iso14976 vms
chemical/x-vmd vmd
chemical/x-xtel xtel
chemical/x-xyz xyz
image/cgm
......@@ -560,7 +632,7 @@ text/directory
text/english
text/enriched
text/h323 323
text/html htm html shtml
text/html html htm shtml
text/iuls uls
text/mathml mml
text/parityfec
......@@ -592,13 +664,16 @@ text/vnd.wap.si
text/vnd.wap.sl
text/vnd.wap.wml wml
text/vnd.wap.wmlscript wmls
text/x-bibtex bib
text/x-c++hdr h++ hpp hxx hh
text/x-c++src c++ cpp cxx cc
text/x-chdr h
text/x-crontab
text/x-csh csh
text/x-csrc c
text/x-haskell hs
text/x-java java
text/x-literate-haskell lhs
text/x-makefile
text/x-moc moc
text/x-pascal p pas
......
......@@ -43,7 +43,11 @@ is made by trying to match the file's extension with those in the
files. If the encoding is omitted, it will also be determined from
the file's extensions. Currently supported encodings are
.B gzip
(.gz) and
(.gz),
.B bzip
(.bz),
.B bzip2
(.bz2), and
.B compress
(.Z). A filename of "-" can be used to mean "standard input", but
then a mime-type
......@@ -55,7 +59,8 @@ Both the user's files (~/.mailcap; ~/.mime.types) and the system files
.SS EXAMPLES
see picture.jpg
print output.ps.gz
compose text/html:index.html
compose text/html:index.htm
extract-mail-attachment msg.txt | see image/tiff:gzip:-
.SS OPTIONS
All options are in the form --<opt>=<value>.
.TP
......
......@@ -42,17 +42,17 @@ $defpriority= 5;
sub ReadEntries
{
my($package,$priority,$counter);
my($pkg,$priority,$counter);
$counter=1;
foreach $file (glob "$mimedir/*") {
next if ($file =~ m!(^|/)(\.|\#)|(\~)$!);
($package) = ($file =~ m|/([^/]*)$|);
print STDERR "$package:\n" if $debug;
($pkg) = ($file =~ m|/([^/]*)$|);
print STDERR "$pkg:\n" if $debug;
if (!defined $packages{$package}) {
$packages{$package} = [];
if (!defined $packages{$pkg}) {
$packages{$pkg} = [];
}
if (open(FILE,"<$file")) {
......@@ -71,7 +71,7 @@ sub ReadEntries
}
s/([^\s;]\s+)(?![\'\"])([^\s;]*)%s([^\s;]*)/$1'$2%s$3'/g;
$entries{$counter} = $_;
push @{$packages{$package}},$counter;
push @{$packages{$pkg}},$counter;
push @{$priorities{$priority}},$counter;
print STDERR "$counter: $_\n" if $debug;
$counter++;
......@@ -209,7 +209,11 @@ sub UpdateMailcap
close PATH;
if ($state == 3) {
open(PATH,">$mailcap.new") || die "Error: could not write '$mailcap.new' -- $!\n";
if (!open(PATH,">$mailcap.new")) {
print STDERR "Error: could not write '$mailcap.new' -- $!\n";
exit(1) unless ($debug);
open(PATH,">-");
}
print PATH @above;
print PATH @user;
print PATH @below;
......
......@@ -113,16 +113,16 @@ Many programs recognize these strings and optimize for them.
.TP
.BI needsterminal
The "needsterminal" option, if given, indicates that the commands must
be run on an interactive terminal. This is needed to inform window-
oriented user agents that an interactive terminal is needed. (The
decision is not left exclusively to the command because in some
circumstances it may not be possible for such programs to tell whether
or not they are on interactive terminals.) The needsterminal command
applies to the view, compose and edit commands, if they exist. Note
that this is NOT a test -- it is a requirement for the environment in
which the program will be executed, and should typically cause the
creation of a terminal window when not executed on either a real
terminal or a terminal window.
be run on an interactive terminal. This is needed to inform window-oriented
user agents that an interactive terminal is needed. (The decision is
not left exclusively to the command because in some circumstances it
may not be possible for such programs to tell whether or not they are
on interactive terminals.) The needsterminal command applies to the
view, compose and edit commands, if they exist. Note that this is NOT
a test -- it is a requirement for the environment in which the program
will be executed, and will typically cause the creation of a terminal
window when not executed on either a real terminal or a terminal
window.
.TP
.BI copiousoutput
The "copiousoutput" option, if given, indicates that the output from the
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment