actions.py 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. movetobin = ["arch", "basename", "cat", "chgrp", "chmod", "chown", "cp", "cut", "date", "dd", "df",
  11. "dir", "echo", "env", "false", "link", "ln", "ls", "mkdir", "mknod", "mktemp", "mv",
  12. "nice", "pwd", "readlink", "rm", "rmdir", "sleep", "sort", "stty", "sync", "touch",
  13. "true", "uname", "unlink", "vdir"]
  14. symtousrbin = ["env", "cut", "readlink"]
  15. def setup():
  16. pisitools.cflags.add("-fno-strict-aliasing -fPIC -D_GNU_SOURCE=1")
  17. #shelltools.export("gl_cv_func_printf_directive_n", "yes")
  18. #shelltools.export("gl_cv_func_isnanl_works", "yes")
  19. shelltools.export("DEFAULT_POSIX2_VERSION", "200112")
  20. shelltools.export("AUTOPOINT", "true")
  21. shelltools.export("FORCE_UNSAFE_CONFIGURE","1")
  22. shelltools.export("AT_M4DIR", "m4")
  23. autotools.autoreconf("-vfi")
  24. # Fedora also installs su and hostname
  25. autotools.configure("--enable-largefile \
  26. --enable-install-program=arch \
  27. --enable-no-install-program=faillog,hostname,login,lastlog,uptime \
  28. --libexecdir=/usr/lib")
  29. def build():
  30. autotools.make()
  31. def check():
  32. # check does horrible things like modifying mtab or loop mounting
  33. # use it if you are too curious
  34. # autotools.make("check")
  35. pass
  36. def install():
  37. autotools.rawInstall("DESTDIR=%s" % get.installDIR())
  38. autotools.make("mandir=%s/%s install-man" % (get.installDIR(), get.manDIR()))
  39. #~ autotools.install("mandir=%s/%s" % (get.installDIR(), get.manDIR()))
  40. # Use dircolors from the package
  41. pisitools.insinto("/etc", "src/dircolors.hin", "DIR_COLORS")
  42. # move critical files into /bin
  43. for f in movetobin:
  44. pisitools.domove("/usr/bin/%s" % f, "/bin/")
  45. for f in symtousrbin:
  46. pisitools.dosym("../../bin/%s" % f, "/usr/bin/%s" % f)
  47. pisitools.dodoc("AUTHORS", "ChangeLog*", "NEWS", "README*", "THANKS", "TODO")