diff options
author | feyrer <feyrer@pkgsrc.org> | 1999-05-06 02:49:27 +0000 |
---|---|---|
committer | feyrer <feyrer@pkgsrc.org> | 1999-05-06 02:49:27 +0000 |
commit | 9b07895064a0a5e6e1e5cfe768dddef1954ae32a (patch) | |
tree | 3100ac117428cee7946f0072aa75570a753f4cc2 /pkgtools | |
parent | a586d393820764fa0ebd0bcb3c7834c31f0df25c (diff) | |
download | pkgsrc-9b07895064a0a5e6e1e5cfe768dddef1954ae32a.tar.gz |
Initial revision
Diffstat (limited to 'pkgtools')
-rwxr-xr-x | pkgtools/url2pkg/files/url2pkg | 107 |
1 files changed, 107 insertions, 0 deletions
diff --git a/pkgtools/url2pkg/files/url2pkg b/pkgtools/url2pkg/files/url2pkg new file mode 100755 index 00000000000..ca56e843ea2 --- /dev/null +++ b/pkgtools/url2pkg/files/url2pkg @@ -0,0 +1,107 @@ +#!/bin/sh +# +# url2pkg V1.0 +# (c) 1999 Hubert Feyrer +# + +if [ ! -f w*/.extract_done ]; then + if [ "$1" = "" ]; then + echo -n 'URL: ' + read url + else + url="$1" + fi + + DISTNAME=`expr "$url" : '.*/\([^/]*\)\$''` + MASTER_SITES=`expr "$url" : '\(.*\)/[^/]*\$'` + + case "$DISTNAME" in + *.tgz) EXTRACT_SUFX=".tgz" + DISTNAME=`expr ${DISTNAME} : '\(.*\)\.[^.]*'` + ;; + *.tar.gz) EXTRACT_SUFX=.tar.gz + DISTNAME=`expr ${DISTNAME} : '\(.*\)\.[^.]*\.[^.]*'` + ;; + *) EXTRACT_SUFX=`expr ${DISTNAME} : '.*\(\.[^.]*\)'` + DISTNAME=`expr ${DISTNAME} : '\(.*\)\.[^.]*'` + ;; + esac + + if [ -f Makefile ]; then + mv Makefile Makefile.BAK + fi + + ( + echo '# $NetBSD: url2pkg,v 1.1 1999/05/06 02:49:27 feyrer Exp $' + echo '#' + echo "" + echo "DISTNAME= $DISTNAME" + if [ "$EXTRACT_SUFX" != ".tar.gz" ]; then + echo "EXTRACT_SUFX= ${EXTRACT_SUFX}" + fi + echo "CATEGORIES= FILLTHISINPLEASE" + echo "MASTER_SITES= $MASTER_SITES/" + echo "" + echo "MAINTAINER= hubertf@netbsd.org" + echo "HOMEPAGE= " + echo "" + echo '.include "../../mk/bsd.pkg.mk"' + ) >Makefile + + mkdir pkg + echo '@comment $NetBSD: url2pkg,v 1.1 1999/05/06 02:49:27 feyrer Exp $' >pkg/PLIST + + vi +/FILLTHISINPLEASE Makefile + + echo "Running 'make makesum' ..." + make makesum + + echo "Running 'make extract' ..." + make extract +fi + +# +# Exec Artificial Intelligence Modules here ... +# +wrksrc=`ls w*` +if [ "$wrksrc" != "$DISTNAME" ]; then + WRKSRC= "\${WRKDIR}/$wrksrc" +fi + +configure=`echo w*`/$wrksrc/configure +echo checking $configure XXX +if [ -f $configure ]; then + if expr 2>&1 >/dev/null "`$configure --version`" \ + : 'configure generated by autoconf version.*' ; then + GNU_CONFIGURE=YES + else + USE_CONFIGURE=YES + fi +fi + +echo "Fixing up Makefile." +( + sed '/^.include/d' <Makefile + + if [ "${WRKSRC}" != "" ]; then + echo "WRKSRC= $WRKSRC" + fi + + if [ "${USE_CONFIGURE}" != "" ]; then + echo "USE_CONFIGURE= $USE_CONFIGURE" + fi + if [ "${GNU_CONFIGURE}" != "" ]; then + echo "GNU_CONFIGURE= $GNU_CONFIGURE" + fi + + echo "" + echo '.include "../../mk/bsd.pkg.mk"' +) >Makefile.$$ +mv Makefile.$$ Makefile + +echo "" +echo "Contents of "`echo w*`"/${wrksrc}:" +ls -la w*/$wrksrc + +echo "" +echo "Good luck!" |