Mixed archives woes

Pontus Stenetorp ninjin at kth.se
Mon Apr 2 20:06:12 UTC 2007

Dmitry Marakasov wrote:
> * Pontus Stenetorp (ninjin at kth.se) wrote:
>> I have been working on a port for pyFastaudio bindings, well I have got
>> a lot of help from Carl Johan Gustavsson. But now I have run into some
>> severe problems. In order to build properly pyFastaudio requires the
>> source for Fastaudio. This has all been sorted out, but there is a
>> packaging problem. Fastaudio is distributed using zip and pyFastaudio as
>> tar. The solution at the moment has been to re-pack Fastaudio to tar and
>> then distribute it from another ftp. This feels rather ugly, but is it
>> in your opinion a "good" solution? Or is there a know better solution?
>> The Makefile is pasted below.
> You should redefine do-extract target in your port's Makefile, and
> add extraction commands for all your files there. For example, see:
> /usr/ports/games/quake2-ctf/Makefile [just what you need]
> /usr/ports/www/webalizer/Makefile [extreme case, but interesting]
> Another way is to run `make patch` for the port you depend on
> (see /usr/ports/databases/postgresql-plruby/Makefile:52), but I won't
> recommend it, as it's more likely that terrible problems will arise.
>> This is my first port and the handbook has been a great help but when it
>> comes to this I can't find any answers. I am not a member of the ports
>> mailing list so please cc me if you reply.
> Handbook only gives you general information. When I encounter difficult
> situation, I usually look through /usr/ports/Mk to discover exact
> behavior of the ports system in specific case and/or search for examples
> in other ports. To ease the process, I've indexed all Makefiles in a
> single file, with this:
> find /usr/ports -name Makefile -mindepth 3 -maxdepth 3 -exec grep -H ''
> Same for pkg-plist's and rc.d scripts.

I have added do-extract and made some changes to the Makefile. Now it
uses both tar and zip and works nicely. It looks like displayed below
and I will submit it in a few hours if no one spots any horrid mistakes
or design flaws that I have made and feel like informing me about it.

# New ports collection makefile for: py-fastaudio
# Date created:		3 March 2007
# Whom:			Pontus Stenetorp <ninjin at kth.se>
#			Carl Johan Gustavsson <cjg at bsdmail.org>
# $FreeBSD$

PORTNAME=	fastaudio
CATEGORIES=	audio python
MASTER_SITES=	http://www.freenet.org.nz/python/pyPortAudio/:site1 \
DISTNAME=	fastaudio
DISTFILES=	fastaudio.tar.gz:site1 portaudio_v18_1.zip:site2

MAINTAINER=	ninjin at kth.se
COMMENT=	Python bindings for the PortAudio multi-platform audio library

BUILD_DEPENDS=	pyrexc:${PORTSDIR}/devel/pyrex
LIB_DEPENDS=	portaudio:${PORTSDIR}/audio/portaudio

PLIST_FILES=	lib/%%PYTHON_VERSION%%/site-packages/fastaudio.so

USE_ZIP=	yes

FASTA_SRCFILE=	fastaudio.tar.gz
PORTA_SRCFILE=	portaudio_v18_1.zip
PORTASRC_DIR=	${WRKDIR}/portaudio_v18_1/

.if !defined(WITHOUT_EXAMPLES)
PLIST_DIRS+=	share/examples/py-${PORTNAME}
PLIST_FILES+=	share/examples/py-${PORTNAME}/demo.py

	@${UNZIP_CMD} -q -d ${WRKDIR}/ \

		${WRKSRC}/setup.py ${WRKSRC}/mysndfile.h
# Borrowed from the portaudio port, fixes obsolete path
	@${REINPLACE_CMD} -e 's|machine\/soundcard.h|sys\/soundcard.h|' \

.if !defined(WITHOUT_EXAMPLES)

.include <bsd.port.mk>

Thank you for helping me solve this.

Pontus Stenetorp

More information about the freebsd-ports mailing list