]> sipb.mit.edu Git - ikiwiki.git/blob - Makefile.PL
rename: Show full names of affected pages.
[ikiwiki.git] / Makefile.PL
1 #!/usr/bin/perl
2 use warnings;
3 use strict;
4 use ExtUtils::MakeMaker;
5
6 # Add a few more targets.
7 sub MY::postamble {
8 q{
9 all:: extra_build
10 clean:: extra_clean
11 install:: extra_install
12 pure_install:: extra_install
13
14 VER=$(shell perl -e '$$_=<>;print m/\((.*?)\)/'<debian/changelog)
15
16 PROBABLE_INST_LIB=$(shell \\
17         if [ "$(INSTALLDIRS)" = "perl" ]; then \\
18                 echo $(INSTALLPRIVLIB); \\
19         elif [ "$(INSTALLDIRS)" = "site" ]; then \\
20                 echo $(INSTALLSITELIB); \\
21         elif [ "$(INSTALLDIRS)" = "vendor" ]; then \\
22                 echo $(INSTALLVENDORLIB); \\
23         fi \\
24 )
25
26 # Additional configurable path variables.
27 W3M_CGI_BIN?=$(PREFIX)/lib/w3m/cgi-bin
28
29 tflag=$(shell if [ -n "$$NOTAINT" ] && [ "$$NOTAINT" != 1 ]; then printf -- "-T"; fi)
30 extramodules=$(shell if [ "$$PROFILE" = 1 ]; then printf -- "-d:Profile"; fi)
31
32 ikiwiki.out: ikiwiki.in
33         ./pm_filter $(PREFIX) $(VER) $(PROBABLE_INST_LIB) < ikiwiki.in > ikiwiki.out
34         chmod +x ikiwiki.out
35
36 ikiwiki.setup: ikiwiki.out
37         HOME=/home/me $(PERL) -Iblib/lib $(extramodules) $(tflag) ikiwiki.out -libdir . -dumpsetup ikiwiki.setup
38
39 extra_build: ikiwiki.out ikiwiki.setup docwiki
40         ./mdwn2man ikiwiki 1 doc/usage.mdwn > ikiwiki.man
41         ./mdwn2man ikiwiki-mass-rebuild 8 doc/ikiwiki-mass-rebuild.mdwn > ikiwiki-mass-rebuild.man
42         ./mdwn2man ikiwiki-makerepo 1 doc/ikiwiki-makerepo.mdwn > ikiwiki-makerepo.man
43         ./mdwn2man ikiwiki-transition 1 doc/ikiwiki-transition.mdwn > ikiwiki-transition.man
44         ./mdwn2man ikiwiki-update-wikilist 1 doc/ikiwiki-update-wikilist.mdwn > ikiwiki-update-wikilist.man
45         $(MAKE) -C po mo
46         
47 docwiki: ikiwiki.out
48         $(PERL) -Iblib/lib $(extramodules) $(tflag) ikiwiki.out -libdir . -setup docwiki.setup -refresh
49
50 extra_clean:
51         rm -rf html doc/.ikiwiki
52         rm -f *.man ikiwiki.out ikiwiki.setup plugins/*.pyc
53         $(MAKE) -C po clean
54
55 extra_install:
56         install -d $(DESTDIR)$(PREFIX)/share/ikiwiki
57         for dir in `cd underlays && find . -follow -type d ! -regex '.*\.svn.*'`; do \
58                 install -d $(DESTDIR)$(PREFIX)/share/ikiwiki/$$dir; \
59                 for file in `find underlays/$$dir -follow -maxdepth 1 -type f`; do \
60                         cp -aL $$file $(DESTDIR)$(PREFIX)/share/ikiwiki/$$dir || \
61                         install -m 644 $$file $(DESTDIR)$(PREFIX)/share/ikiwiki/$$dir; \
62                 done; \
63         done
64
65         # The directive docs become their own special underlay.
66         install -d $(DESTDIR)$(PREFIX)/share/ikiwiki/directives/ikiwiki/directive
67         for file in doc/ikiwiki/directive/*; do \
68                 if [ -f "$$file" ]; then \
69                         install -m 644 $$file $(DESTDIR)$(PREFIX)/share/ikiwiki/directives/ikiwiki/directive; \
70                 fi \
71         done
72
73         for dir in `find templates -follow -type d ! -regex '.*\.svn.*'`; do \
74                 install -d $(DESTDIR)$(PREFIX)/share/ikiwiki/$$dir; \
75                 for file in `find $$dir -follow -maxdepth 1 -type f`; do \
76                         install -m 644 $$file $(DESTDIR)$(PREFIX)/share/ikiwiki/$$dir; \
77                 done; \
78         done
79         
80         install -d $(DESTDIR)$(PREFIX)/lib/ikiwiki/plugins
81         for file in `find plugins -maxdepth 1 -type f ! -wholename plugins/.\* ! -name \*demo\* -name \*.py`; do \
82                 install -m 644 $$file $(DESTDIR)$(PREFIX)/lib/ikiwiki/plugins; \
83         done
84         for file in `find plugins -maxdepth 1 -type f ! -wholename plugins/.\* ! -name \*demo\* ! -name \*.py ! -name \*.pyc`; do \
85                 install -m 755 $$file $(DESTDIR)$(PREFIX)/lib/ikiwiki/plugins; \
86         done
87
88         install -d $(DESTDIR)$(PREFIX)/share/man/man1
89         install -m 644 ikiwiki.man $(DESTDIR)$(PREFIX)/share/man/man1/ikiwiki.1
90         install -m 644 ikiwiki-makerepo.man $(DESTDIR)$(PREFIX)/share/man/man1/ikiwiki-makerepo.1
91         install -m 644 ikiwiki-transition.man $(DESTDIR)$(PREFIX)/share/man/man1/ikiwiki-transition.1
92         install -m 644 ikiwiki-update-wikilist.man $(DESTDIR)$(PREFIX)/share/man/man1/ikiwiki-update-wikilist.1
93         
94         install -d $(DESTDIR)$(PREFIX)/share/man/man8
95         install -m 644 ikiwiki-mass-rebuild.man $(DESTDIR)$(PREFIX)/share/man/man8/ikiwiki-mass-rebuild.8
96         
97         install -d $(DESTDIR)$(PREFIX)/sbin
98         install ikiwiki-mass-rebuild $(DESTDIR)$(PREFIX)/sbin
99
100         install -d $(DESTDIR)$(W3M_CGI_BIN)
101         install ikiwiki-w3m.cgi $(DESTDIR)$(W3M_CGI_BIN)
102
103         install -d $(DESTDIR)$(PREFIX)/bin
104         install ikiwiki.out $(DESTDIR)$(PREFIX)/bin/ikiwiki
105         install ikiwiki-makerepo ikiwiki-transition ikiwiki-update-wikilist $(DESTDIR)$(PREFIX)/bin/
106
107         $(MAKE) -C po install DESTDIR=$(DESTDIR) PREFIX=$(PREFIX)
108         
109         # These might fail if a regular user is installing into a home
110         # directory.
111         -install -d $(DESTDIR)/etc/ikiwiki
112         -install -m 0644 wikilist $(DESTDIR)/etc/ikiwiki
113         -install -m 0644 auto.setup $(DESTDIR)/etc/ikiwiki
114 }
115 }
116
117 WriteMakefile(
118         NAME            => 'IkiWiki',
119         PREFIX          => "/usr/local",
120         PM_FILTER       => './pm_filter $(PREFIX) $(VER) $(PROBABLE_INST_LIB)',
121         MAN1PODS        => {},
122         PREREQ_PM       => {
123                 'XML::Simple'           => 0,
124                 'Text::Markdown'        => 0,
125                 'Date::Parse'           => 0,
126                 'HTML::Template'        => 0,
127                 'HTML::Scrubber'        => 0,
128                 'CGI::FormBuilder'      => 3.02.02,
129                 'CGI::Session'          => 0,
130                 'Mail::Sendmail'        => 0,
131                 'HTML::Parser'          => 0,
132                 'URI'                   => 0,
133                 'Data::Dumper'          => 2.11,
134         },
135 );