Re: Mixed archives woes

2007-04-02 Thread Pontus Stenetorp
Dmitry Marakasov wrote:
> * Pontus Stenetorp ([EMAIL PROTECTED]) 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 ''
> {} \; >MAKEFILES.ALL
> 
> 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 <[EMAIL PROTECTED]>
#   Carl Johan Gustavsson <[EMAIL PROTECTED]>
#
# $FreeBSD$
#

PORTNAME=   fastaudio
PORTVERSION=0.1
CATEGORIES= audio python
MASTER_SITES=   http://www.freenet.org.nz/python/pyPortAudio/:site1 \
http://www.portaudio.com/archives/:site2
PKGNAMEPREFIX=  ${PYTHON_PKGNAMEPREFIX}
DISTNAME=   fastaudio
DISTFILES=  fastaudio.tar.gz:site1 portaudio_v18_1.zip:site2
DIST_SUBDIR=python

MAINTAINER= [EMAIL PROTECTED]
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
PLIST_DIRS=
EXAMPLESDIR=${LOCALBASE}/share/examples/py-${PORTNAME}

USE_ZIP=yes
USE_PYTHON= yes
USE_PYDISTUTILS=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
.endif

do-extract:
@${MKDIR} ${WRKDIR}
@${TAR} zxf ${DISTDIR}/${DIST_SUBDIR}/${FASTA_SRCFILE} -C ${WRKDIR}
@${UNZIP_CMD} -q -d ${WRKDIR}/ \
${DISTDIR}/${DIST_SUBDIR}/${PORTA_SRCFILE}

post-patch:
@${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \
${WRKSRC}/setup.py ${WRKSRC}/mysndfile.h
# Borrowed from the portaudio port, fixes obsolete path
@${REINPLACE_CMD} -e 's|machine\/soundcard.h|sys\/soundcard.h|' \
${PORTASRC_DIR}/pa_unix_oss/pa_unix_oss.c

post-install:
.if !defined(WITHOUT_EXAMPLES)
( ${MKDIR} ${EXAMPLESDIR} && \
${INSTALL_DATA} ${WRKSRC}/demo.py ${EXAMPLESDIR}/ )
.endif

.include 


Thank you for helping me solve this.

Regards,
Pontus Stenetorp
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Mixed archives woes

2007-04-01 Thread Dmitry Marakasov
* Pontus Stenetorp ([EMAIL PROTECTED]) 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 ''
{} \; >MAKEFILES.ALL

Same for pkg-plist's and rc.d scripts.

-- 
Best regards,
  Dmitry Marakasov   mailto:[EMAIL PROTECTED]

___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "[EMAIL PROTECTED]"


Re: Mixed archives woes

2007-04-01 Thread Simon Barner
Pontus Stenetorp wrote:
> Greetings,
> 
> 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?

Re-packing the zip archive is not a good idea since you'll have to do it
for every new release, you will not notice when the archive receives an
silent update (without version bump) and you do not take advantage of
the upstream's mirrors.

So I'd suggest that you either define the do-extract: target and do
all the uncompressing manually or to have the .tar.gz archive extracted
by the standard mechanisms and only extract the .zip archive in a
custom post-extract: target.

Feel free to post your updated Makefile for review,

HTH,

-- 
Best regards / Viele Grüße, [EMAIL PROTECTED]
 Simon Barner[EMAIL PROTECTED]


pgpG5pomqHbR9.pgp
Description: PGP signature


Mixed archives woes

2007-03-31 Thread Pontus Stenetorp
Greetings,

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.

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.

Best regards,
Pontus Stenetorp

# New ports collection makefile for: py-fastaudio
# Date created: 3 March 2007
# Whom: Pontus Stenetorp <[EMAIL PROTECTED]>
#   Carl Johan Gustavsson <[EMAIL PROTECTED]>
#
# $FreeBSD$
#

PORTNAME=   fastaudio
PORTVERSION=0.1
CATEGORIES= audio python
MASTER_SITES=   http://www.freenet.org.nz/python/pyPortAudio/:site1 \
http://cjg.mine.nu/~ninjin/distfiles/:site2
PKGNAMEPREFIX=  ${PYTHON_PKGNAMEPREFIX}
DISTNAME=   fastaudio
DISTFILES=  fastaudio.tar.gz:site1 portaudio_v18_1.tar.gz:site2
DIST_SUBDIR=python

MAINTAINER= [EMAIL PROTECTED]
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
PLIST_DIRS=
EXAMPLESDIR=${LOCALBASE}/share/examples/py-${PORTNAME}

USE_PYTHON= yes
USE_PYDISTUTILS=yes

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

post-patch:
@${REINPLACE_CMD} -e 's|%%LOCALBASE%%|${LOCALBASE}|g' \
${WRKSRC}/setup.py ${WRKSRC}/mysndfile.h
# Borrowed from the portaudio port, fixes obsolete path
@${REINPLACE_CMD} -e 's|machine\/soundcard.h|sys\/soundcard.h|' \
${WRKSRC}/../portaudio_v18_1/pa_unix_oss/pa_unix_oss.c

post-install:
.if !defined(WITHOUT_EXAMPLES)
( ${MKDIR} ${EXAMPLESDIR} && \
${INSTALL_DATA} ${WRKSRC}/demo.py ${EXAMPLESDIR}/ )
.endif

.include 

--
Pontus StenetorpE-mail: [EMAIL PROTECTED]
Drottning Kristinas väg 73 1:2  URL: http://www.d.kth.se/~ninjin
114 28 Stockholm, SwedenTel: (+46) 8 5000 39 37
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "[EMAIL PROTECTED]"