summarylogtreecommitdiffstats
path: root/PKGBUILD
blob: dc1e04662657af9dc7a91d884c18c2333f8fc0ad (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
# Maintainer: Simon Wilper <sxw@chronowerks.de>
pkgname=whatwg-html
pkgver=2023.1
pkgrel=1
pkgdesc="Clone the WHATWG HTML specification with local resources"
arch=('any')
url="https://www.github.com/whatwg/html-build"
license=('GPL')
makedepends=(git perl perl-lwp-protocol-https)

_gitroot=https://www.github.com/whatwg/html-build.git/
_gitname='html-build'
_htmlroot=https://github.com/whatwg/html.git/
_html='html'

prepare() {
  cd "$srcdir"
  msg "Connecting to GIT server..."

  if [[ -d "$_gitname" ]]; then
    msg "Updating..."
    cd "$_gitname" && git pull origin
    msg "The local files are updated."
  else
    msg "Cloning..."
    git clone "$_gitroot" "$_gitname"
    cd "$_gitname"
    msg "Clone completed."
  fi

  msg "Cloning ${_gitname}"

  if [[ -d "$_html" ]]; then
    msg "Updating..."
    cd "$_html" && git pull origin
    msg "The local files are updated."
  else
    msg "Cloning..."
    git clone --depth 5 "$_htmlroot" "$_html"
    cd "$_html"
    msg "Clone completed."
  fi
}

build() {
  cd "${srcdir}/${_gitname}"
  msg "Starting build..."

  cd html
  mv source source.orig

  msg "Downloading Resources and Patching source"
  perl ../../../download-resources.pl source.orig source
  cd ..
  ./build.sh -f
  mv html/resources output/
}

package() {
  cd "$srcdir/${_gitname}"

  mkdir -p ${pkgdir}/usr/share/doc/whatwg/
  cp -rv output/* ${pkgdir}/usr/share/doc/whatwg/
}