summaryrefslogtreecommitdiff
path: root/Makefile.PL
blob: 6e75097c899c50919a9a3d9db97bf353cd052023 (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. ./ikiwiki.in doc html --templatedir=templates --underlaydir=basewiki \
  24. --wikiname="ikiwiki" --verbose --no-rcs \
  25. --exclude=/discussion --no-discussion \
  26. --plugin=brokenlinks --plugin=pagecount \
  27. --plugin=orphans --plugin=haiku --plugin=meta \
  28. --plugin=tag --plugin=polygen --plugin=pagestats \
  29. --plugin=fortune --plugin=aggregate --plugin=map \
  30. --plugin=template --plugin=toc --plugin=shortcut
  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. ./pm_filter $(PREFIX) $(VER) $(PROBABLE_INST_LIB) < ikiwiki.in > ikiwiki.out
  34. extra_clean:
  35. rm -rf html doc/.ikiwiki
  36. rm -f ikiwiki.man ikiwiki-mass-rebuild.man ikiwiki.out
  37. extra_install:
  38. install -d $(DESTDIR)$(PREFIX)/share/ikiwiki/templates
  39. $(CP) -a templates/* $(DESTDIR)$(PREFIX)/share/ikiwiki/templates
  40. install -d $(DESTDIR)$(PREFIX)/share/ikiwiki/basewiki
  41. $(CP) -a basewiki/* $(DESTDIR)$(PREFIX)/share/ikiwiki/basewiki
  42. install -d $(DESTDIR)$(PREFIX)/share/man/man1
  43. install ikiwiki.man $(DESTDIR)$(PREFIX)/share/man/man1/ikiwiki.1
  44. install -d $(DESTDIR)$(PREFIX)/share/man/man8
  45. install ikiwiki-mass-rebuild.man $(DESTDIR)$(PREFIX)/share/man/man8/ikiwiki-mass-rebuild.8
  46. install -d $(DESTDIR)$(PREFIX)/sbin
  47. install ikiwiki-mass-rebuild $(DESTDIR)$(PREFIX)/sbin
  48. install -d $(DESTDIR)$(PREFIX)/lib/w3m/cgi-bin
  49. install ikiwiki-w3m.cgi $(DESTDIR)$(PREFIX)/lib/w3m/cgi-bin
  50. install -d $(DESTDIR)$(PREFIX)/bin
  51. install ikiwiki.out $(DESTDIR)$(PREFIX)/bin/ikiwiki
  52. }
  53. }
  54. WriteMakefile(
  55. NAME => 'IkiWiki',
  56. PREFIX => "/usr/local",
  57. PM_FILTER => './pm_filter $(PREFIX) $(VER) $(PROBABLE_INST_LIB)',
  58. MAN1PODS => {},
  59. );