You are not logged in.

#1 2016-05-30 18:17:15

Awebb
Member
Registered: 2010-05-06
Posts: 6,275

[SOLVED] AUR split package for python library with tools (odfpy)

I currently maintain the python-odfpy-git package on the AUR. Not only does it contain a python library, but it also comes with a set of tools. The library works well without the tools.

The initial problem was, that I could not install all the files for python2 and python3 at the same time, because the scripts files, residing in /usr/bin, conflicted with each other, as well as the man pages. My current solution is to delete the scripts and manpages from the python2 version and let it depend on the python3 package.

For some reason, I don't want to have those packages depend on each other. Is there a consensus about how to deal with this? Should I split the tools and manpages from the library, so people can install the libraries and pick between the python2 and 3 versions of the tools? I see no reason for both tool versions to coexist.

Here is what I could do:

python-odfpy-git
python2-odfpy-git
python-odfpy-tools-git conflicts with python2-odfpy-tools-git

I could also completely drop the python2 tools version. They are not called by the library in a pythonic way and the Arch default python is python3.

Comments, suggestions?

EDIT: I already have one yaourt patient with a conflict. Duh.

Last edited by Awebb (2016-05-31 07:29:12)

Offline

#2 2016-05-30 18:32:04

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [SOLVED] AUR split package for python library with tools (odfpy)

python-odfpy-common-git can contain the parts that both rely on.
e.g. see how the pyqt5 pkgbase from extra handles it.

But I don't see why the tools need to have a python2 version at all, so you are probably better off packaging the tools as odfpy-git and depend exclusively on the Python 3 library.

...

Random note: that PKGBUILD should be updated to use a modern source=() array instead of cloning the repo in build()


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#3 2016-05-30 19:54:38

Awebb
Member
Registered: 2010-05-06
Posts: 6,275

Re: [SOLVED] AUR split package for python library with tools (odfpy)

You're right, the tools should not be called python-*, but just odfpy-tools-git.

Since tools rely on the lib and not vice versa, it's going to be this:

python-odfpy-git: py3
python2-odfpy-git: py2
odfpy-tools-git: py3 version of the scripts, manpages of the scripts, depends on python-odfpy-git, no python2 version.

Eschwartz wrote:

Random note: that PKGBUILD should be updated to use a modern source=() array instead of cloning the repo in build()

Oops, indeed. Thank you. First thing in the morning.

Offline

#4 2016-05-30 20:05:10

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: [SOLVED] AUR split package for python library with tools (odfpy)

How does this look?

# Maintainer: Sascha Shaw <sascha.shaw@t-online.de>

pkgname=('python-odfpy-git' 'python2-odfpy-git' 'odfpy-git')
pkgbase='odfpy-git'
pkgver=1.3.3
pkgrel=1
arch=('any')
url="https://github.com/eea/${pkgbase%-git}"
license=('GPL')
makedepends=('git')
source=("git+${url}")
sha256sums=('SKIP')

build() {
  cd "${srcdir}/${pkgbase%-git}"
  python2 setup.py build
  python setup.py build

}

package_python-odfpy-git() {
  pkgdesc='A python library for manipulating OpenDocument 1.2 files'
  depends=('python')
  conflicts=('python-odfpy' 'python2-odfpy' 'odfpy')

  cd "${srcdir}/${pkgbase%-git}"
  python setup.py install --root="${pkgdir}/" --skip-build
  rm -rf ../tools-{bin,share}
  mv "${pkgdir}"/usr/bin ../tools-bin
  mv "${pkgdir}"/usr/share ../tools-share
}

package_python2-odfpy-git() {
  pkgdesc='A python2 library for manipulating OpenDocument 1.2 files'
  depends=('python2')
  conflicts=('python2-odfpy' 'odfpy')

  cd "${srcdir}/${pkgbase%-git}"
  python2 setup.py install --root="${pkgdir}/" --skip-build
  rm -rf "${pkgdir}"/usr/bin
  rm -rf "${pkgdir}"/usr/share
}

package_odfpy-git() {
  pkgdesc='Tools for manipulating OpenDocument 1.2 files'
  depends=('python-odfpy-git')

  install -Dt "${pkgdir}"/usr/bin/ "${srcdir}"/tools-bin/*
  install -Dt "${pkgdir}"/usr/share/man/man1/ "${srcdir}"/tools-share/man/man1/*

}

# vim:set ts=2 sw=2 et:

Last edited by eschwartz (2016-05-30 20:09:53)


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#5 2016-05-31 07:06:25

Awebb
Member
Registered: 2010-05-06
Posts: 6,275

Re: [SOLVED] AUR split package for python library with tools (odfpy)

This looks great!

Let me take notes about what I've learned:

1. git+url, instead of cloning manually
2. build once, let the package functions distribute the files

Thank you very much!

Offline

Board footer

Powered by FluxBB