summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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
}