Package Details: python-magic-git 0.4.6-5

Git Clone URL: https://aur.archlinux.org/python-magic-git.git (read-only, click to copy)
Package Base: python-magic-git
Description: Python 3 packages for alternative (github) implementation of python-magic
Upstream URL: https://github.com/ahupp/python-magic
Keywords: alternative magic python
Licenses: MIT
Conflicts: python-magic
Submitter: None
Maintainer: schard
Last Packager: schard
Votes: 0
Popularity: 0.000000
First Submitted: 2015-09-29 15:50
Last Updated: 2015-11-16 17:45

Latest Comments

marcool04 commented on 2021-04-06 12:51

@schard

Thank you for you fast reply and for clearing up the situation a bit for me. You are right, it is the distinction between conflicts and provides that had me somewhat confused (although I do understand how they differ, it's very clearly explained in the wiki).

I guess what is confusing to me (and has nothing to do with you!) is that the PyPi package is "python-magic" but that it then provides a python library called "magic", contrary to what I'm used to seeing: Arch package "python-X" provides PyPi package "X" which, once installed, is python module (or whatever) "X"… You're absolutely right, there would be no benefit in calling this "python-python-magic-git".

Thanks for your time. Keep up the good work :)

schard commented on 2021-04-06 11:17

@marcool04

  • Indeed it is as both projects provide a python package named "magic" with entirely different implementations and APIs, as you already discovered. You might be confusing conflicts with provides here. As you can see, this package purposefully does not provide the other library's package, since it ships a package with a different API.
  • Why would I use such a verbose name, which also can be consiered "ugly" as you already stated? What benefit would that have? It is a python library, providing a package magic, which is built from the rolling upstream git repository, hence python-magic-git.

marcool04 commented on 2021-04-06 11:06

Hi, I have a few questions:

  • Is this package really in conflict with python-magic [1] package from community? They seem to have wildly different version numbers, and as far as I can tell the source isn't even remotely related.
  • Shouldn't the package in fact (in an ugly way, I'll admit) be named python-python-magic-git, since the original package on PyPi is called "python-magic"?

Thanks in advance for any information you can provide. Regards, Mark.

[1] https://archlinux.org/packages/community/any/python-magic/

Anonymous comment on 2015-11-16 17:32

Can you please add some error information so I can reproduce any possible problems that you encountered with the PKGBUILD?

moyamo commented on 2015-11-14 19:34

I was having problems with this PKGBUILD. This patch fixes things.

diff -u b/PKGBUILD a/PKGBUILD
--- b/PKGBUILD 2015-11-14 21:28:57.000000000 +0200
+++ a/PKGBUILD 2015-11-14 21:33:11.958220785 +0200
@@ -1,25 +1,33 @@
# Maintainer: Richard Neumann aka. rne <r dot neumann at homeinfo fullstop de>

pkgname='python-magic-git'
-pkgver='0.4.6'
-pkgrel=5
+pkgver=latest
+pkgrel=2
pkgdesc="Python 3 packages for alternative (github) implementation of python-magic"
arch=('any')
url='https://github.com/ahupp/python-magic'
license=('MIT')
depends=('python')
-makedepends=('git' 'sed' 'python')
+makedepends=('git' 'sed' 'python' 'python-setuptools')
+provides=('python-magic=$pkgver')
conflicts=('python-magic')
source=("${pkgname}::git+https://github.com/ahupp/python-magic")
md5sums=('SKIP')
pkgdir='pkg'
srcdir='src'

+pkgver() {
+ cd "${srcdir}/${pkgname}"
+ # Try to pull the version from setup.py
+ grep "version" setup.py | cut -d\' -f2
+}
+

package() {
local PYTHON="/usr/bin/env python3"
local USR_PATH="${pkgdir}/usr"
local LICENSE_DIR="${USR_PATH}/share/licenses/${pkgname}"
+

# Set up directories
install -d -m 755 ${USR_PATH}
@@ -31,11 +39,11 @@
cd "${srcdir}/${pkgname}"

# Fix setup.py for distutils.core
- sed -i 's/\(from setuptools.*\)/#\1/' setup.py
- sed -i 's/#\(from distutils.*\)/\1/' setup.py
+# sed -i 's/\(from setuptools.*\)/#\1/' setup.py
+# sed -i 's/#\(from distutils.*\)/\1/' setup.py

# Install python packages to $pkgdir
- ${PYTHON} setup.py install --prefix ${USR_PATH}
+ ${PYTHON} setup.py install --prefix "/usr" --root "$pkgdir"

# Install license file
install -m 644 LICENSE ${LICENSE_DIR}