actions.py 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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. def builddiet():
  11. autotools.make("clean")
  12. shelltools.export("GCC", "diet %s %s %s %s -DHAVE_STDINT_H -Os -static" % (get.CC(), get.CFLAGS(), get.CXXFLAGS(), get.LDFLAGS()))
  13. autotools.make("CXFLAGS='%s -DNO_LIBUDEV' mdadm.static" % get.CFLAGS())
  14. #autotools.make("mdassemble.static")
  15. pisitools.insinto("/sbin", "mdadm.static")
  16. #pisitools.insinto("/sbin", "mdassemble.static")
  17. def build():
  18. # fix build with gcc-4.9.0
  19. pisitools.dosed("Makefile", "(Wall) -Werror", "\\1")
  20. # Not sure about MDASSEMBLE_AUTO=1. Need to investigate.
  21. autotools.make("CXFLAGS='%s -DNO_LIBUDEV' SYSCONFDIR=/%s MDASSEMBLE_AUTO=1 mdadm mdmon" % (get.CFLAGS(), get.confDIR()))
  22. def install():
  23. autotools.rawInstall("DESTDIR=%s" % get.installDIR())
  24. # Remove the udev file as its shipped with udev package
  25. pisitools.remove("/lib/udev/rules.d/*")
  26. # Install config file
  27. pisitools.insinto("/etc", "mdadm.conf-example", "mdadm.conf")
  28. builddiet()
  29. pisitools.dodoc("TODO", "ChangeLog", "COPYING", "mdadm.conf-example", "misc/*")