diff options
-rw-r--r-- | doc/CHANGELOG | 3 | ||||
-rwxr-xr-x | simplepkg.SlackBuild | 17 | ||||
-rwxr-xr-x | src/repos | 121 |
3 files changed, 136 insertions, 5 deletions
diff --git a/doc/CHANGELOG b/doc/CHANGELOG index 00e8aef..a8858e3 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -1,6 +1,9 @@ simplepkg changelog ------------------- +0.4.9pre5: added script "repos" + moved simplaret to /usr/bin + 0.4.9pre4: createpkg: better command line evaluation, now using "upgradepkg --install-new" to install a package and added the command diff --git a/simplepkg.SlackBuild b/simplepkg.SlackBuild index 78288b3..8caed86 100755 --- a/simplepkg.SlackBuild +++ b/simplepkg.SlackBuild @@ -6,14 +6,15 @@ PACKAGE="simplepkg" PACK_DIR="package-$PACKAGE" BUILD="1rha" -VERSION="0.4.9pre4" +VERSION="0.4.9pre5" ARCH="noarch" - LIBEXEC="/usr/libexec/$PACKAGE" -BINDIR="/usr/sbin" -DOC_DIR="/usr/doc" -BINARY_LIST="mkjail templatepkg jail-update jail-upgrade lspkg metapkg rebuildpkg simplaret createpkg" +BINDIR="/usr/bin" +BINARY_LIST="simplaret repos" +SBINDIR="/usr/sbin" +SBINARY_LIST="mkjail templatepkg jail-update jail-upgrade lspkg metapkg rebuildpkg createpkg" LIB_LIST="common.sh" +DOC_DIR="/usr/doc" DOC_LIST="COPYING TODO CHANGELOG README README.pt_BR README.simplaret README.simplaret.pt_BR" rm -rf $PACK_DIR @@ -21,6 +22,12 @@ mkdir -p $PACK_DIR/install cp install/slack-desc $PACK_DIR/install cp install/doinst.sh $PACK_DIR/install +mkdir -p $PACK_DIR/$SBINDIR +for binary in $SBINARY_LIST; do + cp src/$binary $PACK_DIR/$SBINDIR + chmod +x $PACK_DIR/$SBINDIR/$binary +done + mkdir -p $PACK_DIR/$BINDIR for binary in $BINARY_LIST; do cp src/$binary $PACK_DIR/$BINDIR diff --git a/src/repos b/src/repos new file mode 100755 index 0000000..06f59f0 --- /dev/null +++ b/src/repos @@ -0,0 +1,121 @@ +#!/bin/bash +# +# repos script got from +# http://software.jaos.org/BUILD/slapt-get/FAQ.html#slgFAQ17 +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2 of the License, or +# any later version. +# +# changes by rhatto at riseup.net to fit http://slack.sarava.org needs +# + +function svn_add_meta { + find *meta -exec svn add {} 2> /dev/null \; + find . -name *meta -exec svn add {} 2> /dev/null \; +} + +function gen_filelist { + for file in `find | grep -e ".tgz$"`; do ls -l $file; done > FILELIST.TXT + echo "Created new FILELIST.TXT" +} + +function gen_packages_txt { + echo '' > PACKAGES.TXT + find . -type f -name '*.meta' -exec cat {} \; >> PACKAGES.TXT + cat PACKAGES.TXT | gzip -9 -c - > PACKAGES.TXT.gz + echo "Created new PACKAGES.TXT and PACKAGES.TXT.gz" +} + +function gen_md5_checksums { + echo '' > CHECKSUMS.md5 + find . -type f -name '*.tgz' -exec md5sum {} \; >> CHECKSUMS.md5 + cat CHECKSUMS.md5 | gzip -9 -c - > CHECKSUMS.md5.gz + echo "Created new CHECKSUMS.md5 and CHECKSUMS.md5.gz" +} + +function gen_meta { + if [ ! -f $1 ]; then + echo "File not found: $1" + exit 1; + else + echo "Processing $1" + fi + if [ "`echo $1|grep -E '(.*{1,})\-(.*[\.\-].*[\.\-].*).tgz[ ]{0,}$'`" == "" ]; then + return; + fi + NAME=$(echo $1|sed -re "s/(.*\/)(.*.tgz)$/\2/") + LOCATION=$(echo $1|sed -re "s/(.*)\/(.*.tgz)$/\1/") + SIZE=$( expr `gunzip -l $1 | tail -n 1|awk '{print $1}'` / 1024 ) + USIZE=$( expr `gunzip -l $1 | tail -n 1|awk '{print $2}'` / 1024 ) + REQUIRED=$(tar xzfO $1 install/slack-required 2>/dev/null|xargs -r -iZ echo -n "Z,"|sed -e "s/,$//") + CONFLICTS=$(tar xzfO $1 install/slack-conflicts 2>/dev/null|xargs -r -iZ echo -n "Z,"|sed -e "s/,$//") + SUGGESTS=$(tar xzfO $1 install/slack-suggests 2>/dev/null|xargs -r ) + METAFILE=${NAME%tgz}meta + echo "PACKAGE NAME: $NAME" > $LOCATION/$METAFILE + if [ -n "$DL_URL" ]; then + echo "PACKAGE MIRROR: $DL_URL" >> $LOCATION/$METAFILE + fi + echo "PACKAGE LOCATION: $LOCATION" >> $LOCATION/$METAFILE + echo "PACKAGE SIZE (compressed): $SIZE K" >> $LOCATION/$METAFILE + echo "PACKAGE SIZE (uncompressed): $USIZE K" >> $LOCATION/$METAFILE + echo "PACKAGE REQUIRED: $REQUIRED" >> $LOCATION/$METAFILE + echo "PACKAGE CONFLICTS: $CONFLICTS" >> $LOCATION/$METAFILE + echo "PACKAGE SUGGESTS: $SUGGESTS" >> $LOCATION/$METAFILE + echo "PACKAGE DESCRIPTION:" >> $LOCATION/$METAFILE + tar xzfO $1 install/slack-desc | grep -E '\w+\:'|grep -v '^#' >> $LOCATION/$METAFILE + echo "" >> $LOCATION/$METAFILE +} + +function do_all { + for pkg in `find . -type f -name '*.tgz' -print`; do + gen_meta $pkg + done + $0 PACKAGESTXT + $0 FILELIST + $0 MD5 +} + +function show_usage { + echo "`basename $0` [pkg [file]|all|new|svnmeta|PACKAGESTXT|FILELIST|MD5]" +} + +case "$1" in + pkg) + if [ -n "$2" ]; then + gen_meta $2 + else + show_usage + fi + ;; + all) + do_all + ;; + new) + for pkg in `find . -type f -name '*.tgz' -print`; do + if [ ! -f ${pkg%tgz}meta ]; then + gen_meta $pkg + fi + done + ;; + svnmeta) + svn_add_meta + ;; + PACKAGESTXT) + gen_packages_txt + ;; + FILELIST) + gen_filelist + ;; + MD5) + gen_md5_checksums + ;; + usage) + show_usage + ;; + *) + do_all + svn_add_meta + ;; +esac |