actions.py 4.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. #!/usr/bin/env python3
  2. # -*- coding: utf-8 -*-
  3. #
  4. # Licensed under the GNU General Public License, version 3.
  5. # See the file http://www.gnu.org/licenses/gpl.txt
  6. from inary.actionsapi import get
  7. from inary.actionsapi import autotools
  8. from inary.actionsapi import inarytools
  9. from inary.actionsapi import shelltools
  10. from inary.actionsapi import perlmodules
  11. KeepSpecial=["perl"]
  12. def setup():
  13. # use system zlib
  14. shelltools.unlinkDir("cpan/Compress-Raw-Zlib/zlib-src")
  15. inarytools.dosed("MANIFEST", "zlib-src", deleteLine=True)
  16. inarytools.dosed("cpan/Compress-Raw-Zlib/config.in", "(BUILD_ZLIB\s+=\s)True", r"\1False")
  17. inarytools.dosed("cpan/Compress-Raw-Zlib/config.in", "(INCLUDE\s+=\s)\.\/zlib-src", r"\1/usr/include")
  18. inarytools.dosed("cpan/Compress-Raw-Zlib/config.in", "(LIB\s+=\s)\.\/zlib-src", r"\1/usr/lib")
  19. shelltools.export("LC_ALL", "C")
  20. #fix one of tests
  21. #shelltools.system('sed -i "s#version vutil.c .*#version vutil.c f1c7e4778fcf78c04141f562b80183b91cbbf6c9#" t/porting/customized.dat')
  22. shelltools.system('sh Configure -des \
  23. -Darchname=%s-linux \
  24. -Dcccdlflags=-fPIC \
  25. -Dusedevel \
  26. -Dccdlflags="-rdynamic -Wl,--enable-new-dtags" \
  27. -Dcc=%s \
  28. -Dprefix=/usr \
  29. -Dvendorprefix=/usr \
  30. -Dsiteprefix=/usr \
  31. -Ulocincpth= \
  32. -Doptimize="%s" \
  33. -Duselargefiles \
  34. -Dusethreads \
  35. -Duseithreads \
  36. -Dd_semctl_semun \
  37. -Dscriptdir=/usr/bin \
  38. -Dman1dir=/usr/share/man/man1 \
  39. -Dman3dir=/usr/share/man/man3 \
  40. -Dinstallman1dir=%s/usr/share/man/man1 \
  41. -Dinstallman3dir=%s/usr/share/man/man3 \
  42. -Dlibperl=libperl.so.%s \
  43. -Duseshrplib \
  44. -Dman1ext=1 \
  45. -Dman3ext=3pm \
  46. -Dcf_by="Sulin" \
  47. -Ud_csh \
  48. -Di_ndbm \
  49. -Di_gdbm \
  50. -Di_db \
  51. -Ubincompat5005 \
  52. -Uversiononly \
  53. -Dpager="/usr/bin/less -isr" \
  54. -Dd_gethostent_r_proto -Ud_endhostent_r_proto -Ud_sethostent_r_proto \
  55. -Ud_endprotoent_r_proto -Ud_setprotoent_r_proto \
  56. -Ud_endservent_r_proto -Ud_setservent_r_proto \
  57. -Dlibpth="/lib /usr/lib" \
  58. ' %(get.ARCH(), get.CC(), get.CFLAGS(), get.installDIR(), get.installDIR(), get.srcVERSION()))
  59. def build():
  60. # colorgcc uses Term::ANSIColor
  61. paths = get.ENV("PATH").split(":")
  62. if "/usr/share/colorgcc" in paths:
  63. paths.remove("/usr/share/colorgcc")
  64. shelltools.export("PATH", ":".join(paths))
  65. ##
  66. autotools.make()
  67. #def check():
  68. # autotools.make("-j1 test_harness")
  69. def install():
  70. autotools.rawInstall("DESTDIR=%s" % get.installDIR())
  71. inarytools.remove("/usr/bin/perl")
  72. # Conflicts with perl-Module-Build
  73. # inarytools.remove("/usr/bin/config_data")
  74. inarytools.dosym("/usr/bin/perl%s" % get.srcVERSION(), "/usr/bin/perl")
  75. # Perl5 library
  76. # NEEDS MODIFICATION FOR NEW VERSION
  77. inarytools.dosym("/usr/lib/perl5/%s/%s-linux-thread-multi/CORE/libperl.so.%s" % (get.srcVERSION(), get.ARCH(), get.srcVERSION()), "/usr/lib/libperl.so")
  78. inarytools.dosym("/usr/lib/perl5/%s/%s-linux-thread-multi/CORE/libperl.so.%s" % (get.srcVERSION(), get.ARCH(), get.srcVERSION()), "/usr/lib/libperl.so.5")
  79. inarytools.dosym("/usr/lib/perl5/%s/%s-linux-thread-multi/CORE/libperl.so.%s" % (get.srcVERSION(), get.ARCH(), get.srcVERSION()), "/usr/lib/libperl.so.5.26")
  80. inarytools.dosym("/usr/lib/perl5/%s/%s-linux-thread-multi/CORE/libperl.so.%s" % (get.srcVERSION(), get.ARCH(), get.srcVERSION()), "/usr/lib/libperl.so.5.26.1")
  81. # Docs
  82. inarytools.dodir("/usr/share/doc/%s/html" % get.srcNAME())
  83. shelltools.system('LD_LIBRARY_PATH=%s ./perl installhtml \
  84. --podroot="." \
  85. --podpath="lib:ext:pod:vms" \
  86. --recurse \
  87. --htmldir="%s/usr/share/doc/%s/html"' % (get.curDIR(), get.installDIR(), get.srcNAME()))
  88. perlmodules.removePodfiles()
  89. perlmodules.removePacklist()
  90. inarytools.dodoc("Changes*", "Artistic", "Copying", "README", "AUTHORS")