summaryrefslogtreecommitdiff
path: root/Makefile.PL
blob: 4f6b051797f72a6a3e7671b321ce0c6d340954ba (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
  43. find basewiki templates \( -type f -or -type l \) ! -regex '.*\.svn.*' \
  44. -exec cp --parents -aL {} $(DESTDIR)$(PREFIX)/share/ikiwiki \;
  45. install -d $(DESTDIR)$(PREFIX)/share/man/man1
  46. install -m 644 ikiwiki.man $(DESTDIR)$(PREFIX)/share/man/man1/ikiwiki.1
  47. install -d $(DESTDIR)$(PREFIX)/share/man/man8
  48. install -m 644 ikiwiki-mass-rebuild.man $(DESTDIR)$(PREFIX)/share/man/man8/ikiwiki-mass-rebuild.8
  49. install -d $(DESTDIR)$(PREFIX)/sbin
  50. install ikiwiki-mass-rebuild $(DESTDIR)$(PREFIX)/sbin
  51. install -d $(DESTDIR)$(PREFIX)/lib/w3m/cgi-bin
  52. install ikiwiki-w3m.cgi $(DESTDIR)$(PREFIX)/lib/w3m/cgi-bin
  53. install -d $(DESTDIR)$(PREFIX)/bin
  54. install ikiwiki.out $(DESTDIR)$(PREFIX)/bin/ikiwiki
  55. $(MAKE) -C po install PREFIX=$(PREFIX)
  56. }
  57. }
  58. WriteMakefile(
  59. NAME => 'IkiWiki',
  60. PREFIX => "/usr/local",
  61. PM_FILTER => './pm_filter $(PREFIX) $(VER) $(PROBABLE_INST_LIB)',
  62. MAN1PODS => {},
  63. PREREQ_PM => {
  64. 'XML::Simple' => 0,
  65. 'Text::Markdown' => 0,
  66. 'Date::Parse' => 0,
  67. 'HTML::Template' => 0,
  68. 'HTML::Scrubber' => 0,
  69. 'CGI::FormBuilder' => 3.02.02,
  70. 'Time::Duration' => 0,
  71. 'CGI::Session' => 0,
  72. 'Mail::Sendmail' => 0,
  73. 'HTML::Parser' => 0,
  74. 'URI' => 0,
  75. },
  76. );