summaryrefslogtreecommitdiff
path: root/bin/mksrcinfo
blob: 40cb7d097bd327b04a4183227707b0aaabf0571b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash

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

(
  . ./PKGBUILD

  if [ -z "${pkgbase}" ]; then
    printf 'pkgbase = %s\n' "${pkgname}"
  else
    printf 'pkgbase = %s\n' "${pkgbase}"
  fi
  printf '\tarch = %s\n' "${arch[@]}"
  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