4 use ExtUtils::MakeMaker;
6 # Add a few more targets.
11 install:: extra_install
12 pure_install:: extra_install
14 VER=$(shell perl -e '$$_=<>;print m/\((.*?)\)/'<debian/changelog)
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); \\
26 # Additional configurable path variables.
27 W3M_CGI_BIN?=$(PREFIX)/lib/w3m/cgi-bin
29 tflag=$(shell if [ -n "$$NOTAINT" ] && [ "$$NOTAINT" != 1 ]; then printf -- "-T"; fi)
30 extramodules=$(shell if [ "$$PROFILE" = 1 ]; then printf -- "-d:NYTProf"; fi)
31 outprogs=ikiwiki.out ikiwiki-transition.out ikiwiki-calendar.out
32 scripts=ikiwiki-update-wikilist ikiwiki-makerepo
35 ./pm_filter $(PREFIX) $(VER) $(PROBABLE_INST_LIB) < $< > $@
38 ikiwiki.setup: ikiwiki.out
39 HOME=/home/me $(PERL) -Iblib/lib $(extramodules) $(tflag) ikiwiki.out -libdir . -dumpsetup ikiwiki.setup
41 extra_build: $(outprogs) ikiwiki.setup docwiki
42 ./mdwn2man ikiwiki 1 doc/usage.mdwn > ikiwiki.man
43 ./mdwn2man ikiwiki-mass-rebuild 8 doc/ikiwiki-mass-rebuild.mdwn > ikiwiki-mass-rebuild.man
44 ./mdwn2man ikiwiki-makerepo 1 doc/ikiwiki-makerepo.mdwn > ikiwiki-makerepo.man
45 ./mdwn2man ikiwiki-transition 1 doc/ikiwiki-transition.mdwn > ikiwiki-transition.man
46 ./mdwn2man ikiwiki-update-wikilist 1 doc/ikiwiki-update-wikilist.mdwn > ikiwiki-update-wikilist.man
47 ./mdwn2man ikiwiki-calendar 1 doc/ikiwiki-calendar.mdwn > ikiwiki-calendar.man
49 sed -i.bkp "s/Version:.*/Version: $$(perl -e '$$_=<>;print m/\((.*?)\)/'<debian/changelog)/" ikiwiki.spec
50 rm -f ikiwiki.spec.bkp
53 $(PERL) -Iblib/lib $(extramodules) $(tflag) ikiwiki.out -libdir . -setup docwiki.setup -refresh
56 $(PERL) -I. $(extramodules) $(tflag) ikiwiki.in -libdir . -setup docwiki.setup -clean
57 rm -f *.man $(outprogs) ikiwiki.setup plugins/*.pyc
61 install -d $(DESTDIR)$(PREFIX)/share/ikiwiki
62 for dir in `cd underlays && find . -follow -type d ! -regex '.*\.svn.*'`; do \
63 install -d $(DESTDIR)$(PREFIX)/share/ikiwiki/$$dir; \
64 for file in `find underlays/$$dir -follow -maxdepth 1 -type f`; do \
65 cp -aL $$file $(DESTDIR)$(PREFIX)/share/ikiwiki/$$dir 2>/dev/null || \
66 install -m 644 $$file $(DESTDIR)$(PREFIX)/share/ikiwiki/$$dir; \
70 # The directive docs become their own special underlay.
71 install -d $(DESTDIR)$(PREFIX)/share/ikiwiki/directives/ikiwiki/directive
72 for file in doc/ikiwiki/directive/*; do \
73 if [ -f "$$file" ]; then \
74 install -m 644 $$file $(DESTDIR)$(PREFIX)/share/ikiwiki/directives/ikiwiki/directive; \
78 extra_install: underlay_install
79 # Install example sites.
80 for dir in `cd doc/examples; find . -type d ! -regex '.*\.svn.*'`; do \
81 install -d $(DESTDIR)$(PREFIX)/share/ikiwiki/examples/$$dir; \
83 for file in `cd doc/examples; find . -type f ! -regex '.*\.svn.*'`; do \
84 cp -aL doc/examples/$$file $(DESTDIR)$(PREFIX)/share/ikiwiki/examples/$$file 2>/dev/null || \
85 install -m 644 doc/examples/$$file $(DESTDIR)$(PREFIX)/share/ikiwiki/examples/$$file; \
88 for dir in `find templates -follow -type d ! -regex '.*\.svn.*'`; do \
89 install -d $(DESTDIR)$(PREFIX)/share/ikiwiki/$$dir; \
90 for file in `find $$dir -follow -maxdepth 1 -type f`; do \
91 install -m 644 $$file $(DESTDIR)$(PREFIX)/share/ikiwiki/$$dir; \
95 install -d $(DESTDIR)$(PREFIX)/lib/ikiwiki/plugins
96 for file in `find plugins -maxdepth 1 -type f ! -path plugins/.\* ! -name \*demo\* -name \*.py`; do \
97 install -m 644 $$file $(DESTDIR)$(PREFIX)/lib/ikiwiki/plugins; \
99 for file in `find plugins -maxdepth 1 -type f ! -path plugins/.\* ! -name \*demo\* ! -name \*.py ! -name \*.pyc`; do \
100 install -m 755 $$file $(DESTDIR)$(PREFIX)/lib/ikiwiki/plugins; \
103 install -d $(DESTDIR)$(PREFIX)/share/man/man1
104 install -m 644 ikiwiki.man $(DESTDIR)$(PREFIX)/share/man/man1/ikiwiki.1
105 install -m 644 ikiwiki-makerepo.man $(DESTDIR)$(PREFIX)/share/man/man1/ikiwiki-makerepo.1
106 install -m 644 ikiwiki-transition.man $(DESTDIR)$(PREFIX)/share/man/man1/ikiwiki-transition.1
107 install -m 644 ikiwiki-update-wikilist.man $(DESTDIR)$(PREFIX)/share/man/man1/ikiwiki-update-wikilist.1
108 install -m 644 ikiwiki-calendar.man $(DESTDIR)$(PREFIX)/share/man/man1/ikiwiki-calendar.1
110 install -d $(DESTDIR)$(PREFIX)/share/man/man8
111 install -m 644 ikiwiki-mass-rebuild.man $(DESTDIR)$(PREFIX)/share/man/man8/ikiwiki-mass-rebuild.8
113 install -d $(DESTDIR)$(PREFIX)/sbin
114 install ikiwiki-mass-rebuild $(DESTDIR)$(PREFIX)/sbin
116 install -d $(DESTDIR)$(W3M_CGI_BIN)
117 install ikiwiki-w3m.cgi $(DESTDIR)$(W3M_CGI_BIN)
119 install -d $(DESTDIR)$(PREFIX)/bin
120 for prog in $(outprogs) $(scripts); do \
121 install $$prog $(DESTDIR)$(PREFIX)/bin/$$(echo $$prog | sed 's/\.out//'); \
124 $(MAKE) -C po install DESTDIR=$(DESTDIR) PREFIX=$(PREFIX)
126 # These might fail if a regular user is installing into a home
128 -install -d $(DESTDIR)/etc/ikiwiki
129 -install -m 0644 wikilist $(DESTDIR)/etc/ikiwiki
130 -install -m 0644 auto.setup $(DESTDIR)/etc/ikiwiki
131 -install -m 0644 auto-blog.setup $(DESTDIR)/etc/ikiwiki
137 PREFIX => "/usr/local",
138 PM_FILTER => './pm_filter $(PREFIX) $(VER) $(PROBABLE_INST_LIB)',
141 'XML::Simple' => "0",
142 'Text::Markdown' => "0",
143 'Date::Parse' => "0",
144 'HTML::Template' => "0",
145 'HTML::Scrubber' => "0",
146 'CGI::FormBuilder' => "3.02.02",
147 'CGI::Session' => "0",
148 'Mail::Sendmail' => "0",
149 'HTML::Parser' => "0",
151 'Data::Dumper' => "2.11",