actions.py 3.5 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. Libdir = "/usr/lib32" if get.buildTYPE() == "emul32" else "/usr/lib"
  11. def setup():
  12. #pisitools.flags.add("-fstack-protector-all", "-DLDAP_DEPRECATED=1")
  13. pisitools.dosed("config-scripts/cups-sharedlibs.m4", "( -shared )", " -Wl,--as-needed\\1")
  14. # For --enable-avahi
  15. autotools.aclocal("-I config-scripts")
  16. autotools.autoconf("-f -I config-scripts")
  17. options = '--with-cups-user=daemon \
  18. --with-cups-group=lp \
  19. --with-system-groups=lpadmin \
  20. --with-docdir=/usr/share/cups/html \
  21. --with-dbusdir=/etc/dbus-1 \
  22. --with-optim="%s" \
  23. --with-php=/usr/bin/php-cgi \
  24. --with-cupsd-file-perm=0755 \
  25. --with-log-file-perm=0600 \
  26. --enable-acl \
  27. --enable-libpaper \
  28. --enable-debug \
  29. --enable-gssapi \
  30. --enable-dbus \
  31. --enable-pam=yes \
  32. --enable-relro \
  33. --enable-browsing \
  34. --enable-raw-printing \
  35. --with-tls=gnutls \
  36. --disable-libusb \
  37. --with-rcdir=no \
  38. --libdir=%s \
  39. --disable-systemd \
  40. --with-pkgconfpath=%s/pkgconfig \
  41. --with-logdir=/var/log/cups \
  42. KRB5CONFIG=/usr/bin/krb5-config \
  43. --localstatedir=/var \
  44. --with-rundir=/run/cups \
  45. --with-xinetd=/etc/xinetd.d \
  46. ' % (get.CFLAGS(), Libdir, Libdir)
  47. if get.buildTYPE() == "emul32":
  48. options += ' \
  49. --prefix=/usr \
  50. --enable-libusb=no \
  51. --with-dnssd=no \
  52. --disable-gssapi \
  53. --disable-systemd \
  54. --disable-dbus \
  55. --bindir=/usr/bin32 \
  56. --sbindir=/usr/sbin32'
  57. else:
  58. options += " --with-dnssd=yes"
  59. autotools.configure(options)
  60. def build():
  61. autotools.make()
  62. #def check():
  63. #autotools.make("check")
  64. def install():
  65. if get.buildTYPE() == "emul32":
  66. # SERVERBIN is hardcoded to /usr/lib/cups, thus it overwrites 64 bit libraries
  67. autotools.rawInstall("BUILDROOT=%s SERVERBIN=%s/usr/serverbin32 install-libs" % (get.installDIR(), get.installDIR()))
  68. pisitools.domove("/usr/bin32/cups-config", "/usr/bin", "cups-config-32bit")
  69. pisitools.removeDir("/usr/bin32")
  70. pisitools.removeDir("/usr/sbin32")
  71. pisitools.removeDir("/usr/serverbin32")
  72. # remove files now part of cups-filters
  73. #pisitools.remove("/usr/share/cups/data/testprint")
  74. pisitools.removeDir("/usr/share/cups/banners")
  75. pisitools.dodir("/usr/share/cups/banners")
  76. pisitools.dosed("%s/usr/bin/cups-config-32bit" % get.installDIR(), "bin32", "bin")
  77. return
  78. autotools.rawInstall("BUILDROOT=%s install-headers install-libs install-data install-exec" % get.installDIR())
  79. shelltools.chmod("%s/run/cups/certs" % get.installDIR(), 0755)
  80. pisitools.dodir("/usr/share/cups/profiles")
  81. # Serial backend needs to run as root
  82. #shelltools.chmod("%s/usr/lib/cups/backend/serial" % get.installDIR(), 0700)
  83. pisitools.dodoc("LICENSE", "README*", "CHANGES*")