summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLarry Hajali <larryhaja@gmail.com>2016-07-30 09:31:26 -0700
committerDavid Spencer <idlemoor@slackbuilds.org>2016-08-05 18:10:51 +0100
commit3bbcfb4e6f838cda7a16037066965ac4effdb86d (patch)
tree26f21466fc4745e2560fc0af8eb494a6b240287e
parent8a22677f62a2d2db0a3d28d0062e15fd7562c721 (diff)
downloadslackbuilds-3bbcfb4e6f838cda7a16037066965ac4effdb86d.tar.gz
python/python-magic: Updated for version 0.4.12
Signed-off-by: Larry Hajali <larryhaja[at]gmail[dot]com>
-rw-r--r--python/python-magic/LICENSE21
-rw-r--r--python/python-magic/README6
-rw-r--r--python/python-magic/README.md64
-rw-r--r--python/python-magic/python-magic.SlackBuild14
-rw-r--r--python/python-magic/python-magic.info6
5 files changed, 18 insertions, 93 deletions
diff --git a/python/python-magic/LICENSE b/python/python-magic/LICENSE
deleted file mode 100644
index 044612d292..0000000000
--- a/python/python-magic/LICENSE
+++ /dev/null
@@ -1,21 +0,0 @@
-The MIT License (MIT)
-
-Copyright (c) 2001-2014 Adam Hupp
-
-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.
diff --git a/python/python-magic/README b/python/python-magic/README
index 6b932666fd..1746883091 100644
--- a/python/python-magic/README
+++ b/python/python-magic/README
@@ -1,3 +1,9 @@
This module uses ctypes to access the libmagic file type identification
library. It makes use of the local magic database and supports both textual
and MIME-type output.
+
+Optional dependency: python3
+
+Note: To install python3 bindings pass PYTHON3=yes to the slackbuild.
+
+ # PYTHON3=yes ./python-magic.SlackBuild
diff --git a/python/python-magic/README.md b/python/python-magic/README.md
deleted file mode 100644
index abfc4748f2..0000000000
--- a/python/python-magic/README.md
+++ /dev/null
@@ -1,64 +0,0 @@
-# python-magic
-
-python-magic is a python interface to the libmagic file type
-identification library. libmagic identifies file types by checking
-their headers according to a predefined list of file types. This
-functionality is exposed to the command line by the Unix command
-`file`.
-
-## Example Usage
-
- >>> import magic
- >>> magic.from_file("testdata/test.pdf")
- 'PDF document, version 1.2'
- >>> magic.from_buffer(open("testdata/test.pdf").read(1024))
- 'PDF document, version 1.2'
- >>> magic.from_file("testdata/test.pdf", mime=True)
- 'application/pdf'
-
-## Installation
-
-The current stable version of python-magic is available on pypi and
-can be installed by running `pip install python-magic`.
-
-Other sources:
-
-- pypi: http://pypi.python.org/pypi/python-magic/
-- github: https://github.com/ahupp/python-magic
-
-### Dependencies on Windows
-
-On Windows, you need to download and save the following libraries under
-`C:\Windows\System32`:
-
-- `regex2.dll` from [sourceforge.net/projects/gnuwin32/files/regex/](http://sourceforge.net/projects/gnuwin32/files/regex/)
-- `zlib1.dll` from [sourceforge.net/projects/gnuwin32/files/zlib/](http://sourceforge.net/projects/gnuwin32/files/zlib/)
-- `magic1.dll` from [sourceforge.net/projects/gnuwin32/files/file/](http://sourceforge.net/projects/gnuwin32/files/file/)
-
-## Author
-
-Written by Adam Hupp in 2001 for a project that never got off the
-ground. It origionally used SWIG for the C library bindings, but
-switched to ctypes once that was part of the python standard library.
-
-You can contact me via my [website](http://hupp.org/adam) or
-[github](http://github.com/ahupp).
-
-## Contributors
-
-Thanks to these folks on github who submitted features and bugfixes.
-
-- Amit Sethi
-- [bigben87](https://github.com/bigben87)
-- [fallgesetz](https://github.com/fallgesetz)
-- [FlaPer87](https://github.com/FlaPer87)
-- [lukenowak](https://github.com/lukenowak)
-- NicolasDelaby
-- sacha@ssl.co.uk
-- SimpleSeb
-- [tehmaze](https://github.com/tehmaze)
-
-## License
-
-python-magic is distributed under the [PSF License](http://www.python.org/psf/license/).
-
diff --git a/python/python-magic/python-magic.SlackBuild b/python/python-magic/python-magic.SlackBuild
index aea733d41b..433f71f9ff 100644
--- a/python/python-magic/python-magic.SlackBuild
+++ b/python/python-magic/python-magic.SlackBuild
@@ -2,7 +2,7 @@
# Slackware build script for python-magic
-# Copyright 2009-2015 Larry Hajali <larryhaja[at]gmail[dot]com>
+# Copyright 2009-2016 Larry Hajali <larryhaja[at]gmail[dot]com>
# All rights reserved.
#
# Redistribution and use of this script, with or without modification, is
@@ -23,7 +23,7 @@
# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
PRGNAM=python-magic
-VERSION=${VERSION:-0.4.10}
+VERSION=${VERSION:-0.4.12}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
@@ -57,13 +57,17 @@ find -L . \
python setup.py install --root=$PKG
+# Install for python3. Default is no.
+if [ "${PYTHON3:-no}" == "yes" ]; then
+ rm -rf build
+ python3 setup.py install --root=$PKG
+fi
+
find $PKG -print0 | xargs -0 file | grep -e "executable" -e "shared object" | grep ELF \
| cut -f 1 -d : | xargs strip --strip-unneeded 2> /dev/null || true
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
-cp -a PKG-INFO $PKG/usr/doc/$PRGNAM-$VERSION
-cat $CWD/README.md > $PKG/usr/doc/$PRGNAM-$VERSION/README.md
-cat $CWD/LICENSE > $PKG/usr/doc/$PRGNAM-$VERSION/LICENSE
+cp -a LICENSE README.md $PKG/usr/doc/$PRGNAM-$VERSION
cat $CWD/$PRGNAM.SlackBuild > $PKG/usr/doc/$PRGNAM-$VERSION/$PRGNAM.SlackBuild
mkdir -p $PKG/install
diff --git a/python/python-magic/python-magic.info b/python/python-magic/python-magic.info
index 424fe89951..e3dd50cc76 100644
--- a/python/python-magic/python-magic.info
+++ b/python/python-magic/python-magic.info
@@ -1,8 +1,8 @@
PRGNAM="python-magic"
-VERSION="0.4.10"
+VERSION="0.4.12"
HOMEPAGE="https://github.com/ahupp/python-magic"
-DOWNLOAD="http://pypi.python.org/packages/source/p/python-magic/python-magic-0.4.10.tar.gz"
-MD5SUM="becc45e6b4e00d4e8a6bdf727c52bd27"
+DOWNLOAD="https://github.com/ahupp/python-magic/archive/0.4.12/python-magic-0.4.12.tar.gz"
+MD5SUM="b0c173bd9904db97c5b3ebd9396b9cf4"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES=""