summaryrefslogtreecommitdiff
path: root/Makefile.PL
blob: dad0fedcad58424157ee9d3dfbb259a48ae7b14a (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 [ -n "$$NOTAINT" ] && [ "$$NOTAINT" != 1 ]; 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. perl -Iblib/lib $(extramodules) $(tflag) ikiwiki.out -libdir . -setup docwiki.setup -refresh
  29. ./mdwn2man ikiwiki 1 doc/usage.mdwn > ikiwiki.man
  30. ./mdwn2man ikiwiki-mass-rebuild 8 doc/ikiwiki-mass-rebuild.mdwn > ikiwiki-mass-rebuild.man
  31. ./mdwn2man ikiwiki-makerepo 1 doc/ikiwiki-makerepo.mdwn > ikiwiki-makerepo.man
  32. ./mdwn2man ikiwiki-transition 1 doc/ikiwiki-transition.mdwn > ikiwiki-transition.man
  33. ./mdwn2man ikiwiki-update-wikilist 1 doc/ikiwiki-update-wikilist.mdwn > ikiwiki-update-wikilist.man
  34. $(MAKE) -C po
  35. if [ "$$PROFILE" = 1 ]; then dprofpp; fi
  36. extra_clean:
  37. rm -rf html doc/.ikiwiki
  38. rm -f *.man ikiwiki.out
  39. rm -f plugins/*.pyc
  40. $(MAKE) -C po clean
  41. extra_install:
  42. install -d $(DESTDIR)$(PREFIX)/share/ikiwiki
  43. for dir in `cd underlays && find . -follow -type d ! -regex '.*\.svn.*'`; do \
  44. install -d $(DESTDIR)$(PREFIX)/share/ikiwiki/$$dir; \
  45. for file in `find underlays/$$dir -follow -maxdepth 1 -type f`; do \
  46. install -m 644 $$file $(DESTDIR)$(PREFIX)/share/ikiwiki/$$dir; \
  47. done; \
  48. done
  49. for dir in `find templates -follow -type d ! -regex '.*\.svn.*'`; do \
  50. install -d $(DESTDIR)$(PREFIX)/share/ikiwiki/$$dir; \
  51. for file in `find $$dir -follow -maxdepth 1 -type f`; do \
  52. install -m 644 $$file $(DESTDIR)$(PREFIX)/share/ikiwiki/$$dir; \
  53. done; \
  54. done
  55. install -d $(DESTDIR)$(PREFIX)/lib/ikiwiki/plugins
  56. for file in `find plugins -maxdepth 1 -type f ! -wholename plugins/.\*`; do \
  57. install -m 755 $$file $(DESTDIR)$(PREFIX)/lib/ikiwiki/plugins; \
  58. done; \
  59. install -d $(DESTDIR)$(PREFIX)/share/man/man1
  60. install -m 644 ikiwiki.man $(DESTDIR)$(PREFIX)/share/man/man1/ikiwiki.1
  61. install -m 644 ikiwiki-makerepo.man $(DESTDIR)$(PREFIX)/share/man/man1/ikiwiki-makerepo.1
  62. install -m 644 ikiwiki-transition.man $(DESTDIR)$(PREFIX)/share/man/man1/ikiwiki-transition.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. install ikiwiki-makerepo ikiwiki-transition ikiwiki-update-wikilist $(DESTDIR)$(PREFIX)/bin/
  73. $(MAKE) -C po install DESTDIR=$(DESTDIR) PREFIX=$(PREFIX)
  74. }
  75. }
  76. WriteMakefile(
  77. NAME => 'IkiWiki',
  78. PREFIX => "/usr/local",
  79. PM_FILTER => './pm_filter $(PREFIX) $(VER) $(PROBABLE_INST_LIB)',
  80. MAN1PODS => {},
  81. PREREQ_PM => {
  82. 'XML::Simple' => 0,
  83. 'Text::Markdown' => 0,
  84. 'Date::Parse' => 0,
  85. 'HTML::Template' => 0,
  86. 'HTML::Scrubber' => 0,
  87. 'CGI::FormBuilder' => 3.02.02,
  88. 'Time::Duration' => 0,
  89. 'CGI::Session' => 0,
  90. 'Mail::Sendmail' => 0,
  91. 'HTML::Parser' => 0,
  92. 'URI' => 0,
  93. 'Data::Dumper' => 2.11,
  94. },
  95. );