summaryrefslogtreecommitdiff
path: root/Makefile.PL
blob: 5514a98ceb67615cd40af8fae7412cfea9b647be (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. tflag=$(shell if [ "$$NOTAINT" != 0 ]; then printf -- "-T"; fi)
  23. extramodules=$(shell if [ "$$PROFILE" = 1 ]; then printf -- "-MDevel::Profiler"; fi)
  24. extra_build:
  25. ./pm_filter $(PREFIX) $(VER) $(PROBABLE_INST_LIB) < ikiwiki.in > ikiwiki.out
  26. chmod +x ikiwiki.out
  27. LANG=C perl -I. $(extramodules) $(tflag) ikiwiki.out doc html --templatedir=templates \
  28. --underlaydir=basewiki --nousedirs\
  29. --wikiname="ikiwiki" --verbose \
  30. --exclude=/discussion --no-discussion --userdir=users \
  31. --plugin=goodstuff \
  32. --plugin=haiku --plugin=polygen --plugin=fortune
  33. ./mdwn2man ikiwiki 1 doc/usage.mdwn > ikiwiki.man
  34. ./mdwn2man ikiwiki-mass-rebuild 8 doc/ikiwiki-mass-rebuild.mdwn > ikiwiki-mass-rebuild.man
  35. $(MAKE) -C po
  36. if [ "$$PROFILE" = 1 ]; then dprofpp; fi
  37. extra_clean:
  38. rm -rf html doc/.ikiwiki
  39. rm -f ikiwiki.man ikiwiki-mass-rebuild.man ikiwiki.out
  40. $(MAKE) -C po clean
  41. extra_install:
  42. install -d $(DESTDIR)$(PREFIX)/share/ikiwiki
  43. for dir in `find basewiki templates -follow -type d ! -regex '.*\.svn.*'`; do \
  44. install -d $(DESTDIR)$(PREFIX)/share/ikiwiki/$$dir; \
  45. for file in `find $$dir -follow -maxdepth 1 -type f`; do \
  46. install -m 644 $$file $(DESTDIR)$(PREFIX)/share/ikiwiki/$$dir; \
  47. done; \
  48. done
  49. install -d $(DESTDIR)$(PREFIX)/share/man/man1
  50. install -m 644 ikiwiki.man $(DESTDIR)$(PREFIX)/share/man/man1/ikiwiki.1
  51. install -d $(DESTDIR)$(PREFIX)/share/man/man8
  52. install -m 644 ikiwiki-mass-rebuild.man $(DESTDIR)$(PREFIX)/share/man/man8/ikiwiki-mass-rebuild.8
  53. install -d $(DESTDIR)$(PREFIX)/sbin
  54. install ikiwiki-mass-rebuild $(DESTDIR)$(PREFIX)/sbin
  55. install -d $(DESTDIR)$(PREFIX)/lib/w3m/cgi-bin
  56. install ikiwiki-w3m.cgi $(DESTDIR)$(PREFIX)/lib/w3m/cgi-bin
  57. install -d $(DESTDIR)$(PREFIX)/bin
  58. install ikiwiki.out $(DESTDIR)$(PREFIX)/bin/ikiwiki
  59. $(MAKE) -C po install PREFIX=$(PREFIX)
  60. }
  61. }
  62. WriteMakefile(
  63. NAME => 'IkiWiki',
  64. PREFIX => "/usr/local",
  65. PM_FILTER => './pm_filter $(PREFIX) $(VER) $(PROBABLE_INST_LIB)',
  66. MAN1PODS => {},
  67. PREREQ_PM => {
  68. 'XML::Simple' => 0,
  69. 'Text::Markdown' => 0,
  70. 'Date::Parse' => 0,
  71. 'HTML::Template' => 0,
  72. 'HTML::Scrubber' => 0,
  73. 'CGI::FormBuilder' => 3.02.02,
  74. 'Time::Duration' => 0,
  75. 'CGI::Session' => 0,
  76. 'Mail::Sendmail' => 0,
  77. 'HTML::Parser' => 0,
  78. 'URI' => 0,
  79. },
  80. );