~fredg/NuTyX

95f2ac59331c7c501c7ff47b1cbac3156a2a70da — alienus 8 years ago 1a05341
add info and MIT license
1 files changed, 38 insertions(+), 3 deletions(-)

M pkgdir
M pkgdir => pkgdir +38 -3
@@ 3,7 3,28 @@
# 
# pkgdir
#
# script to make NuTyX packager life easier ;)
# The MIT License (MIT)
#
# Copyright (c) 2014 Fred. Galusik <alienus at nutyx dot org>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
# THE SOFTWARE.

#
# LICENSE: MIT
#


@@ 11,8 32,9 @@
PKGDIR_VERSION=0.1

#
# ex: pkgdir -p plop@0.1
# make a plop@0.1 dir with a Pkgfile perl template and a info template
#

print_help()
{
    echo "Usage: pkgdir [options] Dir"


@@ 32,7 54,7 @@ die()
    exit 1
}

# check dir name scheme : name@version
# check dir name scheme : name@version and make it
check_dir()
{
    IFS="@"


@@ 49,6 71,7 @@ check_dir()
    echo "$PORT created"
}

# basic default template
pkg_default()
{
    cat > $PKGNAME\@$PKGVERSION/Pkgfile << EOF


@@ 68,6 91,7 @@ EOF
    echo "$PORT/Pkgfile default created"
}

# python template
pkg_python()
{
    cat > $PKGNAME\@$PKGVERSION/Pkgfile << EOF


@@ 86,6 110,7 @@ EOF
    echo "$PORT/Pkgfile python created"
}

# perl template
pkg_perl()
{
    cat > $PKGNAME\@$PKGVERSION/Pkgfile << EOF


@@ 111,6 136,7 @@ EOF
    echo "$PORT/Pkgfile perl created"
}

# waf template
pkg_waf()
{
    cat > $PKGNAME\@$PKGVERSION/Pkgfile << EOF


@@ 131,6 157,9 @@ EOF
    echo "$PORT/Pkgfile waf created"
}

#
# info template
#
pkg_info()
{
    cat > $PKGNAME\@$PKGVERSION/$PKGNAME.info << EOF


@@ 150,6 179,9 @@ EOF
echo "$PORT/$PKGNAME.info created"
}

#
# parse the packager options
#
parse_options()
{
    if [ $# -ge 1 ]; then


@@ 178,6 210,9 @@ parse_options()
    fi
}

#
# main function
#
main()
{
    parse_options "$@"