summaryrefslogtreecommitdiffstats
path: root/abs/extra/dcraw/PKGBUILD
blob: 9c2571bd326ca6ec15e28124f3a92ad8d7e70b78 (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
# $Id: PKGBUILD 162767 2012-06-29 22:10:56Z eric $
# Maintainer: tobias <tobias@archlinux.org>
# Contributor: Tobias Kieslich <tobias@justdreams.de>

pkgname=dcraw
pkgver=9.15
pkgrel=1
pkgdesc="A command line based converter for digicams raw output"
arch=('i686' 'x86_64')
url="http://www.cybercom.net/~dcoffin/dcraw/"
license=('custom')
depends=('lcms' 'jasper')
source=(http://www.cybercom.net/~dcoffin/dcraw/archive/${pkgname}-${pkgver}.tar.gz
        license.txt)
sha1sums=('0b06047603640fe19b5d3b2461319d6ba22eee6a'
          '502c8f0ac7434d48f5dcb2eefe7599627cb69454')

build() {
  cd "${srcdir}/${pkgname}"
  gcc ${CFLAGS} -O3 -o dcraw dcraw.c \
    -Wall -Wno-unused-result -Wno-array-bounds \
    -lm -ljasper -ljpeg -llcms -DLOCALEDIR=\"/usr/share/locale/\"
}

package() {
  cd "${srcdir}/${pkgname}"
  install -Dm755 dcraw "${pkgdir}"/usr/bin/dcraw
  install -Dm644 dcraw.1 "${pkgdir}"/usr/share/man/man1/dcraw.1
  
  for langchar in \
    fr.latin1 it.latin1 de.latin1 pt.latin1 es.latin1 nl.latin1 sv.latin1 \
    ca.latin1 da.latin1 cs.latin2 hu.latin2 pl.latin2 eo.latin3 ru.koi8-r \
    zh_TW.big5 zh_CN.gb2312
  do
    lang=$(echo $langchar | cut -d. -f1)
    char=$(echo $langchar | cut -d. -f2-)
    if [ -f dcraw_${lang}.1 ]; then
      mkdir -p -m 755 "${pkgdir}"/usr/share/man/$lang/man1
      iconv -f utf-8 -t $char dcraw_$lang.1 > "${pkgdir}"/usr/share/man/$lang/man1/dcraw.1
      mkdir -p -m 755 "${pkgdir}"/usr/share/man/$lang.UTF-8/man1
      cp dcraw_$lang.1 "${pkgdir}"/usr/share/man/$lang.UTF-8/man1/dcraw.1
    fi
    mkdir -p -m 755 "${pkgdir}"/usr/share/locale/$lang/LC_MESSAGES
    msgfmt -o "${pkgdir}"/usr/share/locale/$lang/LC_MESSAGES/dcraw.mo dcraw_$lang.po
  done

  install -Dm644 "${srcdir}/license.txt" "${pkgdir}"/usr/share/licenses/${pkgname}/license.txt
}