summaryrefslogtreecommitdiff
path: root/Makefile.PL
blob: a6292a4223e50b6797b6c541871276d8e08d64df (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=goodstuff \
  27. --plugin=haiku --plugin=polygen --plugin=fortune
  28. ./mdwn2man ikiwiki 1 doc/usage.mdwn > ikiwiki.man
  29. ./mdwn2man ikiwiki-mass-rebuild 8 doc/ikiwiki-mass-rebuild.mdwn > ikiwiki-mass-rebuild.man
  30. ./pm_filter $(PREFIX) $(VER) $(PROBABLE_INST_LIB) < ikiwiki.in > ikiwiki.out
  31. extra_clean:
  32. rm -rf html doc/.ikiwiki
  33. rm -f ikiwiki.man ikiwiki-mass-rebuild.man ikiwiki.out
  34. extra_install:
  35. install -d $(DESTDIR)$(PREFIX)/share/ikiwiki/templates
  36. $(CP) -a templates/* $(DESTDIR)$(PREFIX)/share/ikiwiki/templates
  37. install -d $(DESTDIR)$(PREFIX)/share/ikiwiki/basewiki
  38. $(CP) -a basewiki/* $(DESTDIR)$(PREFIX)/share/ikiwiki/basewiki
  39. install -d $(DESTDIR)$(PREFIX)/share/man/man1
  40. install -m 644 ikiwiki.man $(DESTDIR)$(PREFIX)/share/man/man1/ikiwiki.1
  41. install -d $(DESTDIR)$(PREFIX)/share/man/man8
  42. install -m 644 ikiwiki-mass-rebuild.man $(DESTDIR)$(PREFIX)/share/man/man8/ikiwiki-mass-rebuild.8
  43. install -d $(DESTDIR)$(PREFIX)/sbin
  44. install ikiwiki-mass-rebuild $(DESTDIR)$(PREFIX)/sbin
  45. install -d $(DESTDIR)$(PREFIX)/lib/w3m/cgi-bin
  46. install ikiwiki-w3m.cgi $(DESTDIR)$(PREFIX)/lib/w3m/cgi-bin
  47. install -d $(DESTDIR)$(PREFIX)/bin
  48. install ikiwiki.out $(DESTDIR)$(PREFIX)/bin/ikiwiki
  49. }
  50. }
  51. WriteMakefile(
  52. NAME => 'IkiWiki',
  53. PREFIX => "/usr/local",
  54. PM_FILTER => './pm_filter $(PREFIX) $(VER) $(PROBABLE_INST_LIB)',
  55. MAN1PODS => {},
  56. );