actions.py 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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. shelltools.export("LC_ALL", "en_US.UTF-8")
  11. def setup():
  12. shelltools.export("CONFIG_SHELL", "/bin/bash")
  13. autotools.configure("--with-usrlibdir=/usr/lib \
  14. --with-usrsbindir=%s \
  15. --with-confdir=/etc \
  16. --with-udevdir=/lib/udev/rules.d \
  17. --with-default-pid-dir=/run \
  18. --with-default-run-dir=/run/lvm \
  19. --with-default-locking-dir=/run/lock/lvm \
  20. --with-device-uid=0 \
  21. --with-device-gid=6 \
  22. --with-device-mode=0660 \
  23. --with-cache=internal \
  24. --with-snapshots=internal \
  25. --with-mirrors=internal \
  26. --with-thin=internal \
  27. --with-interface=ioctl \
  28. --enable-udev_rules \
  29. --enable-udev_sync \
  30. --disable-selinux \
  31. --enable-readline \
  32. --enable-fsadm \
  33. --enable-applib \
  34. --enable-cmdlib \
  35. --enable-pkgconfig \
  36. --enable-dmeventd \
  37. --enable-lvmetad \
  38. --enable-lvmpolld" % get.sbinDIR())
  39. # pisitools.dosed("make.tmpl","-lm","")
  40. def build():
  41. autotools.make()
  42. def install():
  43. autotools.rawInstall('DESTDIR=%s' % get.installDIR())
  44. for dir in ["archive", "backup", "cache"]:
  45. pisitools.dodir("/etc/lvm/%s" % dir)
  46. shelltools.chmod(get.installDIR() + "/etc/lvm/%s" % dir, 0755)
  47. shelltools.chown(get.installDIR() + "/etc/lvm/%s" % dir, uid = 'root', gid = 'root')
  48. shelltools.system("sed -i 's,use_lvmetad = 1,use_lvmetad = 1,' %s/etc/lvm/lvm.conf" % get.installDIR())
  49. # no systemd
  50. pisitools.remove("/lib/udev/rules.d/69-dm-lvm.rules")
  51. #pisitools.move("/sbin/lvmconf","scripts/lvmconf.sh")
  52. pisitools.dodoc("COPYING", "COPYING.LIB", "README", "VERSION", "WHATS_NEW") # "VERSION_DM", "WHATS_NEW_DM"