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