~fredg/NuTyX

8258f6b64cd9850010cde8286f93342196ebac1c — alienus 8 years ago 42556a4
First import
1 files changed, 95 insertions(+), 0 deletions(-)

A pkgdir.sh
A pkgdir.sh => pkgdir.sh +95 -0
@@ 0,0 1,95 @@
#!/bin/bash

DIR=$1

die()
{
    echo "$@"
    exit 1
}

# check name@version scheme
check_arg()
{
    [ $DIR == .*@.* ] || die "Please, write name@version, aborting..."
}

mkDir()
{
    mkdir -p -v $DIR
}

pkg_simple()
{
    cat > $DIR/Pkgfile << EOF
source=()

build(){
    cd $name-$version
    make
    make DESTDIR=$PKG install    
}



# NuTyX Pkgfile (http://nutyx.org)
EOF
}

pkg_python()
{
    cat > $DIR/Pkgfile << EOF
source=()

build() {
    cd $name-$version
    python2 setup.py install --prefix=/usr --root=$PKG
}



# NuTyX Pkgfile (http://nutyx.org)
EOF
}

pkg_perl()
{
    cat > $DIR/Pkgfile << EOF
source=()

build() {
    cd $name-$version
    perl Makefile.PL
    make OPTIMIZE="$CFLAGS" || exit 1
    make install INSTALLDIRS=vendor DESTDIR=$PKG || exit 1

    # Remove perllocal.pod and .packlist if present in the package
    for i in perllocal.pod .packlist; do
        find $PKG -name "$i" -exec rm -rf {} \;
    done
}



# NuTyX Pkgfile (http://nutyx.org)
EOF
}

pkg_waf()
{
    cat > $DIR/Pkgfile << EOF
source=()

build() {
    cd $name-$version
    ./waf configure --prefix=/usr
    ./waf build
    ./waf install --destdir=$PKG
}



# NuTyX Pkgfile (http://nutyx.org)
EOF
}