gen-vlc-r-in 1.31 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64
#!/bin/sh
#
# Generate package/vlc.r.in from the mime types listed in vlcshell.cpp

set -e

# Extract all mime type lines, minus the quicktime ones, which are
# unwanted on MacOS X.
lines() {
    awk '/static char mimetype/,/   ;/ {print}' vlcshell.cpp | \
	grep -v static | \
	grep -v '^    ;' | \
	grep -vi "quicktime"
}


cat <<EOF
/*****************************************************************************
 * VLC Plugin description for OS X
 *****************************************************************************/

/* Definitions of system resource types */

data 'carb' (0)
{
};

/* The first string in the array is a plugin description,
 * the second is the plugin name */
resource 'STR#' (126)
{
    {
        "VLC media player Web Plugin @VERSION@"
        "<BR>@COPYRIGHT_MESSAGE@"
        "<BR><A HREF='http://www.videolan.org'>http://www.videolan.org</A>",
        "VLC Web Plugin"
    };
};

/* A description for each MIME type in resource 128 */
resource 'STR#' (127)
{
    {
EOF

lines | sed 's/ *".*:.*:\(.*\);"/        "\1",/' |
  sed 's%^ */%        /%'

cat <<EOF
    };
};

/* A series of pairs of strings... first MIME type, then file extension(s) */
resource 'STR#' (128,"MIME Type")
{
    {
EOF
lines | sed 's/ *"\(.*\):\(.*\):.*;"/        "\1", "\2",/' |
  sed 's%^ */%        /%'
cat <<EOF
    };
};

EOF