actions.py 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105
  1. #!/usr/bin/python
  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 pisi.actionsapi import get
  7. from pisi.actionsapi import autotools
  8. from pisi.actionsapi import pisitools
  9. from pisi.actionsapi import shelltools
  10. from pisi.actionsapi import perlmodules
  11. KeepSpecial=["perl"]
  12. def setup():
  13. # use system zlib
  14. shelltools.unlinkDir("cpan/Compress-Raw-Zlib/zlib-src")
  15. pisitools.dosed("MANIFEST", "zlib-src", deleteLine=True)
  16. pisitools.dosed("cpan/Compress-Raw-Zlib/config.in", "(BUILD_ZLIB\s+=\s)True", r"\1False")
  17. pisitools.dosed("cpan/Compress-Raw-Zlib/config.in", "(INCLUDE\s+=\s)\.\/zlib-src", r"\1/usr/include")
  18. pisitools.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. -Dccdlflags="-rdynamic -Wl,--enable-new-dtags" \
  26. -Dcc=%s \
  27. -Dprefix=/usr \
  28. -Dvendorprefix=/usr \
  29. -Dsiteprefix=/usr \
  30. -Ulocincpth= \
  31. -Doptimize="%s" \
  32. -Duselargefiles \
  33. -Dusethreads \
  34. -Duseithreads \
  35. -Dd_semctl_semun \
  36. -Dscriptdir=/usr/bin \
  37. -Dman1dir=/usr/share/man/man1 \
  38. -Dman3dir=/usr/share/man/man3 \
  39. -Dinstallman1dir=%s/usr/share/man/man1 \
  40. -Dinstallman3dir=%s/usr/share/man/man3 \
  41. -Dlibperl=libperl.so.%s \
  42. -Duseshrplib \
  43. -Dman1ext=1 \
  44. -Dman3ext=3pm \
  45. -Dcf_by="PisiLinux" \
  46. -Ud_csh \
  47. -Di_ndbm \
  48. -Di_gdbm \
  49. -Di_db \
  50. -Ubincompat5005 \
  51. -Uversiononly \
  52. -Dpager="/usr/bin/less -isr" \
  53. -Dd_gethostent_r_proto -Ud_endhostent_r_proto -Ud_sethostent_r_proto \
  54. -Ud_endprotoent_r_proto -Ud_setprotoent_r_proto \
  55. -Ud_endservent_r_proto -Ud_setservent_r_proto \
  56. -Dlibpth="/lib /usr/lib" \
  57. ' %(get.ARCH(), get.CC(), get.CFLAGS(), get.installDIR(), get.installDIR(), get.srcVERSION()))
  58. def build():
  59. # colorgcc uses Term::ANSIColor
  60. paths = get.ENV("PATH").split(":")
  61. if "/usr/share/colorgcc" in paths:
  62. paths.remove("/usr/share/colorgcc")
  63. shelltools.export("PATH", ":".join(paths))
  64. ##
  65. autotools.make()
  66. #def check():
  67. # autotools.make("-j1 test_harness")
  68. def install():
  69. autotools.rawInstall("DESTDIR=%s" % get.installDIR())
  70. pisitools.remove("/usr/bin/perl")
  71. # Conflicts with perl-Module-Build
  72. # pisitools.remove("/usr/bin/config_data")
  73. pisitools.dosym("/usr/bin/perl%s" % get.srcVERSION(), "/usr/bin/perl")
  74. # Perl5 library
  75. # NEEDS MODIFICATION FOR NEW VERSION
  76. pisitools.dosym("/usr/lib/perl5/%s/%s-linux-thread-multi/CORE/libperl.so.%s" % (get.srcVERSION(), get.ARCH(), get.srcVERSION()), "/usr/lib/libperl.so")
  77. pisitools.dosym("/usr/lib/perl5/%s/%s-linux-thread-multi/CORE/libperl.so.%s" % (get.srcVERSION(), get.ARCH(), get.srcVERSION()), "/usr/lib/libperl.so.5")
  78. pisitools.dosym("/usr/lib/perl5/%s/%s-linux-thread-multi/CORE/libperl.so.%s" % (get.srcVERSION(), get.ARCH(), get.srcVERSION()), "/usr/lib/libperl.so.5.24")
  79. pisitools.dosym("/usr/lib/perl5/%s/%s-linux-thread-multi/CORE/libperl.so.%s" % (get.srcVERSION(), get.ARCH(), get.srcVERSION()), "/usr/lib/libperl.so.5.24.0")
  80. # Docs
  81. pisitools.dodir("/usr/share/doc/%s/html" % get.srcNAME())
  82. shelltools.system('LD_LIBRARY_PATH=%s ./perl installhtml \
  83. --podroot="." \
  84. --podpath="lib:ext:pod:vms" \
  85. --recurse \
  86. --htmldir="%s/usr/share/doc/%s/html"' % (get.curDIR(), get.installDIR(), get.srcNAME()))
  87. perlmodules.removePodfiles()
  88. perlmodules.removePacklist()
  89. pisitools.dodoc("Changes*", "Artistic", "Copying", "README", "AUTHORS")