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