You are not logged in.

#1 2007-09-26 15:52:37

j.ashlock
Member
Registered: 2007-07-19
Posts: 5

Adopted an orphan

PythonCard is a program for RAD using python and wxpython. As the maintainer had not updated in a while I asked if he minded if I took over. He agreed and I have now adopted this program. This is my first PKGBUILD attempt so be gentle. smile

# Contributor : Jani Talikka <jani.talikka@gmail.com>
# Contributor : Jason Ashlock <jcashlock@gmail.com>
pkgname=pythoncard
pkgver=0.8.2
pkgrel=1
pkgdesc="PythonCard is a GUI construction kit for building cross-platform desktop applications on Windows, Mac OS X, and Linux, using the Python language."
arhc=('i686' 'x86_64')
url="http://pythoncard.sourceforge.net/"
license="BSD"
depends=('python>=2.3' 'wxpython')
makedepends=()
conflicts=()
replaces=()
backup=()
install=
source=(http://dl.sourceforge.net/sourceforge/$pkgname/PythonCard-$pkgver.tar.gz)
md5sums=('109913b19baba90aff5c95949e5aa1ff')

build() {
  cd $startdir/src/PythonCard-$pkgver
  python setup.py install --root=$startdir/pkg
  rm $startdir/pkg/usr/bin/install-pythoncard.py
  echo "#!/bin/bash" > $startdir/pkg/usr/bin/codeEditor
  echo "python /usr/lib/python2.5/site-packages/PythonCard/tools/codeEditor/codeEditor.py" >> $startdir/pkg/usr/bin/codeEditor
  chmod +x $startdir/pkg/usr/bin/codeEditor
  echo "PythonCard" > $startdir/pkg/usr/lib/python2.5/site-packages/$pkgname.pth
}

The only changes I made were to add myself to contributor, update the version, add arch=() and license=() fields, update the md5sum and change the reference to python2.5 from python2.4.

Questions:

Is it really necessary to have this program reside inside the python folder? The documentation indicates that on a mandrake system it would reside in /usr/share. Is this a arch linux thing or would I be safe to change from /usr/lib/python2.5/site-packages/ to /usr/share?

If it must go into /usr/lib/python2.x/site-packages/ would it be acceptable to add a python version check to the PKGBUILD and use a variable to put it in the right place?

Also, is there any way to add an item on the gui menu for this program? Documentation indicates it is done automatically in debian.

Offline

#2 2007-09-27 10:38:45

Lone_Wolf
Forum Moderator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,922

Re: Adopted an orphan

For the gui menu you need a .desktop file .

If the source doesn't have one , look in /usr/share/applications  on your pc for examples.

I can't help with your other questions.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#3 2007-09-27 10:50:21

thepizzaking
Member
From: Melbourne, Victoria, Australia
Registered: 2006-03-13
Posts: 46

Re: Adopted an orphan

You don't need the backup, install etc fields if they're empty.

Offline

#4 2007-09-27 11:25:24

djscholl
Member
From: Michigan, USA
Registered: 2006-05-24
Posts: 56

Re: Adopted an orphan

Just in case you haven't come across it yet,  http://wiki.archlinux.org/index.php/Arc … _Standards is your new best friend.

The contributor line is not for history, it is so users know whom to contact with current questions. You can put attribution history into the comments on the AUR package page if you wish.

pkgdesc should not repeat the name of the package (view an AUR project page to see why), and should be limited to 80 chrs.

arch is misspelled as arhc. If you list both architectures, that implies it has actually been tested on both architectures.

The license field is an array, not a variable.

Python 2.5 has been available on Arch for awhile. I think you can assume that everyone is using 2.5. Anyone who is still using python 2.2 has specifically blocked it in their updates configuration since 2.3 was released years ago, and they should already know to watch out for compatibility issues. wxpython brings python as its own dependency.

The sourceforge url you provide is deprecated; downloads.sourceforge.net is preferred. There have been many threads in this forum over the years on the subject of sourceforge mirrors.

Lines in the PKGBUILD should be limited to 100 chrs.

Important steps in the build script should be followed with "|| return 1" to be sure that makepkg will know if a step failed and the package is broken.

You may want to include the wrapper script in your tarball rather than generate it from the build script. (If so, it will need to be listed in the source and md5sums arrays.) This removes some clutter from the build script. The .pth file is only a oneliner, so maybe that one is OK in the build script.

The BSD license file from the package needs to be installed in /usr/share/licenses/$pkgname.

My practice is to put python modules that are imported in the site-packages directory. If you put importable modules elsewhere, you will need to hack the system python path so the import will work.

I put stand-alone python applications in /opt/$pkgname if the executable travels in a directory full of stuff. It's common for python applications to assume their data is in the same directory as the executable. In such a case, you can either put a wrapper script or a soft link into /usr/bin.

Stand-alone scripts like namcap.py that don't travel with their own directory can be put directly into /usr/bin.

In your case, the codeEditor application imports the PythonCard module, so I would leave everything in site-packages. I don't use Mandrake, but in Arch, it should definitely not be put into /usr/share. /usr/share is for application data only, not scripts or libs.

Anyone who is still running python 2.4 can easily hack your package accordingly. The default, simple, approach is to assume that your users keep their packages up to date. I would not complicate the build script by adding a custom variable (which is discouraged anyway) for the exceptional case.

E.g.,

pkgname=pythoncard
# Contributor : Jason Ashlock <jcashlock@gmail.com>
pkgver=0.8.2
pkgrel=1
pkgdesc="GUI construction kit for cross-platform desktop applications using wxpython"
arch=('i686' 'x86_64')
url="http://pythoncard.sourceforge.net/"
license=('BSD')
depends=('wxpython')
source=(http://downloads.sourceforge.net/sourceforge/$pkgname/PythonCard-$pkgver.tar.gz
        codeEditor)
md5sums=('109913b19baba90aff5c95949e5aa1ff'
         '0489d84bd2af02fabc61ebcb41e10cf8')

build() {
  cd $startdir/src/PythonCard-$pkgver
  python setup.py install --root=$startdir/pkg || return 1
  rm $startdir/pkg/usr/bin/install-pythoncard.py
  echo "PythonCard" > $startdir/pkg/usr/lib/python2.5/site-packages/$pkgname.pth
  cp $startdir/codeEditor $startdir/pkg/usr/bin
  install -d $startdir/pkg/usr/share/licenses/$pkgname
  cp LICENSE.txt $startdir/pkg/usr/share/licenses/$pkgname
}

Hope this helps, and welcome to Arch. Don't be surprised if someone corrects some part of what I have written, but it should at least give you a good start.

Offline

Board footer

Powered by FluxBB