summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 46ffc44f4382d0e0e0d69f2add0db21eae2dd70f (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
# Maintainer:  Luigi Guevara <@killua99>
# Maintainer:  twa022 <twa022 at gmail dot com>
# Author:      Lorenzo Carbonell <lorenzo.carbonell.cerezo@gmail.com>
# Contributor: tari01

_pkgname=my-weather-indicator
pkgname=my-weather-indicator-git
epoch=1
pkgver=0.9.5.0+r137+9cf392b
pkgrel=1
pkgdesc='A simple indicator for the weather'
arch=('any')
url='https://github.com/atareao/my-weather-indicator'
license=('GPL3')
depends=('libappindicator-gtk3' 'libnotify' 'webkit2gtk' 'geocode-glib' 'python-pytz'
         'python-cairo' 'python-lxml' 'python-dateutil' 'osm-gps-map'
         'python-requests-oauthlib' 'geoclue' 'geoip')
makedepends=('git')
provides=("${_pkgname}")
conflicts=("${_pkgname}")
source=("${_pkgname}::git+https://github.com/atareao/my-weather-indicator")
sha256sums=('SKIP')

pkgver() {
    cd "$srcdir/${pkgname%-git}"
    printf "%s+r%s+%s" \
      "$(head -n 1 debian/changelog | cut -d'(' -f 2 | cut -d')' -f 1 | sed 's/-/./;s:[^0-9\.].*::')" \
      "$(git rev-list --count HEAD)" \
      "$(git rev-parse --short HEAD)"
}

prepare() {
  cd "${_pkgname}"

  # Don't install to /opt and install locales to correct directory
  find . -type f -exec \
    sed -i -e 's:/opt/extras.ubuntu.com/my-weather-indicator:/usr:g' \
           -e 's:locale-langpack:locale:g' '{}' \;
  # Create a script to install the translations from the debian rules file
  grep -A 1000 "Create languages directories" debian/rules | \
    grep -B 1000 "End comile languages" | \
    sed "s:\${CURDIR}/debian/my-weather-indicator:\"${pkgdir}\":g" > make_translations.sh
  chmod +x make_translations.sh
  # Missing newline at the end of the file makes the package function not install the file on the last line 
  # echo -e >> debian/install
}

package() {
  cd "${_pkgname}"
  while read _in _out ; do
    mkdir -p "${pkgdir}/${_out}/"
    cp -r ${_in} "${pkgdir}/${_out}/"
  done < debian/install
  find "${pkgdir}" -type d -exec chmod 755 '{}' \;  
  find "${pkgdir}" -type f -exec chmod 644 '{}' \;
  chmod 755 "${pkgdir}"/usr/bin/my-weather-indicator
  ./make_translations.sh
}