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