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