From owner-freebsd-ports@FreeBSD.ORG Tue May 15 19:11:15 2012 Return-Path: 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 F3E57106564A; Tue, 15 May 2012 19:11:14 +0000 (UTC) (envelope-from fernando.apesteguia@gmail.com) Received: from mail-lpp01m010-f54.google.com (mail-lpp01m010-f54.google.com [209.85.215.54]) by mx1.freebsd.org (Postfix) with ESMTP id 364B58FC16; Tue, 15 May 2012 19:11:14 +0000 (UTC) Received: by laai10 with SMTP id i10so4935541laa.13 for ; Tue, 15 May 2012 12:11:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; bh=WZDwI9ys9QuKzMLJaj48PrlvaoOlRQoy/alEnA8gmvo=; b=HRU9vQ8X/T4uh2hahnZp5Kbq4sIKQnvdgawxkpnlayeR96cu7C2qw2oNC52uCDcATP u6yvUbxM7Cd0XAlNj7EMTtPYNrGjzAo2M5gT2jg5qoEwbFAV4P79FfFlKogmnW5Sk30R gcYj4FpYS9jt3aDILhPwK2QKCVYNXzrZES887hqyiwxDjYhNf50cOyPnJ/ewRzHkkVK0 89gkAPuCDzt9NOuhjhwTVKvQUcBYkc0aAVSbA/ZuOz3QweSf/N0R+0jH4JvNAgNapd5q /6xG3SDACt2ialBLOlyntmD4KoThtQeeykpF9YXIqLi+DmtTetLRbQi2wDx6FH1YXXgV rqOQ== MIME-Version: 1.0 Received: by 10.152.128.137 with SMTP id no9mr199413lab.2.1337109071997; Tue, 15 May 2012 12:11:11 -0700 (PDT) Received: by 10.152.24.131 with HTTP; Tue, 15 May 2012 12:11:11 -0700 (PDT) In-Reply-To: References: Date: Tue, 15 May 2012 21:11:11 +0200 Message-ID: From: =?ISO-8859-1?Q?Fernando_Apestegu=EDa?= To: Chris Rees Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-ports@freebsd.org Subject: Re: On file installation 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: Tue, 15 May 2012 19:11:15 -0000 On Tue, May 15, 2012 at 7:29 PM, Chris Rees wrote: > On 15 May 2012 18:14, Fernando Apestegu=EDa wrote: >> On Mon, May 14, 2012 at 7:40 PM, Fernando Apestegu=EDa >> wrote: >>> On Mon, May 14, 2012 at 7:31 PM, Chris Rees wrote: >>>> On 14 May 2012 18:23, Fernando Apestegu=EDa wrote: >>>>> Hi, >>>>> >>>>> I'm working on a port for an application written in Java and I'm >>>>> having some problems deciding how to install the application. >>>>> Previous to the installation, the WRKSRC directory contains some .jar >>>>> files and some directories along with some .txt files for >>>>> licenses, but also some .exe and .bat files _which I don't want to >>>>> install_. It is basically a package that contains both files for >>>>> windows and non-windows systems. >>>>> >>>>> I was thinking on using COPYTREE_SHARE to install everything and then >>>>> remove the non necessary files, but doesn't look like >>>>> an elegant solution. Also, I wouldn't like to explicitly specify ever= y >>>>> one of the files I want to copy. Is there a way of using something >>>>> similar to bash's extglob so I can copy !(*.exe|*bat)? If not, how to= proceed? >>>>> >>>>> I already looked at the existent ports to find something similar but >>>>> it seems hard to find. I also had a look at bsd.port.mk but >>>>> I couldn't find what I'm looking for. >>>> >>>> You can use find primaries with COPYTREE_SHARE such as; >>>> >>>> (cd ${WRKSRC}/wherever && ${COPYTREE_SHARE} \* >>>> ${JAVALIBDIR}/${PORTNAME}/wherever "-not -name \*.exe -and -not -name >>>> \*.bat" >>> >>> Thanks! I think that is what I was looking for :) >> >> Sorry guys, but I think I need more help :). I tried with the following = line: >> >> ( cd ${WRKSRC}/JDownloader && ${COPYTREE_SHARE} \* >> ${PREFIX}/${PORTNAME}/ "! -name \*.exe" ) >> >> but it doesn't seem to follow primaries and it still installs the .exe >> files. I just tried with: >> >> ( cd ${WRKSRC}/JDownloader && ${COPYTREE_SHARE} \* >> ${PREFIX}/${PORTNAME}/ "! -name JDownloader.exe" ) >> >> and check that effectively the file is not installed so I suppose this >> has something to do with quoting and escaping special characters (the >> asterisk). I found the following line in audio/xmp/Makefile: >> >> ( cd ${WRKSRC}/docs && ${COPYTREE_SHARE} \* \ >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0${DOCSDIR} '! ( -name Makefile -or -name = xmp.1 \ >> =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0-or -name *.bak -or -name *.orig )' ) >> >> that seems pretty close to what I'm trying to do, so I tried with this: >> >> ( cd ${WRKSRC}/JDownloader && ${COPYTREE_SHARE} \* >> ${PREFIX}/${PORTNAME}/ '! ( -name *.exe )' ) >> >> but then, the asterisk is expanded and find fails: >> >> find: JDownloader.exe: unknown primary or operator >> >> what am I doing wrong? > > Escape the *; > > (cd ${WRKSRC}/JDownloader && ${COPYTREE_SHARE} \* ${PREFIX}/${PORTNAME}/ > =A0'! ( -name \*.exe )' ) That executes the following: (cd /usr/home/fernape/porting/jdownloader/port/work/JDownloader && /bin/sh -c '(/usr/bin/find -d $0 $2 | /usr/bin/cpio -dumpl $1 >/dev/null 2>&1) && /usr/sbin/chown -R root:wheel $1 && /usr/bin/find -d $0 $2 -type d -exec chmod 755 $1/{} \; && /usr/bin/find -d $0 $2 -type f -exec chmod 444 $1/{} \;' -- \* /usr/local/jdownloader/ '! ( -name \*.exe )' ) which results in: $ ls /usr/local/jdownloader JDUpdate.exe JDownloaderBETA.exe jd/ license.txt outdated.dat tools/ windows_restore.bat JDownloader.exe JDownloaderD3D.exe jdupdate.jar license_german.txt plugins/ version.txt JDownloader.jar java/ libs/ licenses/ tmp/ windows_createlog.bat The .exe files are still there. > > Chris