Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 17 Dec 2011 14:23:25 +0400
From:      Ruslan Mahmatkhanov <cvs-src@yandex.ru>
To:        Christer Edwards <christer.edwards@gmail.com>
Cc:        "freebsd-ports@FreeBSD.org" <freebsd-ports@freebsd.org>
Subject:   Re: RUN_DEPENDS for python based port
Message-ID:  <4EEC6D9D.1020102@yandex.ru>
In-Reply-To: <CAH2d3%2BvMF8jM6GHJQ6DR7EywmnY%2Bj=0tSHFEf_5oW1C6QhYD8A@mail.gmail.com>
References:  <CAH2d3%2BvMF8jM6GHJQ6DR7EywmnY%2Bj=0tSHFEf_5oW1C6QhYD8A@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Christer Edwards wrote on 17.12.2011 11:54:
> I've been working on building my first python based port recently and
> I'm running into some issue that I'm hoping the list can provide some
> tips for. Currently the Makefile looks like this:
> 
> -----
> 
> # New ports collection makefile for: salt
> # Date created:         17 Dec 2011
> # Whom:                 cedwards
> #
> # $FreeBSD$
> #
> 
> PORTNAME=       salt
> PORTVERSION=    0.9.4
> CATEGORIES=     sysutils python
> MASTER_SITES=   https://github.com/downloads/saltstack/salt/
> 
> MAINTAINER=     christer.edwards@gmail.com
> COMMENT=        Central system and configuration manager
> 
> LIB_DEPENDS=    zmq.1:${PORTSDIR}/devel/zmq
> 
> USE_PYTHON=     yes
> USE_PYDISTUTILS=yes
> 
> RUN_DEPENDS+=
> ${PYTHON_SITELIBDIR}/yaml/__init__.py:${PORTSDIR}/devel/py-yaml \
> 
> ${PYTHON_SITELIBDIR}/zmq/__init__.py}:${PORTSDIR}/devel/py-pyzmq \
> 
> ${PYTHON_SITELIBDIR}/Crypto/Cipher/__init__.py:${PORTSDIR}/security/py-pycrypto
> \
> 
> ${PYTHON_SITELIBDIR}/${PYEASYINSTALL_EGG}/jinja2/__init__.py:${PORTSDIR}/devel/py-Jinja2
> \
> 
> ${PYTHON_PKGNAMEPREFIX}M2Crypto>=0:${PORTSDIR}/security/py-m2crypto
> 
> .include <bsd.port.mk>
> 
> -----
> 
> I'm not sure if I've done the RUN_DEPENDS properly, because when I try
> to 'make' the port, it tries running the salt tool and complains about
> missing python modules. The modules are of course provided by the
> depends, but they don't get installed if they're missing.
> 
> I'd really like whatever feedback the list can offer to getting this
> ported properly.
> 
> Cheers,
> Christer

Chris and Matthew already noted what the problems are.
I also suggest to use:

${PYTHON_PKGNAMEPREFIX}yaml>=0:${PORTSDIR}/devel/py-yaml

instead of:

${PYTHON_SITELIBDIR}/yaml/__init__.py:${PORTSDIR}/devel/py-yaml
and
${PYTHON_SITELIBDIR}/${PYEASYINSTALL_EGG}/jinja2/__init__.py:${PORTSDIR}/devel/py-Jinja2

Right now you use three possible forms to depend on needed ports.
Better do this change because if sometime some of dependent packages
will be converted to installing via setuptools (eggs packaging) you'll
need to fix them in your port, because there will not be
`yaml/__init__.py' anymore for example.
First construct will work in both cases and unification is always good
thing to do.

And the second note. setup.py discloses that:
1. Port will work with python2.6/2.7 only
   'Programming Language :: Python :: 2.6',
   'Programming Language :: Python :: 2.7',
2. Code licensed by Apache Software License.
   'License :: OSI Approved :: Apache Software License'

So USE_PYTHON=yes should be changed with USE_PYTHON=	2.6-2.7, (otherwise
port build will fail with python3) and LICENSE=	ASL worth to be added.

-- 
Regards,
Ruslan

Tinderboxing kills... the drives.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?4EEC6D9D.1020102>