mktmpl.sh: now it asks you if pkg requires GNU make or libtool, and

adds the dependency automagically.

--HG--
extra : convert_revision : 790cfa2829b0f6db97f91fc1a070a92ec1e5e812
This commit is contained in:
Juan RP 2008-10-01 04:36:43 +02:00
parent 990247efe8
commit 1c7b760421
1 changed files with 30 additions and 4 deletions

View File

@ -39,6 +39,8 @@
: ${sed_cmd:=/usr/bin/sed}
: ${db_cmd:=/usr/bin/db -q}
required_deps=
write_new_template()
{
local tmpldir="$PKGFS_DISTRIBUTIONDIR/templates"
@ -87,12 +89,16 @@ write_new_template()
echo "extract_sufx=\"$pkg_sufx\""; \
echo "url=${url%%/$dfile}"; \
echo "build_style=$build_style"; \
if [ -n "$dep_gmake" ]; then \
echo "make_cmd=\"\$PKGFS_MASTERDIR/bin/gmake\""; \
fi; \
if [ -n "$pcfiles" ]; then \
echo "pkgconfig_override=\"$pcfiles\""; \
fi; \
echo "short_desc=\"$short_desc\""; \
echo "maintainer=\"$maintainer\""; \
echo "checksum=$checksum"; \
echo "longdesc=\"...\""; \
echo "long_desc=\"...\""; \
) > $tmpldir/$pkg.tmpl
if [ ! -r "$tmpldir/$pkg.tmpl" ]; then
@ -101,8 +107,9 @@ write_new_template()
fi
if [ -n "$deps" ]; then
[ -n "$pcfiles" ] && deps="pkg-config-0.23 $deps"
for i in $required_deps; do
deps="$i $deps"
done
$db_cmd -C -P 512 -w btree $depsdir/$pkg-deps.db deps \
"$deps" 2>&1 >/dev/null
[ "$?" -ne 0 ] && \
@ -154,8 +161,22 @@ read_parameters()
exit 1
fi
echo -n "Requires GNU libtool this package? (y) or (n): "
read dep_libtool
[ "$dep_libtool" = "y" ] && \
required_deps="libtool-2.2.6a $required_deps"
echo -n "Requires GNU make this package? (y) or (n): "
read dep_gmake
[ "$dep_gmake" = "y" ] && \
required_deps="gmake-3.81 $required_deps"
[ "$dep_gmake" = "n" ] && dep_gmake=
echo "Please enter exact dependencies required for this template."
echo "They must be separated by whitespaces, e.g: foo-1.0 blah-2.0"
echo "They must be separated by whitespaces, e.g: foo-1.0 blah-2.0."
echo
echo "There's no need to add gmake or pkg-config if you answered"
echo "yes before..."
echo -n "> "
read deps
[ -z "$deps" ] && echo "No dependencies, continuing..."
@ -177,6 +198,11 @@ read_parameters()
echo -n "> "
read short_desc
echo "Enter maintainer for this package, e.g: Anon <ymous.org>:"
echo "Alternatively press enter to ignore this question."
echo -n "> "
read maintainer
write_new_template
}