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