Bugtrack 1285 - Add docs for omitted dkim_disable_verify.
[exim.git] / doc / doc-docbook / OS-Fixups
CommitLineData
a2119650 1#!/usr/bin/perl -w
3634fc25 2
a2119650
NM
3use strict;
4
f6bde1c8 5# Script to hack around xsl:import paths; ideally, the system catalogs are used.
a2119650
NM
6# Let every OS define its own manipulations.
7# Uses the Perl $^O values to identify the current OS.
8#
9# Define filter_$^O to do substitutions, will be called for every line of
10# every .xsl file.
11
12sub filter_freebsd
13{
f6bde1c8 14s{"http://docbook.sourceforge.net/release/xsl/current/}
a2119650
NM
15 {"/usr/local/share/xsl/docbook/};
16s{"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"}
17 {"/usr/local/share/xml/docbook/4.2/docbookx.dtd"};
18}
19
4a04fa7a
NM
20sub filter_linux
21{
22# SUSE 10 with extra pkgs
f6bde1c8 23s{"http://docbook.sourceforge.net/release/xsl/current/}
4a04fa7a
NM
24 {"/usr/share/xml/docbook/stylesheet/nwalsh/1.71.1/};
25s{"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"}
26 {"/usr/share/xml/docbook/schema/dtd/4.2/docbookx.dtd"};
27}
28
8127b38f
NM
29sub filter_darwin
30{
31# NB - this uses the Mac Ports installations
f6bde1c8 32s{"http://docbook.sourceforge.net/release/xsl/current/}
8127b38f
NM
33 {"/opt/local/share/xsl/docbook-xsl/};
34s{"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"}
35 {"/opt/local/share/xml/docbook/4.2/docbookx.dtd"};
36}
37
38
a2119650
NM
39# Define OS filters above.
40
41my $os_filter;
42$os_filter = $main::{"filter_$^O"} if exists $main::{"filter_$^O"};
43
44unless (defined $os_filter)
45 {
46 print "No changes defined for your OS ($^O).\n";
47 exit 0;
48 }
49
50for my $fn (<*.xsl>, <*.xml>)
51 {
52 my $orig = "$fn.orig";
53 rename($fn, $orig) or die "Failed to rename($fn, $orig): $!\n";
54 # Most portable is two-argument form, and none of our filenames are
55 # untrusted or contain whitespace.
56 open(OLD, "< $orig") or die "Failed to read-open($orig): $!\n";
57 open(NEW, "> $fn") or die "Failed to write-open($fn): $!\n";
58 while (<OLD>)
59 {
60 $os_filter->();
61 print NEW $_ or die "Write to \"$fn\" failed: $!\n";
62 }
63 close(NEW) or die "Failed to close($fn) after writing: $!\n";
64 close(OLD);
65 }