summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: 371acfd09f1493cf1ce848cb2c923087d19f6cdb (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
# Maintainer: Chris Severance aur.severach aATt spamgourmet dott com
# Maintainer: RunningDroid <runningdroid AT zoho.com>
# Contributor: Daniel Micay <danielmicay@gmail.com>
# Contributor: Soup <soup a.t soultrap d.o.t n.e.t>
# Contributor: Andres Perera <aepd87@gmail.com>

set -u
pkgname='checkbashisms'
pkgver='20160930'
# To get the date of the last commit for this file
# Be in the tree for the .pl file
# https://anonscm.debian.org/cgit/collab-maint/devscripts.git/tree/scripts/checkbashisms.pl
# Click [log] tab
# To see the diff, click on the commit
pkgrel='1'
pkgdesc='Debian script that checks for bashisms'
arch=('any')
url='http://packages.qa.debian.org/d/devscripts.html'
license=('GPL')
depends=('perl')
conflicts=('devscripts')
_srcfile="checkbashisms.pl.${pkgver}"
_srcbash='checkbashisms.bash_completion.20160915'
source=("${_srcfile}::https://anonscm.debian.org/cgit/collab-maint/devscripts.git/plain/scripts/checkbashisms.pl"
        'https://anonscm.debian.org/cgit/collab-maint/devscripts.git/plain/scripts/checkbashisms.1'
        "${_srcbash}::https://anonscm.debian.org/cgit/collab-maint/devscripts.git/plain/scripts/checkbashisms.bash_completion" # https://anonscm.debian.org/cgit/collab-maint/devscripts.git/log/scripts/checkbashisms.bash_completion?qt=grep&q=
)
sha256sums=('b2a599079e34293d479ab8e11e1c1782b7707606032771b83d706c897eb1d419'
            'c74d1ed33fee4cf2ccca0d7690d404d551a4edcbde0ddc602104d9198359cefb'
            '35031c64e3b1f96777444f7bdf725d085e71eccccf93ff10b0b6ac539225637b')

# Version checking devscripts won't help us. We need to watch for changes to this file.
_vercheck() { :; }
_verscan() {
  local _rv=1
  [ "$1" -ne 0 ] && _rv=0
  local _rvfile=''
  local _remfile="$(sha256sum < <(curl -s "${source[0]##*::}") | cut -d' ' -f1)"
  if [ "${_remfile}" != "${sha256sums[0]}" ]; then
    local _vercmp=1
    [ "$2" -ge 3 ] && printf '%-s %s\n' "${_vercmp}" "${_remfile}" 1>&2
    if [ "${_vercmp}" -ge 1 ]; then
      [ "$2" -eq 2 ] && echo "${_remfile}"
      _rvfile="${_remfile}"
      _rv=0
    fi
  fi
  [ "$2" -eq 1 -o "$2" -eq 4 ] && echo "${_rvfile}"
  return ${_rv}
}
#_verscan 0 4; exit 1

package() {
  set -u
  cd "${pkgdir}"
  install -Dpm755 "${srcdir}/${_srcfile}" 'usr/bin/checkbashisms'
  sed -i -e "s,###VERSION###,${pkgver},g" 'usr/bin/checkbashisms'
  install -Dpm644 "${srcdir}/checkbashisms.1" 'usr/share/man/man1/checkbashisms.1'
  install -Dpm644 "${srcdir}/${_srcbash}" 'usr/share/bash-completion/completions/checkbashisms'
  set +u
}
set +u