From owner-freebsd-ports@FreeBSD.ORG Thu Feb 1 22:14:52 2007 Return-Path: X-Original-To: ports@freebsd.org Delivered-To: freebsd-ports@FreeBSD.ORG Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 0958416A400 for ; Thu, 1 Feb 2007 22:14:52 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from smtp.infracaninophile.co.uk (imap.infracaninophile.co.uk [81.187.76.162]) by mx1.freebsd.org (Postfix) with ESMTP id 747BD13C48D for ; Thu, 1 Feb 2007 22:14:51 +0000 (UTC) (envelope-from m.seaman@infracaninophile.co.uk) Received: from [IPv6:::1] (localhost.infracaninophile.co.uk [IPv6:::1]) by smtp.infracaninophile.co.uk (8.13.8/8.13.8) with ESMTP id l11LvKgV015570; Thu, 1 Feb 2007 21:57:20 GMT (envelope-from m.seaman@infracaninophile.co.uk) Message-ID: <45C26238.9050405@infracaninophile.co.uk> Date: Thu, 01 Feb 2007 21:57:12 +0000 From: Matthew Seaman Organization: Infracaninophile User-Agent: Thunderbird 1.5.0.9 (X11/20070120) MIME-Version: 1.0 To: Luigi Rizzo References: <20070201110345.A83474@xorpc.icir.org> In-Reply-To: <20070201110345.A83474@xorpc.icir.org> X-Enigmail-Version: 0.94.0.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------enig8EC1BA4C1FB509A2E580A759" X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-3.0 (smtp.infracaninophile.co.uk [IPv6:::1]); Thu, 01 Feb 2007 21:57:36 +0000 (GMT) X-Virus-Scanned: ClamAV 0.88.7/2513/Thu Feb 1 16:48:53 2007 on happy-idiot-talk.infracaninophile.co.uk X-Virus-Status: Clean X-Spam-Status: No, score=-2.5 required=5.0 tests=AWL,BAYES_00, DKIM_POLICY_TESTING,NO_RELAYS autolearn=ham version=3.1.7 X-Spam-Checker-Version: SpamAssassin 3.1.7 (2006-10-05) on happy-idiot-talk.infracaninophile.co.uk Cc: ports@freebsd.org Subject: Re: proper way to do a recursive install ? X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 01 Feb 2007 22:14:52 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig8EC1BA4C1FB509A2E580A759 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: quoted-printable Luigi Rizzo wrote: > I have a port that just need to install the content of a tarball > (a set of headers and C sources) into > /usr/local/share/linux-bsd-kmod/linux_compat, >=20 > and was wondering what is the proper way to handle this (both in > the port's Makefile and in the pkg_plist file). > do-install: > ${MKDIR} -p ${MY_DST} > cp -Rp ${WRKSRC} ${MY_DST} > find ${MY_DST} -type f -exec chmod ${SHAREMODE} \{\} \; > chown -R ${SHAREOWN}:${SHAREGRP} ${MY_DST} cpio is a common choice for this. For instance this example from the java/diablo-jre15 port: do-install: ${MKDIR} "${INSTALL_DIR}" cd "${WRKSRC}" && ${FIND} . \ | ${CPIO} -pdmu -R ${LIBOWN}:${LIBGRP} "${INSTALL_DIR}" cpio is handy because it can set the ownership on the installed files in the same pass as they are installed. It relies on the correct permissions being set in the source directory, which it will apply to the copied files and directories (although use of 'find -depth' does give best results for directory permissions). There are plenty of other choices around the ports tree though. > #--- this is pkg-plist 000 > @exec mkdir -p %D/share/linux-bsd-kmod > @exec echo "installing into %D/share/linux-bsd-kmod" > @unexec echo "uninstalling into %D/share/linux-bsd-kmod" > @unexec rm -rf %D/share/linux-bsd-kmod If your build process generates a constant set of files, then why wouldn't you just generate a pkg-plist exactly as would be done for any other port? It might be a bit long, but so what? We have computers that can wrangle all that stuff for us. http://www.freebsd.org/doc/en_US.ISO8859-1/books/porters-handbook/plist-a= utoplist.html You can even generate a PLIST on the fly as an afterthought to the build process, although nowadays the preference is to have a static pkg-plist or else use the PLIST_DIRS and PLIST_FILES make variables unless there are good reasons not to do so.=20 See, for instance the code that implements the PORTDOCS functionality in bsd.port.mk. Or this example from the phpmyadmin port I maintain: post-patch: ${CP} ${FILESDIR}/${CFGFILE}.sample ${WRKSRC}/${CFGFILE}.sample cd ${WRKSRC} ; \ ${FIND} . ! -type d ! -name ${CFGFILE}.sample | ${SORT} | \ ${SED} -e "s,^\.,%%MYADMDIR%%," >${PLIST} ; \ ${CAT} ${PKGDIR}/pkg-plist-chunk >>${PLIST} ; \ ${FIND} . -type d | ${SORT} -r | ${SED} \ -e "s,^\.$$,@dirrmtry %%MYADMDIR%%," \ -e "s,^\.,@dirrm %%MYADMDIR%%," >>${PLIST} Cheers, Matthew --=20 Dr Matthew J Seaman MA, D.Phil. 7 Priory Courtyard Flat 3 PGP: http://www.infracaninophile.co.uk/pgpkey Ramsgate Kent, CT11 9PW --------------enig8EC1BA4C1FB509A2E580A759 Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.1 (FreeBSD) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org iD8DBQFFwmJA8Mjk52CukIwRCFHiAKCTLH0Pezxn7YvTt2Agrq0nQ6vB+gCfWrrT 3A0gD1wff1OojEScqEFMCcE= =SpkP -----END PGP SIGNATURE----- --------------enig8EC1BA4C1FB509A2E580A759--