mirror of
ssh://git.janware.com/srv/git/janware/proj/jw-pkg
synced 2026-01-30 16:28:40 +01:00
janware-create-project.py: Add support for -g pkg-group and .gitignore
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
534ff384e1
commit
ff664c6804
1 changed files with 26 additions and 3 deletions
|
|
@ -18,7 +18,7 @@ fatal()
|
||||||
|
|
||||||
usage()
|
usage()
|
||||||
{
|
{
|
||||||
echo "$myname [-h] [-s summary] [-d description] name"
|
echo "$myname [-h] [-s summary] [-d description] [-g pkg-group] name"
|
||||||
[ "$1" ] && exit $1
|
[ "$1" ] && exit $1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -76,7 +76,7 @@ cat_make_project_conf()
|
||||||
$description
|
$description
|
||||||
|
|
||||||
[global]
|
[global]
|
||||||
group = System/Libraries
|
group = "$pkg_group"
|
||||||
subpackages = $subpackages
|
subpackages = $subpackages
|
||||||
|
|
||||||
[pkg.required.jw]
|
[pkg.required.jw]
|
||||||
|
|
@ -86,6 +86,24 @@ cat_make_project_conf()
|
||||||
EOT
|
EOT
|
||||||
}
|
}
|
||||||
|
|
||||||
|
cat_gitignore()
|
||||||
|
{
|
||||||
|
cat <<-EOT
|
||||||
|
*.done
|
||||||
|
*.dep.mk
|
||||||
|
*.o
|
||||||
|
*.so.*
|
||||||
|
*.so
|
||||||
|
*.a
|
||||||
|
*.rep
|
||||||
|
ld-*.conf
|
||||||
|
*.ldscript
|
||||||
|
*.pc
|
||||||
|
$name
|
||||||
|
*_generated_*
|
||||||
|
EOT
|
||||||
|
}
|
||||||
|
|
||||||
# ---------------------- here we go
|
# ---------------------- here we go
|
||||||
|
|
||||||
myname=`basename $0`
|
myname=`basename $0`
|
||||||
|
|
@ -95,7 +113,7 @@ summary=
|
||||||
description=
|
description=
|
||||||
subpackages="run devel"
|
subpackages="run devel"
|
||||||
|
|
||||||
eval set -- `getopt -- hd:s:p: "$@"`
|
eval set -- `getopt -- hd:s:p:g: "$@"`
|
||||||
|
|
||||||
while [ "$1" != -- ]; do
|
while [ "$1" != -- ]; do
|
||||||
case $1 in
|
case $1 in
|
||||||
|
|
@ -108,6 +126,9 @@ case $1 in
|
||||||
-p)
|
-p)
|
||||||
eval subpackages=\"$2\"
|
eval subpackages=\"$2\"
|
||||||
shift;;
|
shift;;
|
||||||
|
-g)
|
||||||
|
eval pkg_group=\"$2\"
|
||||||
|
shift;;
|
||||||
-h)
|
-h)
|
||||||
usage 0;;
|
usage 0;;
|
||||||
*)
|
*)
|
||||||
|
|
@ -119,6 +140,7 @@ shift
|
||||||
|
|
||||||
[ -z "$description" ] && description="$summary"
|
[ -z "$description" ] && description="$summary"
|
||||||
[ -z "$summary" ] && summary="$description"
|
[ -z "$summary" ] && summary="$description"
|
||||||
|
[ -z "$pkg_group" ] && pkg_group="Amusements/Teaching/Other"
|
||||||
|
|
||||||
[ -f $projdir/Makefile ] || {
|
[ -f $projdir/Makefile ] || {
|
||||||
fatal "$projdir doesn't contain a Makefile"
|
fatal "$projdir doesn't contain a Makefile"
|
||||||
|
|
@ -142,4 +164,5 @@ cat_make_Makefile > make/Makefile
|
||||||
cat_VERSION > VERSION
|
cat_VERSION > VERSION
|
||||||
cat_make_proj_mk > make/proj.mk
|
cat_make_proj_mk > make/proj.mk
|
||||||
cat_make_project_conf > make/project.conf
|
cat_make_project_conf > make/project.conf
|
||||||
|
cat_gitignore > .gitignore
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue