Questions about creating a port
Florent Thoumie
flz at xbsd.org
Wed Feb 16 13:12:10 PST 2005
Alejandro Pulver wrote:
> Hello,
>
> I want to create a port of the modified version of 'generator' called 'generator-cbiere'.
>
> I partially made the port: it compiles and runs, but I have some questions about the distribution, installation, patching, compiler warnings and type decalrations.
>
> Distribution:
>
> The program is distributed by the author as a (complete) compressed (tar/bz2) source called 'generator-0.35-cbiere.tar.bz2', or as a compressed (bz2) patch called 'generator-0.35-cbiere.udiff.bz2' (that must be applied to the original version of 'generator').
>
> Both are called in a non-standard format ("${PORTNAME}${PORTVERSION}-cbiere"), I think it should be 'generator-cbiere-0.35'. So (for using the complete source) I have to change ${DISTFILES} (or ${DISTNAME} and ${EXTRACT_SUFX}) and ${WORKSRC}, or upload that file to my server with the correct name.
>
> Which one is the best method to distribute the port (full source or patch)? Can I include the patch (96386 bytes) directly in the 'files/' directory of the port?
I'll use full source, and modify DISTFILES, try to use upstream sites.
> Installation:
>
> The program is installed as 'bin/generator-gtk', like 'generator' (the original version), so they will conflict. How can I avoid this (I mean how to rename the binary 'generator-gtk' to 'generator-cbiere-gtk')?
You can either set CONFLICTS or use in-line editing (USE_REINPLACE and
REINPLACE_CMD) to modify the Makefile so that it installs generator
binary under a different name.
> Compiler warnings:
>
> There are (a lot of) compiler warnings about unused variables. The original port ('generator') does not show them, so I suppose the responsible is who did the patch. Should I fix them?
You can try to fix them removing unused variables and sending patches
upstream (to the developers). I guess you could use :
CFLAGS += -Wno-unused too.
> Type decalrations:
>
> The modified version (generator-cbiere) did not compile because there was an invalid type declaration "u_int64_t", that I changed into "uint64_t". Then I noticed declarations saying "uint8", and I think the standard defines it as "uint8_t". Should I change them?
Just do a patch, or use REINPLACE_CMD.
> Patching:
>
> In almost all the cases I will end with more than one patch, so: should I use different patches or merge them in one?
Try to create a patch for each file modified and name it like these :
x patch-src::Makefile.in if the patch modifies
${WRKDIR}/src/Makefile.in.
x patch-foo.c if the patch modifies ${WRKDIR}/foo.c.
Put these patches in ${FILESDIR} (files/).
--
Florent Thoumie
flz at xbsd.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : http://lists.freebsd.org/pipermail/freebsd-ports/attachments/20050216/653e0afc/signature.bin
More information about the freebsd-ports
mailing list