summaryrefslogtreecommitdiff
path: root/Makefile.PL
blob: 1f46e9c957e9fff375b2ff308e05425768416d92 (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. perl -pe '$$_="" if /use lib/; $$_="our \$$version=\"$(VER)\";\n" if /VERSION_AUTOREPLACE/' 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
  23. ./mdwn2man ikiwiki 1 doc/usage.mdwn > ikiwiki.man
  24. ./mdwn2man ikiwiki-mass-rebuild 8 doc/ikiwiki-mass-rebuild.mdwn > ikiwiki-mass-rebuild.man
  25. extra_clean:
  26. rm -rf html doc/.ikiwiki
  27. rm -f ikiwiki.man ikiwiki-mass-rebuild.man
  28. extra_install:
  29. install -d $(PREFIX)/share/ikiwiki/templates
  30. cp templates/* $(PREFIX)/share/ikiwiki/templates
  31. install -d $(PREFIX)/share/ikiwiki/basewiki
  32. cp -a basewiki/* $(PREFIX)/share/ikiwiki/basewiki
  33. install -d $(PREFIX)/share/man/man1
  34. install ikiwiki.man $(PREFIX)/share/man/man1/ikiwiki.1
  35. install -d $(PREFIX)/share/man/man8
  36. install ikiwiki-mass-rebuild.man $(PREFIX)/share/man/man8/ikiwiki-mass-rebuild.8
  37. install -d $(PREFIX)/sbin
  38. install ikiwiki-mass-rebuild $(PREFIX)/sbin
  39. install -d $(PREFIX)/lib/w3m/cgi-bin
  40. install ikiwiki-w3m.cgi $(PREFIX)/lib/w3m/cgi-bin
  41. }
  42. }
  43. WriteMakefile(
  44. 'NAME' => 'IkiWiki',
  45. 'PM_FILTER' => 'grep -v "removed by Makefile"',
  46. 'EXE_FILES' => ['ikiwiki'],
  47. 'clean' => {FILES => 'ikiwiki'},
  48. );