summaryrefslogtreecommitdiff
path: root/bin/mksrcinfo
blob: 795c52086fe90b53c65f9cca63b5bd0e35f0fc4f (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
#!/bin/bash

# generate .SRCINFO from PKGBUILD
#  bleh - this should really be handled by makepkg!

(
  CARCH='i686'

  . ./PKGBUILD

  if [ -z "${pkgbase}" ]; then
    printf 'pkgbase = %s\n' "${pkgname}"
  else
    printf 'pkgbase = %s\n' "${pkgbase}"
  fi
  printf '\tarch = %s\n' "${arch[@]}"
  printf '\tgroups = %s\n' "${groups[@]}"
  for print in 'makedepends' 'checkdepends' 'depends' 'provides'; do
    eval printf "'\t${print} = %s\n'" '"${'"${print}"'[@]}"'
    for a in 'i686'; do
      eval printf "'\t${print} = %s\n'" '"${'"${print}_${a}"'[@]}"'
    done
  done
  printf 'pkgname = %s\n' "${pkgname[@]}"
) > .SRCINFO