| @@ -1,35 +1,37 @@ | | | @@ -1,35 +1,37 @@ |
1 | # $NetBSD: generate.awk,v 1.2 2008/11/23 17:24:56 jmcneill Exp $ | | 1 | # $NetBSD: generate.awk,v 1.3 2011/02/21 08:38:30 obache Exp $ |
2 | # | | 2 | # |
3 | # AWK script to replace @FONTDIR_ENTRIES@ with a list of <dir></dir> | | 3 | # AWK script to replace @FONTDIR_ENTRIES@ with a list of <dir></dir> |
4 | # entries taken from the "entries" array. We do variable replacement | | 4 | # entries taken from the "entries" array. We do variable replacement |
5 | # for ${LOCALBASE} and ${X11BASE} using the values of LOCALBASE and | | 5 | # for ${LOCALBASE} and ${X11BASE} using the values of LOCALBASE and |
6 | # X11BASE that are passed to the script. | | 6 | # X11BASE that are passed to the script. |
7 | # | | 7 | # |
8 | | | 8 | |
9 | BEGIN { | | 9 | BEGIN { |
10 | entries[0] = "${X11BASE}/lib/X11/fonts" | | 10 | entries[0] = "${X11BASE}/lib/X11/fonts" |
11 | entries[1] = "${LOCALBASE}/OpenOffice.org1.1.5/share/fonts" | | 11 | entries[1] = "${LOCALBASE}/lib/X11/fonts" |
12 | entries[2] = "${LOCALBASE}/openoffice.org2.2/share/fonts" | | 12 | entries[2] = "${LOCALBASE}/share/fonts" |
13 | entries[3] = "${LOCALBASE}/java/blackdown-1.3.1/lib/fonts" | | 13 | entries[3] = "${LOCALBASE}/OpenOffice.org1.1.5/share/fonts" |
14 | entries[4] = "${LOCALBASE}/java/scsl-1.5/lib/fonts" | | 14 | entries[4] = "${LOCALBASE}/openoffice.org2.2/share/fonts" |
15 | entries[5] = "${LOCALBASE}/java/sun-1.3.1/lib/fonts" | | 15 | entries[5] = "${LOCALBASE}/java/blackdown-1.3.1/lib/fonts" |
16 | entries[6] = "${LOCALBASE}/java/sun-1.4/lib/fonts" | | 16 | entries[6] = "${LOCALBASE}/java/scsl-1.5/lib/fonts" |
17 | entries[7] = "${LOCALBASE}/java/sun-1.5/lib/fonts" | | 17 | entries[7] = "${LOCALBASE}/java/sun-1.3.1/lib/fonts" |
18 | entries[8] = "${LOCALBASE}/java/sun-6/lib/fonts" | | 18 | entries[8] = "${LOCALBASE}/java/sun-1.4/lib/fonts" |
19 | entries[9] = "${LOCALBASE}/Acrobat4/Resource/CIDFont" | | 19 | entries[9] = "${LOCALBASE}/java/sun-1.5/lib/fonts" |
20 | entries[10] = "${LOCALBASE}/Acrobat5/Resource/Font" | | 20 | entries[10] = "${LOCALBASE}/java/sun-6/lib/fonts" |
21 | entries[11] = "${LOCALBASE}/Acrobat7/Resource/CIDFont" | | 21 | entries[11] = "${LOCALBASE}/Acrobat4/Resource/CIDFont" |
22 | num_entries = 12 | | 22 | entries[12] = "${LOCALBASE}/Acrobat5/Resource/Font" |
| | | 23 | entries[13] = "${LOCALBASE}/Acrobat7/Resource/CIDFont" |
| | | 24 | num_entries = 14 |
23 | | | 25 | |
24 | LOCALBASE = ENVIRON["LOCALBASE"] ? ENVIRON["LOCALBASE"] : "/usr/pkg" | | 26 | LOCALBASE = ENVIRON["LOCALBASE"] ? ENVIRON["LOCALBASE"] : "/usr/pkg" |
25 | X11BASE = ENVIRON["X11BASE"] ? ENVIRON["X11BASE"] : "/usr/X11R6" | | 27 | X11BASE = ENVIRON["X11BASE"] ? ENVIRON["X11BASE"] : "/usr/X11R6" |
26 | } | | 28 | } |
27 | | | 29 | |
28 | /^@FONTDIR_ENTRIES@/ { | | 30 | /^@FONTDIR_ENTRIES@/ { |
29 | for (i = 0; i < num_entries; i++) { | | 31 | for (i = 0; i < num_entries; i++) { |
30 | entry = entries[i] | | 32 | entry = entries[i] |
31 | sub("[$]{LOCALBASE}", LOCALBASE, entry) | | 33 | sub("[$]{LOCALBASE}", LOCALBASE, entry) |
32 | sub("[$]{X11BASE}", X11BASE, entry) | | 34 | sub("[$]{X11BASE}", X11BASE, entry) |
33 | print " <dir>" entry "</dir>" | | 35 | print " <dir>" entry "</dir>" |
34 | } | | 36 | } |
35 | next | | 37 | next |