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