diff options
author | Andre Barboza <bmg.andre@gmail.com> | 2017-04-04 17:20:50 +0100 |
---|---|---|
committer | Willy Sudiarto Raharjo <willysr@slackbuilds.org> | 2017-04-08 06:57:46 +0700 |
commit | a5507f5b78c3a26309ca865f272b578414a44805 (patch) | |
tree | 95ca6281fdbc25483ee8e2abfdc6a665ddf0bcdc /python/pluginbase | |
parent | 8121d70b22d4db4557ac2acda1911f1d4788d66d (diff) |
python/pluginbase: Added (Python development plugin module).
Signed-off-by: David Spencer <idlemoor@slackbuilds.org>
Diffstat (limited to 'python/pluginbase')
-rw-r--r-- | python/pluginbase/README | 15 | ||||
-rw-r--r-- | python/pluginbase/pluginbase.SlackBuild | 82 | ||||
-rw-r--r-- | python/pluginbase/pluginbase.info | 10 | ||||
-rw-r--r-- | python/pluginbase/slack-desc | 19 |
4 files changed, 126 insertions, 0 deletions
diff --git a/python/pluginbase/README b/python/pluginbase/README new file mode 100644 index 000000000000..0197dd88e4d9 --- /dev/null +++ b/python/pluginbase/README @@ -0,0 +1,15 @@ +PluginBase is a module for Python that enables the development of +flexible plugin systems in Python. + +Step 1: + from pluginbase import PluginBase + plugin_base = PluginBase(package='yourapplication.plugins') + +Step 2: + plugin_source = plugin_base.make_plugin_source( + searchpath=['./path/to/plugins', './path/to/more/plugins']) + +Step 3: + with plugin_source: + from yourapplication.plugins import my_plugin + my_plugin.do_something_cool() diff --git a/python/pluginbase/pluginbase.SlackBuild b/python/pluginbase/pluginbase.SlackBuild new file mode 100644 index 000000000000..ae2fc5afc2f4 --- /dev/null +++ b/python/pluginbase/pluginbase.SlackBuild @@ -0,0 +1,82 @@ +#!/bin/sh + +# Slackware build script for pluginbase + +# Copyright 2017, Andre Barboza, Belo Horizonte Brazil +# All rights reserved. +# +# Redistribution and use of this script, with or without modification, is +# permitted provided that the following conditions are met: +# +# 1. Redistributions of this script must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED +# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO +# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +PRGNAM=pluginbase +VERSION=${VERSION:-0.5} +BUILD=${BUILD:-1} +TAG=${TAG:-_SBo} + +if [ -z "$ARCH" ]; then + case "$( uname -m )" in + i?86) ARCH=i586 ;; + arm*) ARCH=arm ;; + *) ARCH=$( uname -m ) ;; + esac +fi + +CWD=$(pwd) +TMP=${TMP:-/tmp/SBo} +PKG=$TMP/package-$PRGNAM +OUTPUT=${OUTPUT:-/tmp} + +if [ "$ARCH" = "i586" ]; then + SLKCFLAGS="-O2 -march=i586 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "i686" ]; then + SLKCFLAGS="-O2 -march=i686 -mtune=i686" + LIBDIRSUFFIX="" +elif [ "$ARCH" = "x86_64" ]; then + SLKCFLAGS="-O2 -fPIC" + LIBDIRSUFFIX="64" +else + SLKCFLAGS="-O2" + LIBDIRSUFFIX="" +fi + +set -e + +rm -rf $PKG +mkdir -p $TMP $PKG $OUTPUT +cd $TMP +rm -rf $PRGNAM-$VERSION +tar xvf $CWD/$PRGNAM-$VERSION.tar.gz +cd $PRGNAM-$VERSION +chown -R root:root . +find -L . \ + \( -perm 777 -o -perm 775 -o -perm 750 -o -perm 711 -o -perm 555 \ + -o -perm 511 \) -exec chmod 755 {} \; -o \ + \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ + -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; + +python setup.py install --root=$PKG + +mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION +cp -a README LICENSE $PKG/usr/doc/$PRGNAM-$VERSION +cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild + +mkdir -p $PKG/install +cat $CWD/slack-desc > $PKG/install/slack-desc + +cd $PKG +/sbin/makepkg -l y -c n $OUTPUT/$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.${PKGTYPE:-tgz} diff --git a/python/pluginbase/pluginbase.info b/python/pluginbase/pluginbase.info new file mode 100644 index 000000000000..75c8e595cd7b --- /dev/null +++ b/python/pluginbase/pluginbase.info @@ -0,0 +1,10 @@ +PRGNAM="pluginbase" +VERSION="0.5" +HOMEPAGE="http://github.com/mitsuhiko/pluginbase" +DOWNLOAD="https://pypi.python.org/packages/c9/ff/07c41bc912441a2aec3e6c08323d01fda3fc1e07e5f0ac3e9d6a61f189b6/pluginbase-0.5.tar.gz" +MD5SUM="d7910bcbb0a2c75507c9a7ef994a69b6" +DOWNLOAD_x86_64="" +MD5SUM_x86_64="" +REQUIRES="" +MAINTAINER="Andre Barboza" +EMAIL="bmg.andre@gmail.com" diff --git a/python/pluginbase/slack-desc b/python/pluginbase/slack-desc new file mode 100644 index 000000000000..814aaf0935a9 --- /dev/null +++ b/python/pluginbase/slack-desc @@ -0,0 +1,19 @@ +# HOW TO EDIT THIS FILE: +# The "handy ruler" below makes it easier to edit a package description. +# Line up the first '|' above the ':' following the base package name, and +# the '|' on the right side marks the last column you can put a character in. +# You must make exactly 11 lines for the formatting to be correct. It's also +# customary to leave one space after the ':' except on otherwise blank lines. + + |-----handy-ruler------------------------------------------------------| +pluginbase: pluginbase (Python development plugin module) +pluginbase: +pluginbase: PluginBase is a module for Python that enables the development of +pluginbase: flexible plugin systems in Python. +pluginbase: +pluginbase: Homepage: http://github.com/mitsuhiko/pluginbase +pluginbase: +pluginbase: +pluginbase: +pluginbase: +pluginbase: |