summaryrefslogtreecommitdiff
path: root/bin/mksrcinfo
blob: a2c914522e10174454777014aafef33efa0a22a6 (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
    printf '\t'"${print}"' = %s\n' $(eval echo '${'"${print}"'[@]}')
    for a in 'i686'; do
      printf '\t'"${print}"' = %s\n' $(eval echo '${'"${print}_${a}"'[@]}')
    done
  done
  printf 'pkgname = %s\n' "${pkgname[@]}"
) > .SRCINFO