1 # pod2man.mk -- Makefile portion to convert *.pod files to manual pages
3 # Copyright information
5 # Copyright (C) 2010 Jari Aalto
9 # Redistribution and use in source and binary forms, with or
10 # without modification, are permitted provided that the
11 # following conditions are met:
13 # 1. Redistributions of source code must retain the above
14 # copyright notice, this list of conditions and the following
17 # 2. Redistributions in binary form must reproduce the above
18 # copyright notice, this list of conditions and the following
19 # disclaimer in the documentation and/or other materials
20 # provided with the distribution.
22 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESS OR
23 # IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
24 # WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
25 # PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR(S) OF THIS
26 # FILE OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
27 # INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
28 # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
29 # GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
30 # INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
31 # WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
32 # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
33 # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
36 # The license text is copy of the FreeBSD License available at
37 # <http://www.gnu.org/copyleft/gpl.html> with following
38 # modifications: wording "THIS SOFTWARE IS PROVIDED BY THE
39 # FREEBSD PROJECT" was changed to "THIS SOFTWARE IS PROVIDED 'AS
40 # IS'" and wording "IN NO EVENT SHALL THE FREEBSD PROJECT" was
41 # changed to "IN NO EVENT SHALL THE AUTHOR(S)"
45 # Convert *.pod files to manual pages.
48 This makefile requires GNU Make.
51 # This variable *must* be set when calling
54 # Optional variables to set
56 PODCENTER ?= $$(date "+%Y-%m-%d")
62 MANPOD = $(MANSRC)$(PACKAGE).pod
63 MANPAGE = $(MANDEST)$(PACKAGE).$(MANSECT)
68 PODFILES = $(wildcard ../*/man1/dos2unix.pod)
69 MAN_OBJECTS = dos2unix.1 $(patsubst %.pod,%.1,$(PODFILES))
74 # make target - create manual page from a *.pod page
76 LC_CTYPE=C $(POD2MAN) $(POD2MAN_FLAGS) \
77 --center="$(PODCENTER)" \
79 --section="$(MANSECT)" \
81 | sed 's,[Pp]erl v[0-9.]\+,$(PACKAGE),' \
84 # fix for bug http://rt.perl.org/rt3//Public/Bug/Display.html?id=79410
85 # "Pod2man creates wrong ROFF esc sequences for Latin-1 characters."
86 # Create groff (specific) escape sequences which work also on DOS/Windows.
87 # See also: https://rt.cpan.org/Public/Bug/Display.html?id=73804
89 -e s/A\\\\\\*\'/\\\\[\'A]/g\; \
90 -e s/a\\\\\\*\'/\\\\[\'a]/g\; \
91 -e s/E\\\\\\*\'/\\\\[\'E]/g\; \
92 -e s/e\\\\\\*:/\\\\[:e]/g\; \
93 -e s/e\\\\\\*\'/\\\\[\'e]/g\; \
94 -e s/i\\\\\\*\'/\\\\[\'i]/g\; \
95 -e s/n\\\\\\*~/\\\\[~n]/g\; \
96 -e s/O\\\\\\*\'/\\\\[\'O]/g\; \
97 -e s/o\\\\\\*\'/\\\\[\'o]/g\; \
98 -e s/u\\\\\\*\'/\\\\[\'u]/g\; \
101 # End of of Makefile part