actions.py 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  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. --disable-mountpoint \
  33. --disable-makeinstall-chown \
  34. --disable-socket-activation \
  35. "
  36. if get.buildTYPE() == "emul32":
  37. options += "\
  38. --prefix=/emul32 \
  39. --bindir=/emul32/bin \
  40. --sbindir=/emul32/sbin \
  41. --libdir=/usr/lib32 \
  42. --without-ncurses \
  43. --disable-static \
  44. --disable-partx \
  45. --disable-raw \
  46. --disable-write \
  47. --disable-mount \
  48. --disable-fsck \
  49. --disable-libmount \
  50. --with-audit=no \
  51. "
  52. else:
  53. options += "\
  54. --bindir=/bin \
  55. --sbindir=/sbin \
  56. --enable-partx \
  57. --enable-raw \
  58. --enable-write \
  59. --enable-tunelp \
  60. --enable-runuser \
  61. --without-audit \
  62. --with-udev \
  63. --without-utempter \
  64. "
  65. autotools.autoreconf("-fi")
  66. autotools.configure(options)
  67. pisitools.dosed("libtool", "( -shared )", r" -Wl,--as-needed\1")
  68. # Extra fedora switches:
  69. # --enable-login-utils will enable some utilities we ship in shadow
  70. # --enable-kill will enable the kill utility we ship in coreutils
  71. def build():
  72. autotools.make()
  73. def install():
  74. autotools.rawInstall("DESTDIR=%s" % get.installDIR())
  75. #pisitools.doman("sys-utils/klogconsole.man")
  76. pisitools.remove("/usr/share/man/man1/kill.1")
  77. if get.buildTYPE() == "emul32": return
  78. #pisitools.removeDir("/usr/lib32/pkgconfig")
  79. pisitools.dodoc("ABOUT-NLS", "AUTHORS", "ChangeLog", "COPYING", "README*")
  80. pisitools.insinto("/%s/%s" % (get.docDIR(), get.srcNAME()), "Documentation")