summaryrefslogtreecommitdiff
path: root/Makefile.PL
blob: ab67aae7410b7ad0386dc034c9ba6d485b2c4ff8 (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 --userdir=users \
  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. $(MAKE) -C po
  32. extra_clean:
  33. rm -rf html doc/.ikiwiki
  34. rm -f ikiwiki.man ikiwiki-mass-rebuild.man ikiwiki.out
  35. $(MAKE) -C po clean
  36. extra_install:
  37. install -d $(DESTDIR)$(PREFIX)/share/ikiwiki/templates
  38. $(CP) -a templates/* $(DESTDIR)$(PREFIX)/share/ikiwiki/templates
  39. install -d $(DESTDIR)$(PREFIX)/share/ikiwiki/basewiki
  40. $(CP) -a basewiki/* $(DESTDIR)$(PREFIX)/share/ikiwiki/basewiki
  41. install -d $(DESTDIR)$(PREFIX)/share/man/man1
  42. install -m 644 ikiwiki.man $(DESTDIR)$(PREFIX)/share/man/man1/ikiwiki.1
  43. install -d $(DESTDIR)$(PREFIX)/share/man/man8
  44. install -m 644 ikiwiki-mass-rebuild.man $(DESTDIR)$(PREFIX)/share/man/man8/ikiwiki-mass-rebuild.8
  45. install -d $(DESTDIR)$(PREFIX)/sbin
  46. install ikiwiki-mass-rebuild $(DESTDIR)$(PREFIX)/sbin
  47. install -d $(DESTDIR)$(PREFIX)/lib/w3m/cgi-bin
  48. install ikiwiki-w3m.cgi $(DESTDIR)$(PREFIX)/lib/w3m/cgi-bin
  49. install -d $(DESTDIR)$(PREFIX)/bin
  50. install ikiwiki.out $(DESTDIR)$(PREFIX)/bin/ikiwiki
  51. $(MAKE) -C po install
  52. }
  53. }
  54. WriteMakefile(
  55. NAME => 'IkiWiki',
  56. PREFIX => "/usr/local",
  57. PM_FILTER => './pm_filter $(PREFIX) $(VER) $(PROBABLE_INST_LIB)',
  58. MAN1PODS => {},
  59. );