summaryrefslogtreecommitdiff
path: root/Makefile.PL
blob: 5bd1d64937d9b1df7c1bf7ba9fcba9941dc887f6 (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 [ "$$NOTAINT" != 0 ]; then printf -- "-T"; fi)
  23. extramodules=$(shell if [ "$$PROFILE" = 1 ]; then printf -- "-MDevel::Profiler"; fi)
  24. extra_build:
  25. ./pm_filter $(PREFIX) $(VER) $(PROBABLE_INST_LIB) < ikiwiki.in > ikiwiki.out
  26. chmod +x ikiwiki.out
  27. LANG=C perl -I. $(extramodules) $(tflag) ikiwiki.out doc html --templatedir=templates \
  28. --underlaydir=basewiki \
  29. --wikiname="ikiwiki" --verbose \
  30. --exclude=/discussion --no-discussion --userdir=users \
  31. --plugin=goodstuff \
  32. --plugin=haiku --plugin=polygen --plugin=fortune
  33. ./mdwn2man ikiwiki 1 doc/usage.mdwn > ikiwiki.man
  34. ./mdwn2man ikiwiki-mass-rebuild 8 doc/ikiwiki-mass-rebuild.mdwn > ikiwiki-mass-rebuild.man
  35. $(MAKE) -C po
  36. if [ "$$PROFILE" = 1 ]; then dprofpp; fi
  37. extra_clean:
  38. rm -rf html doc/.ikiwiki
  39. rm -f ikiwiki.man ikiwiki-mass-rebuild.man ikiwiki.out tmon.out
  40. $(MAKE) -C po clean
  41. extra_install:
  42. install -d $(DESTDIR)$(PREFIX)/share/ikiwiki/templates
  43. $(CP) -a templates/* $(DESTDIR)$(PREFIX)/share/ikiwiki/templates
  44. install -d $(DESTDIR)$(PREFIX)/share/ikiwiki/basewiki
  45. $(CP) -aL basewiki/* $(DESTDIR)$(PREFIX)/share/ikiwiki/basewiki
  46. install -d $(DESTDIR)$(PREFIX)/share/man/man1
  47. install -m 644 ikiwiki.man $(DESTDIR)$(PREFIX)/share/man/man1/ikiwiki.1
  48. install -d $(DESTDIR)$(PREFIX)/share/man/man8
  49. install -m 644 ikiwiki-mass-rebuild.man $(DESTDIR)$(PREFIX)/share/man/man8/ikiwiki-mass-rebuild.8
  50. install -d $(DESTDIR)$(PREFIX)/sbin
  51. install ikiwiki-mass-rebuild $(DESTDIR)$(PREFIX)/sbin
  52. install -d $(DESTDIR)$(PREFIX)/lib/w3m/cgi-bin
  53. install ikiwiki-w3m.cgi $(DESTDIR)$(PREFIX)/lib/w3m/cgi-bin
  54. install -d $(DESTDIR)$(PREFIX)/bin
  55. install ikiwiki.out $(DESTDIR)$(PREFIX)/bin/ikiwiki
  56. $(MAKE) -C po install PREFIX=$(PREFIX)
  57. }
  58. }
  59. WriteMakefile(
  60. NAME => 'IkiWiki',
  61. PREFIX => "/usr/local",
  62. PM_FILTER => './pm_filter $(PREFIX) $(VER) $(PROBABLE_INST_LIB)',
  63. MAN1PODS => {},
  64. PREREQ_PM => {
  65. 'XML::Simple' => 0,
  66. 'Text::Markdown' => 0,
  67. 'Date::Parse' => 0,
  68. 'HTML::Template' => 0,
  69. 'HTML::Scrubber' => 0,
  70. 'CGI::FormBuilder' => 3.02.02,
  71. 'Time::Duration' => 0,
  72. 'CGI::Session' => 0,
  73. 'Mail::Sendmail' => 0,
  74. 'HTML::Parser' => 0,
  75. 'URI' => 0,
  76. },
  77. );