summaryrefslogtreecommitdiff
path: root/extra/system-config-printer/PKGBUILD
blob: d6c9ea12608188d4722aa480a8999a4cd7e95dd8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
# $Id: PKGBUILD 117485 2011-04-04 07:01:13Z andrea $
# Maintainer: Andrea Scarpino <andrea@archlinux.org>

pkgbase=system-config-printer
pkgname=('system-config-printer-common'
	'system-config-printer-gnome')
pkgver=1.3.2
pkgrel=1
pkgdesc="A CUPS printer configuration tool and status applet"
url="http://cyberelk.net/tim/software/system-config-printer/"
arch=('i686' 'x86_64' 'mips64el')
license=('GPL')
makedepends=('intltool' 'python2' 'xmlto' 'docbook-xsl' 'desktop-file-utils' 'libcups' 'libxml2')
source=("http://cyberelk.net/tim/data/${pkgbase}/1.3/${pkgbase}-${pkgver}.tar.xz")
md5sums=('34a0ce9a11be5695b3b4065e4f17b009')

build() {
  cd ${srcdir}/${pkgbase}-${pkgver}
  
  sed -i -e "s|#![ ]*/usr/bin/python$|#!/usr/bin/python2|" \
    -e "s|#![ ]*/usr/bin/env python$|#!/usr/bin/env python2|" \
    $(find . -name '*.py')
  sed -i "s|#!/usr/bin/python|#!/usr/bin/python2|" udev/udev-add-printer 

  ./configure --prefix=/usr \
    --sbindir=/usr/bin \
    --sysconfdir=/etc \
    --with-udev-rules

  make
}

package_system-config-printer-common() {
  pkgdesc='Pygtk CUPS Configuration'
  depends=('pycups' 'dbus-python' 'pysmbc')
  optdepends=('system-config-printer-gnome: for the GTK frontend'
	'kdeadmin-system-config-printer-kde: for the administration tool in KDE System Settings')
  replaces=('system-config-printer')
  provides=("system-config-printer=${pkgver}")
  conflicts=('system-config-printer')

  cd ${srcdir}/${pkgbase}-${pkgver}
  install -d ${pkgdir}/usr/share/${pkgbase}
  install -m644 config.py \
    debug.py \
    installpackage.py \
    monitor.py \
    PhysicalDevice.py \
    ppdippstr.py \
    probe_printer.py \
    SearchCriterion.py \
    smburi.py \
    statereason.py \
    XmlHelper.py \
    ${pkgdir}/usr/share/${pkgbase}/

  install -m755 pysmb.py \
    ${pkgdir}/usr/share/${pkgbase}/

  install -d ${pkgdir}/etc/dbus-1/system.d/
  install -m644 dbus/com.redhat.NewPrinterNotification.conf \
    dbus/com.redhat.PrinterDriversInstaller.conf \
    ${pkgdir}/etc/dbus-1/system.d/
  install -d ${pkgdir}/etc/cupshelpers/
  install -m644 xml/preferreddrivers.xml ${pkgdir}/etc/cupshelpers/

  install -d ${pkgdir}/lib/udev/rules.d
  install -m755 udev/{udev-add-printer,udev-configure-printer} \
    ${pkgdir}/lib/udev/
  install -m644 udev/70-printers.rules \
    ${pkgdir}/lib/udev/rules.d

  for file in build/lib/cupshelpers/*.py; do
    install -Dm644 $file \
      ${pkgdir}/usr/lib/python2.7/site-packages/cupshelpers/$(basename $file)
  done
}

package_system-config-printer-gnome() {
  pkgdesc='A CUPS printer configuration tool and status applet - GTK frontend'
  depends=('system-config-printer-common' 'gnome-icon-theme' 'python-notify')
  optdependence=('gnome-keyring: password management')

  cd ${srcdir}/${pkgbase}-${pkgver}
  make DESTDIR="${pkgdir}" install

  # files provided by system-config-printer-common
  cd ${pkgdir}/usr/share/${pkgbase}
  rm config.py \
    debug.py \
    installpackage.py \
    monitor.py \
    PhysicalDevice.py \
    ppdippstr.py \
    probe_printer.py \
    SearchCriterion.py \
    smburi.py \
    statereason.py \
    XmlHelper.py \
    pysmb.py
  rm -r ${pkgdir}/etc/dbus-1/
  rm -r ${pkgdir}/etc/cupshelpers/
  rm -r ${pkgdir}/etc/udev/
  rm -r ${pkgdir}/usr/lib/
}