summaryrefslogtreecommitdiff
path: root/Makefile.PL
blob: d2266ad8e0aa60fdfc22037f092cb944f61fa9a9 (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. ikiwiki: ikiwiki.pl
  14. ./pm_filter $(PREFIX) $(VER) < ikiwiki.pl > ikiwiki
  15. extra_build:
  16. ./ikiwiki.pl doc html --templatedir=templates --underlaydir=basewiki \
  17. --wikiname="ikiwiki" --verbose --no-rcs \
  18. --exclude=/discussion --no-discussion \
  19. --plugin=brokenlinks --plugin=pagecount \
  20. --plugin=orphans --plugin=haiku --plugin=meta \
  21. --plugin=tag --plugin=polygen --plugin=pagestats \
  22. --plugin=fortune --plugin=aggregate --plugin=map \
  23. --plugin=template --plugin=toc
  24. ./mdwn2man ikiwiki 1 doc/usage.mdwn > ikiwiki.man
  25. ./mdwn2man ikiwiki-mass-rebuild 8 doc/ikiwiki-mass-rebuild.mdwn > ikiwiki-mass-rebuild.man
  26. extra_clean:
  27. rm -rf html doc/.ikiwiki
  28. rm -f ikiwiki.man ikiwiki-mass-rebuild.man
  29. extra_install:
  30. install -d $(DESTDIR)$(PREFIX)/share/ikiwiki/templates
  31. cp templates/* $(DESTDIR)$(PREFIX)/share/ikiwiki/templates
  32. install -d $(DESTDIR)$(PREFIX)/share/ikiwiki/basewiki
  33. cp -a basewiki/* $(DESTDIR)$(PREFIX)/share/ikiwiki/basewiki
  34. install -d $(DESTDIR)$(PREFIX)/share/man/man1
  35. install ikiwiki.man $(DESTDIR)$(PREFIX)/share/man/man1/ikiwiki.1
  36. install -d $(DESTDIR)$(PREFIX)/share/man/man8
  37. install ikiwiki-mass-rebuild.man $(DESTDIR)$(PREFIX)/share/man/man8/ikiwiki-mass-rebuild.8
  38. install -d $(DESTDIR)$(PREFIX)/sbin
  39. install ikiwiki-mass-rebuild $(DESTDIR)$(PREFIX)/sbin
  40. install -d $(DESTDIR)$(PREFIX)/lib/w3m/cgi-bin
  41. install ikiwiki-w3m.cgi $(DESTDIR)$(PREFIX)/lib/w3m/cgi-bin
  42. }
  43. }
  44. WriteMakefile(
  45. NAME => 'IkiWiki',
  46. PREFIX => "/usr/local",
  47. PM_FILTER => './pm_filter $(PREFIX) $(VER)',
  48. EXE_FILES => ['ikiwiki'],
  49. MAN1PODS => {},
  50. clean => {FILES => 'ikiwiki'},
  51. );