summaryrefslogtreecommitdiff
path: root/Makefile.PL
blob: 7123aef89a9ca4627e62ef1419f850a0976b12b2 (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
  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)/usr/share/ikiwiki/templates
  31. cp templates/* $(DESTDIR)/usr/share/ikiwiki/templates
  32. install -d $(DESTDIR)/usr/share/ikiwiki/basewiki
  33. cp -a basewiki/* $(DESTDIR)/usr/share/ikiwiki/basewiki
  34. install -d $(DESTDIR)/usr/share/man/man1
  35. install ikiwiki.man $(DESTDIR)/usr/share/man/man1/ikiwiki.1
  36. install -d $(DESTDIR)/usr/share/man/man8
  37. install ikiwiki-mass-rebuild.man $(DESTDIR)/usr/share/man/man8/ikiwiki-mass-rebuild.8
  38. install -d $(DESTDIR)/usr/sbin
  39. install ikiwiki-mass-rebuild $(DESTDIR)/usr/sbin
  40. install -d $(DESTDIR)/usr/lib/w3m/cgi-bin
  41. install ikiwiki-w3m.cgi $(DESTDIR)/usr/lib/w3m/cgi-bin
  42. }
  43. }
  44. WriteMakefile(
  45. 'NAME' => 'IkiWiki',
  46. 'PM_FILTER' => './pm_filter $(PREFIX) $(VER)',
  47. 'EXE_FILES' => ['ikiwiki'],
  48. 'MAN1PODS' => {},
  49. 'clean' => {FILES => 'ikiwiki'},
  50. );