summaryrefslogtreecommitdiffstats
path: root/config
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2019-05-14 00:45:26 (EDT)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2019-05-14 00:45:26 (EDT)
commit5ffe422c55ff2c2c7fd71b1fc9b5fdd57cb2d003 (patch)
treec11158d1ea5da13df07ae6227b539db38d1c21cf /config
parent684070063d26cc30ac270f85394536f918e12f42 (diff)
config: Make version-agnostic
Diffstat (limited to 'config')
-rwxr-xr-xconfig19
1 files changed, 10 insertions, 9 deletions
diff --git a/config b/config
index 3821ab7..2d66848 100755
--- a/config
+++ b/config
@@ -2,7 +2,9 @@
set -e
-TPL_PKGS='gcc-4.7 g++-4.7'
+OPK_SOURCE="$(sed 's/ .*//; q;' changelog)"
+BASE_VERSION="${OPK_SOURCE#gcc-}"
+TPL_PKGS='gcc g++'
main()
{
@@ -35,7 +37,7 @@ main()
msg()
{
- printf 'gcc-4.7 config: '
+ printf "${OPK_SOURCE} config: "
printf "${@}"
printf '\n'
}
@@ -50,12 +52,11 @@ configure_build()
# Write metadata for <pkgbase>-<target> packages.
for _pkg in ${TPL_PKGS}; do
- mkdir -p "${_pkg}-${PKG_TARGET_ARCH}.pkg"
- sed "${_ss}" "${_pkg}.pkg.in/control" \
- >"${_pkg}-${PKG_TARGET_ARCH}.pkg/control"
- cp "${_pkg}.pkg.in/files" "${_pkg}-${PKG_TARGET_ARCH}.pkg/files"
- msg 'Metadata for package "%s" generated.' \
- "${_pkg}-${PKG_TARGET_ARCH}"
+ _out_pkg="${_pkg}-${BASE_VERSION}-${PKG_TARGET_ARCH}"
+ mkdir -p "${_out_pkg}.pkg"
+ sed "${_ss}" "${_pkg}.pkg.in/control" >"${_out_pkg}.pkg/control"
+ cp "${_pkg}.pkg.in/files" "${_out_pkg}.pkg/files"
+ msg 'Metadata for package "%s" generated.' "${_out_pkg}"
done
}
@@ -63,7 +64,7 @@ clean()
{
# Remove generated metadata for <pkgbase>-<target> packages.
for _pkg in ${TPL_PKGS}; do
- rm -Rf "${_pkg}"-*-*-*.pkg/
+ rm -Rf "${_pkg}-${BASE_VERSION}"-*-*-*.pkg/
done
}