actions.py.uclibc 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117
  1. #!/usr/bin/python
  2. # -*- coding: utf-8 -*-
  3. #
  4. # Copyright 2009-2010 TUBITAK/UEKAE
  5. # Licensed under the GNU General Public License, version 2.
  6. # See the file http://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
  7. from pisi.actionsapi import shelltools
  8. from pisi.actionsapi import autotools
  9. from pisi.actionsapi import pisitools
  10. from pisi.actionsapi import get
  11. UCLIBC_ROOT = "/usr/lib/uClibc/"
  12. BUILD_FOR = ["system"]
  13. LOGO_FILE = "/usr/share/pixmaps/plymouth-pisilinux.png"
  14. THEMEPATH = "/usr/share/plymouth/themes"
  15. # The end-start colors seems to be used by the two-step plugin
  16. BASE_CONFIGURE_PARAMS = "--enable-tracing \
  17. --with-logo=%s \
  18. --with-release-file=/etc/pisilinux-release \
  19. --with-background-color=0x000000 \
  20. --with-background-end-color-stop=0x000000 \
  21. --with-background-start-color-stop=0x000000 \
  22. --with-system-root-install \
  23. --with-boot-tty=/dev/tty7 \
  24. --with-shutdown-tty=/dev/tty1 \
  25. --disable-tests \
  26. --disable-static \
  27. --disable-gdm-transition \
  28. --without-rhgb-compat-link \
  29. --without-gdm-autostart-file \
  30. --localstatedir=/var" % LOGO_FILE
  31. def setup():
  32. autotools.autoreconf("-fis")
  33. for directory in BUILD_FOR:
  34. shelltools.makedirs(directory)
  35. shelltools.sym("../configure", "%s/configure" % directory)
  36. def build_with_glibc():
  37. shelltools.cd("system")
  38. autotools.configure(BASE_CONFIGURE_PARAMS)
  39. autotools.make()
  40. shelltools.cd("..")
  41. def build_with_uclibc():
  42. shelltools.export("CC", "%s-uclibc-gcc" % get.ARCH())
  43. shelltools.export("LD", "%s-uclibc-ld" % get.ARCH())
  44. shelltools.cd("uclibc")
  45. # Symlink zlib.h, zconf.h, xf86drm.h and xf86drmMode.h
  46. shelltools.makedirs("include")
  47. for header in ("zlib.h", "zconf.h", "xf86drm.h", "xf86drmMode.h"):
  48. shelltools.sym("/usr/include/%s" % header, "include/%s" % header)
  49. shelltools.export("UCLIBC_GCC_INC", "-I%s/include" % get.curDIR())
  50. autotools.configure("%s \
  51. --build=%s-pc-linux-uclibc \
  52. --libdir=%s/usr/lib \
  53. --prefix=%s/usr" % (BASE_CONFIGURE_PARAMS,
  54. get.ARCH(),
  55. UCLIBC_ROOT,
  56. UCLIBC_ROOT))
  57. # Don't build these as they'll bring a lot of dependencies
  58. pisitools.dosed("src/Makefile", "viewer", "")
  59. pisitools.dosed("src/plugins/controls/Makefile", "label", "")
  60. # Filter out generic targets
  61. pisitools.dosed("Makefile", "^SUBDIRS.*$", "SUBDIRS = src")
  62. # Don't create /var/*/plymouth
  63. pisitools.dosed("src/Makefile", "^.*\$\(MAKE\).*install-data-hook", "")
  64. # No need to x11 renderer in initramfs
  65. pisitools.dosed("src/plugins/renderers/Makefile", "^(SUBDIRS = .*) x11", "\\1")
  66. autotools.make()
  67. shelltools.cd("..")
  68. def build():
  69. build_with_glibc()
  70. if "uclibc" in BUILD_FOR:
  71. build_with_uclibc()
  72. def install():
  73. shelltools.touch("Makefile")
  74. if "uclibc" in BUILD_FOR:
  75. autotools.rawInstall("-C uclibc DESTDIR='%s'" % get.installDIR())
  76. autotools.rawInstall("-C system DESTDIR='%s'" % get.installDIR())
  77. # Copy necessary files for Charge theme
  78. pisitools.dodir("%s/charge" % THEMEPATH)
  79. for f in ("box", "bullet", "entry", "lock"):
  80. shelltools.copy("%s%s/glow/%s.png" % (get.installDIR(), THEMEPATH, f), "%s%s/charge/" % (get.installDIR(), THEMEPATH))
  81. # Remove glow theme as it's premature
  82. pisitools.removeDir("/usr/share/plymouth/themes/glow")
  83. # Remove fedora scripts
  84. pisitools.remove("/usr/libexec/plymouth/*")
  85. # Generate initramfs filelist
  86. #shelltools.system("./generate-flist %s" % get.installDIR())
  87. pisitools.dodoc("TODO", "COPYING", "README", "ChangeLog")