actions.py 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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. pisitools.cflags.add("-D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -D_FILE_OFFSET_BITS=64")
  11. pisitools.cflags.sub("-O[\d]", "-Os")
  12. def setup():
  13. shelltools.export("SUID_CFLAGS", "-fpie")
  14. shelltools.export("SUID_LDFLAGS", "-pie -Wl,-z,relro -Wl,-z,now")
  15. shelltools.export("AUTOPOINT", "/bin/true")
  16. options = "\
  17. --disable-rpath \
  18. --disable-silent-rules \
  19. --disable-use-tty-group \
  20. --disable-su \
  21. --disable-last \
  22. --disable-mesg \
  23. --disable-vipw \
  24. --disable-wall \
  25. --disable-login \
  26. --disable-newgrp \
  27. --disable-nologin \
  28. --disable-runuser \
  29. --disable-sulogin \
  30. --disable-utmpdump \
  31. --disable-chfn-chsh \
  32. --without-systemd \
  33. --without-selinux \
  34. --enable-gtk-doc-html=no \
  35. --disable-makeinstall-chown \
  36. --disable-socket-activation \
  37. --without-systemdsystemunitdir \
  38. "
  39. if get.buildTYPE() == "emul32":
  40. options += "\
  41. --prefix=/emul32 \
  42. --bindir=/emul32/bin \
  43. --sbindir=/emul32/sbin \
  44. --libdir=/usr/lib32 \
  45. --without-ncurses \
  46. --disable-static \
  47. --disable-partx \
  48. --disable-raw \
  49. --disable-write \
  50. --disable-mount \
  51. --disable-fsck \
  52. --disable-libmount \
  53. --disable-mountpoint \
  54. --with-audit=no \
  55. "
  56. else:
  57. options += "\
  58. --bindir=/bin \
  59. --sbindir=/sbin \
  60. --enable-partx \
  61. --disable-raw \
  62. --enable-write \
  63. --enable-tunelp \
  64. --enable-runuser \
  65. --without-audit \
  66. --with-udev \
  67. --enable-mountpoint \
  68. --without-utempter \
  69. "
  70. shelltools.system("NOCONFIGURE=1 ./autogen.sh")
  71. #autotools.autoreconf("-fi")
  72. autotools.configure(options)
  73. pisitools.dosed("libtool", "( -shared )", r" -Wl,--as-needed\1")
  74. # Extra fedora switches:
  75. # --enable-login-utils will enable some utilities we ship in shadow
  76. # --enable-kill will enable the kill utility we ship in coreutils
  77. def build():
  78. autotools.make()
  79. def install():
  80. autotools.rawInstall("DESTDIR=%s" % get.installDIR())
  81. #pisitools.doman("sys-utils/klogconsole.man")
  82. pisitools.remove("/usr/share/man/man1/kill.1")
  83. #pisitools.remove("/usr/share/bash-completion/completions/rfkill")
  84. if get.buildTYPE() == "emul32": return
  85. #pisitools.removeDir("/usr/lib32/pkgconfig")
  86. pisitools.dodoc("ABOUT-NLS", "AUTHORS", "ChangeLog", "COPYING", "README*")
  87. pisitools.insinto("/%s/%s" % (get.docDIR(), get.srcNAME()), "Documentation")