summaryrefslogtreecommitdiff
path: root/Makefile.PL
blob: 130484a7c1035185168da1b963dbdbebb3db5981 (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= perl -I. $(extramodules) $(tflag) ikiwiki.out doc html --templatedir=templates \
  29. --underlaydir=underlays/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. ./mdwn2man ikiwiki-update-wikilist 1 doc/ikiwiki-update-wikilist.mdwn > ikiwiki-update-wikilist.man
  37. $(MAKE) -C po
  38. if [ "$$PROFILE" = 1 ]; then dprofpp; fi
  39. extra_clean:
  40. rm -rf html doc/.ikiwiki
  41. rm -f ikiwiki.man ikiwiki-mass-rebuild.man ikiwiki-update-wikilist.man ikiwiki.out
  42. $(MAKE) -C po clean
  43. extra_install:
  44. install -d $(DESTDIR)$(PREFIX)/share/ikiwiki
  45. for dir in `cd underlays && find . -follow -type d ! -regex '.*\.svn.*'`; do \
  46. install -d $(DESTDIR)$(PREFIX)/share/ikiwiki/$$dir; \
  47. for file in `find underlays/$$dir -follow -maxdepth 1 -type f`; do \
  48. install -m 644 $$file $(DESTDIR)$(PREFIX)/share/ikiwiki/$$dir; \
  49. done; \
  50. done
  51. for dir in `find templates -follow -type d ! -regex '.*\.svn.*'`; do \
  52. install -d $(DESTDIR)$(PREFIX)/share/ikiwiki/$$dir; \
  53. for file in `find $$dir -follow -maxdepth 1 -type f`; do \
  54. install -m 644 $$file $(DESTDIR)$(PREFIX)/share/ikiwiki/$$dir; \
  55. done; \
  56. done
  57. install -d $(DESTDIR)$(PREFIX)/lib/ikiwiki/plugins
  58. for file in `find plugins -maxdepth 1 -type f`; do \
  59. install -m 755 $$file $(DESTDIR)$(PREFIX)/lib/ikiwiki/plugins; \
  60. done; \
  61. install -d $(DESTDIR)$(PREFIX)/share/man/man1
  62. install -m 644 ikiwiki.man $(DESTDIR)$(PREFIX)/share/man/man1/ikiwiki.1
  63. install -m 644 ikiwiki-update-wikilist.man $(DESTDIR)$(PREFIX)/share/man/man1/ikiwiki-update-wikilist.1
  64. install -d $(DESTDIR)$(PREFIX)/share/man/man8
  65. install -m 644 ikiwiki-mass-rebuild.man $(DESTDIR)$(PREFIX)/share/man/man8/ikiwiki-mass-rebuild.8
  66. install -d $(DESTDIR)$(PREFIX)/sbin
  67. install ikiwiki-mass-rebuild $(DESTDIR)$(PREFIX)/sbin
  68. install -d $(DESTDIR)$(PREFIX)/lib/w3m/cgi-bin
  69. install ikiwiki-w3m.cgi $(DESTDIR)$(PREFIX)/lib/w3m/cgi-bin
  70. install -d $(DESTDIR)$(PREFIX)/bin
  71. install ikiwiki.out $(DESTDIR)$(PREFIX)/bin/ikiwiki
  72. $(MAKE) -C po install
  73. }
  74. }
  75. WriteMakefile(
  76. NAME => 'IkiWiki',
  77. PREFIX => "/usr/local",
  78. PM_FILTER => './pm_filter $(PREFIX) $(VER) $(PROBABLE_INST_LIB)',
  79. MAN1PODS => {},
  80. PREREQ_PM => {
  81. 'XML::Simple' => 0,
  82. 'Text::Markdown' => 0,
  83. 'Date::Parse' => 0,
  84. 'HTML::Template' => 0,
  85. 'HTML::Scrubber' => 0,
  86. 'CGI::FormBuilder' => 3.02.02,
  87. 'Time::Duration' => 0,
  88. 'CGI::Session' => 0,
  89. 'Mail::Sendmail' => 0,
  90. 'HTML::Parser' => 0,
  91. 'URI' => 0,
  92. },
  93. );