updated on Thu Jan 5 13:17:10 UTC 2012
[aur-mirror.git] / im-switch / PKGBUILD
blob9cd2da2d56500c2470b29ccbfd2d5c176ac00aff
1 # Maintainer: Xiao-Long Chen <chenxiaolong@cxl.epac.to>
3 pkgname=im-switch
4 pkgver=1.20ubuntu5
5 pkgrel=2
6 pkgdesc="Input method switch framework"
7 arch=('i686' 'x86_64')
8 url="http://packages.debian.org/sid/im-switch"
9 license=('GPL')
10 depends=()
11 makedepends=()
12 optdepends=('zenity: GUI for im-switch')
13 source=("http://archive.ubuntu.com/ubuntu/pool/main/i/${pkgname}/${pkgname}_${pkgver}.tar.gz")
14 sha512sums=('1a21dd5a680088e529b4390a7401030415c961e4706469f92bf17a8e7fe707e87721267300f7bf0579f3eee794b98f4f7719667f3216ed6ffb2bd15f5bbe26d6')
16 build() {
17   cd "${srcdir}/${pkgname}-${pkgver}"
18   #Disable dependency support as Ubuntu/Debian package names are different
19   #  from Arch Linux package names and other packages need to be patched to
20   #  change those dependencies. Also, dpkg doesn't work on Arch Linux.
21   sed -i -e '/^dependency().*$/ a #dpkg is only for Ubuntu/Debian, not Arch Linux\nreturn' im-switch.in
22   #Disable information message that tells the user to read a Debian only
23   #  documentation file.
24   sed -i -e 's/Please.*README.Debian.gz.*\$/$/g' im-switch.in
25   sed -i -e 's/Please.*README.Debian.gz//g' im-switch.in
26   #Remove some other Debian specific stuff
27   sed -i -e 's/using\ Debian.*mechanism.//g' im-switch.in
28   #Disable setting system IM, which requires dpkg's update-alternatives
29   sed -i -e '/When.*root/d' im-switch.in
30   sed -i -e '/#!/ a if [ $(id -u) == 0 ]; then echo "Running as root disabled. Setting the system IM only works under Debian/Ubuntu."; exit 1; fi' im-switch.in
31   sed -i -e 's/User choice.*default.//g' im-switch.in
33   sed -e "s/@@VERSION@@/${pkgver}/" <im-switch.in >im-switch
36 check() {
37   cd "${srcdir}/${pkgname}-${pkgver}"
38   msg "Nothing to check."
41 package() {
42   cd "${srcdir}/${pkgname}-${pkgver}"
43   install -dm755 "${pkgdir}/usr/bin/"
44   install -dm755 "${pkgdir}/usr/share/applications/"
45   install -dm755 "${pkgdir}/etc/X11/xinit/xinitrc.d/"
46   install -dm755 "${pkgdir}/etc/X11/xinit/xinput.d/"
47   install -m755 'im-switch' "${pkgdir}/usr/bin/"
48   install -m644 'im-switch.desktop' "${pkgdir}/usr/share/applications/"
49   install -m755 '80im-switch' "${pkgdir}/etc/X11/xinit/xinitrc.d/"
50   for i in xinput.d/*; do
51     install -m644 "${i}" "${pkgdir}/etc/X11/xinit/xinput.d/"
52   done
55 # vim:set ts=2 sw=2 et: