actions.py 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128
  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. -Dprivlib=/usr/share/perl5/core_perl \
  53. -Darchlib=/usr/lib/perl5/%s/core_perl \
  54. -Dsitelib=/usr/share/perl5/site_perl \
  55. -Dsitearch=/usr/lib/perl5/%s/site_perl \
  56. -Dvendorlib=/usr/share/perl5/vendor_perl \
  57. -Dvendorarch=/usr/lib/perl5/%s/vendor_perl \
  58. -Dpager="/usr/bin/less -isr" \
  59. -Dd_gethostent_r_proto -Ud_endhostent_r_proto -Ud_sethostent_r_proto \
  60. -Ud_endprotoent_r_proto -Ud_setprotoent_r_proto \
  61. -Ud_endservent_r_proto -Ud_setservent_r_proto \
  62. -Dlibpth="/lib /usr/lib" \
  63. ' %(get.ARCH(), get.CC(), get.CFLAGS(), get.installDIR(), get.installDIR(), get.srcVERSION(), get.srcVERSION(), get.srcVERSION(), get.srcVERSION()))
  64. def build():
  65. # colorgcc uses Term::ANSIColor
  66. paths = get.ENV("PATH").split(":")
  67. if "/usr/share/colorgcc" in paths:
  68. paths.remove("/usr/share/colorgcc")
  69. shelltools.export("PATH", ":".join(paths))
  70. ##
  71. autotools.make()
  72. #def check():
  73. # autotools.make("-j1 test_harness")
  74. def install():
  75. autotools.rawInstall("DESTDIR=%s" % get.installDIR())
  76. pisitools.remove("/usr/bin/perl")
  77. # Conflicts with perl-Module-Build
  78. # pisitools.remove("/usr/bin/config_data")
  79. pisitools.dosym("/usr/bin/perl%s" % get.srcVERSION(), "/usr/bin/perl")
  80. # Perl5 library
  81. # NEEDS MODIFICATION FOR NEW VERSION
  82. pisitools.dosym("/usr/lib/perl5/%s/core_perl/CORE/libperl.so.%s" % (get.srcVERSION(), get.srcVERSION()), "/usr/lib/libperl.so")
  83. pisitools.dosym("/usr/lib/perl5/%s/core_perl/CORE/libperl.so.%s" % (get.srcVERSION(), get.srcVERSION()), "/usr/lib/libperl.so.5")
  84. pisitools.dosym("/usr/lib/perl5/%s/core_perl/CORE/libperl.so.%s" % (get.srcVERSION(), get.srcVERSION()), "/usr/lib/libperl.so.5.38")
  85. pisitools.dosym("/usr/lib/perl5/%s/core_perl/CORE/libperl.so.%s" % (get.srcVERSION(), get.srcVERSION()), "/usr/lib/libperl.so.5.38.2")
  86. # pisitools.dosym("/usr/lib/perl5/%s/%s-linux-thread-multi/CORE/libperl.so.%s" % (get.srcVERSION(), get.ARCH(), get.srcVERSION()), "/usr/lib/libperl.so")
  87. # 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")
  88. # 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.38")
  89. # 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.38.2")
  90. # Docs
  91. pisitools.dodir("/usr/share/doc/%s/html" % get.srcNAME())
  92. shelltools.system('LD_LIBRARY_PATH=%s ./perl installhtml \
  93. --podroot="." \
  94. --podpath="lib:ext:pod:vms" \
  95. --recurse \
  96. --htmldir="%s/usr/share/doc/%s/html"' % (get.curDIR(), get.installDIR(), get.srcNAME()))
  97. ### Arch linux Perl Settings ###
  98. # Change man page extensions for site and vendor module builds.
  99. # Set no mail address since bug reports should go to the bug tracker
  100. # and not someone's email.
  101. shelltools.system("""sed -e '/^man1ext=/ s/1perl/1p/' -e '/^man3ext=/ s/3perl/3pm/' \
  102. -e "/^cf_email=/ s/'.*'/''/" \
  103. -e "/^perladmin=/ s/'.*'/''/" \
  104. -i %s/usr/lib/perl5/%s/core_perl/Config_heavy.pl""" % (get.installDIR(), get.srcVERSION()))
  105. shelltools.system("""sed -e '/(makepl_arg =>/ s/""/"INSTALLDIRS=site"/' \
  106. -e '/(mbuildpl_arg =>/ s/""/"installdirs=site"/' \
  107. -i %s/usr/share/perl5/core_perl/CPAN/FirstTime.pm""" % get.installDIR())
  108. perlmodules.removePodfiles()
  109. perlmodules.removePacklist()
  110. pisitools.dodoc("Changes*", "Artistic", "Copying", "README", "AUTHORS")