Re: Data files and ports

2010-06-15 Thread Eitan Adler
On Fri, Jun 11, 2010 at 4:58 PM, Jesse Smith  wrote:
...
> I'm trying to port a program which is distributed in two separate
> packages from the upstream project. One package contains the executable
> program and the other contains data files. The Data package rarely
> changes. The idea being packaging them together would use up a lot of
> extra bandwidth.
>
...
> My instinct is to create a separate port for the Data package and list
> it as a dependency for the Executable port. I'd appreciate some
> guidance.
>

Others have already mentioned some ways for you to do this.
I just want to bring to your attention the games/doom and
games/doom-data ports as well as a few others

% ls -d /usr/ports/*/*-data|wc -l
31

-- 
Eitan Adler
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"


Re: Data files and ports

2010-06-11 Thread Max Brazhnikov
On Fri, 11 Jun 2010 16:29:18 -0300Fri, 11 Jun 2010 17:41:45 +0300, Jesse Smith 
wrote:
> Thanks to everyone who replied. There were some good points made all
> around. Let's say that I do decide to go with the idea of making the
> Data files a separate port. How do I tell the Ports system not to try to
> build the data file and instead just install the files to a location of
> my choosing? Usually a project's Makefile decides what gets built and
> where items go, but data packages are... dumb, they're just files. My
> thought is to create a patch which adds a Makefile to the "work"
> directory after the archive is untarred, which would handle the "make"
> and "make install" commands.

from bsd.port.mk:
# NO_BUILD  - Use a dummy (do-nothing) build target.
# NO_INSTALL- Use a dummy (do-nothing) install target.

COPYTREE_SHARE macro which copies the directory entire with its subtree and 
sets correct permissions can be useful for your port as well.

Max
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"


Re: Data files and ports

2010-06-11 Thread Jesse Smith
-Original Message-
From: Peter Pentchev 
To: Greg Larkin 
Cc: Jesse Smith , freebsd-ports

Subject: Re: Data files and ports
Date: Fri, 11 Jun 2010 17:41:45 +0300

On Fri, Jun 11, 2010 at 10:17:46AM -0400, Greg Larkin wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> Jesse Smith wrote:
> > I'm trying to teach myself how to build a FreeBSD port and, with a lot
> > of help from the manual, it's going well. I have a question though
> > concerning policy/style.
> > 
> > I'm trying to port a program which is distributed in two separate
> > packages from the upstream project. One package contains the executable
> > program and the other contains data files. The Data package rarely
> > changes. The idea being packaging them together would use up a lot of
> > extra bandwidth.
> > 
> > Which brings me to the question: Since the executable relies on the data
> > files being in place before it's run, how should I handle that in the
> > port? Should I just get the executable to install and let the user
> > manually get the data files? Should I create a second port for the data
> > package? Or should I find some way of making the executable's makefile
> > download and unpack the data package?
> > 
> > My instinct is to create a separate port for the Data package and list
> > it as a dependency for the Executable port. I'd appreciate some
> > guidance.
> > 
> > Thanks.
> 
> Hi Jesse,
> 
> Welcome to the fray, and I'm glad to hear that you're learning how to
> develop FreeBSD ports!
> 
> To answer your question - your port Makefile can download multiple
> distribution files from the upstream download site.  For a couple of
> examples, see these Makefiles:
[snip]

All good points, and good examples.  However... :)

Well, I do believe that if "the Data package rarely changes", then it
would be unnecessary not only to distribute it each time as a port's
source distfile, but also to include it (unchanged) in different
releases of the *packages* that the port builds.  Thus, IMHO it would
be best to make a separate port for the data file and have the main
program (port) depend on it.  This would make sure that not only people
who build the port "by hand" do not download the data file more often
than necessary, but also the people who use packages do not download
needlessly big packages for each program update with no data change.

Hope that came out clear enough; I know I'm not thinking straight today.

G'luck,
Peter

---

Thanks to everyone who replied. There were some good points made all
around. Let's say that I do decide to go with the idea of making the
Data files a separate port. How do I tell the Ports system not to try to
build the data file and instead just install the files to a location of
my choosing? Usually a project's Makefile decides what gets built and
where items go, but data packages are... dumb, they're just files. My
thought is to create a patch which adds a Makefile to the "work"
directory after the archive is untarred, which would handle the "make"
and "make install" commands.

Would that be an acceptable practise?

Jesse



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


Re: Data files and ports

2010-06-11 Thread Paul Schmehl
--On Friday, June 11, 2010 10:58:50 -0300 Jesse Smith  
wrote:



I'm trying to teach myself how to build a FreeBSD port and, with a lot
of help from the manual, it's going well. I have a question though
concerning policy/style.

I'm trying to port a program which is distributed in two separate
packages from the upstream project. One package contains the executable
program and the other contains data files. The Data package rarely
changes. The idea being packaging them together would use up a lot of
extra bandwidth.

Which brings me to the question: Since the executable relies on the data
files being in place before it's run, how should I handle that in the
port? Should I just get the executable to install and let the user
manually get the data files? Should I create a second port for the data
package? Or should I find some way of making the executable's makefile
download and unpack the data package?

My instinct is to create a separate port for the Data package and list
it as a dependency for the Executable port. I'd appreciate some
guidance.



I think your instinct is correct.

You *could* put logic into the Makefile of a single port to verify that the 
data files are the most recent ones, but having a second port makes a great 
deal more sense to me, especially since the executables will be updating on a 
more frequent basis than the data files.  Just make the data file port a 
RUN_DEPENDS of the executable port.


--
Paul Schmehl, Senior Infosec Analyst
As if it wasn't already obvious, my opinions
are my own and not those of my employer.
***
"It is as useless to argue with those who have
renounced the use of reason as to administer
medication to the dead." Thomas Jefferson

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


Re: Data files and ports

2010-06-11 Thread Peter Pentchev
On Fri, Jun 11, 2010 at 10:17:46AM -0400, Greg Larkin wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
> 
> Jesse Smith wrote:
> > I'm trying to teach myself how to build a FreeBSD port and, with a lot
> > of help from the manual, it's going well. I have a question though
> > concerning policy/style.
> > 
> > I'm trying to port a program which is distributed in two separate
> > packages from the upstream project. One package contains the executable
> > program and the other contains data files. The Data package rarely
> > changes. The idea being packaging them together would use up a lot of
> > extra bandwidth.
> > 
> > Which brings me to the question: Since the executable relies on the data
> > files being in place before it's run, how should I handle that in the
> > port? Should I just get the executable to install and let the user
> > manually get the data files? Should I create a second port for the data
> > package? Or should I find some way of making the executable's makefile
> > download and unpack the data package?
> > 
> > My instinct is to create a separate port for the Data package and list
> > it as a dependency for the Executable port. I'd appreciate some
> > guidance.
> > 
> > Thanks.
> 
> Hi Jesse,
> 
> Welcome to the fray, and I'm glad to hear that you're learning how to
> develop FreeBSD ports!
> 
> To answer your question - your port Makefile can download multiple
> distribution files from the upstream download site.  For a couple of
> examples, see these Makefiles:
[snip]

All good points, and good examples.  However... :)

Well, I do believe that if "the Data package rarely changes", then it
would be unnecessary not only to distribute it each time as a port's
source distfile, but also to include it (unchanged) in different
releases of the *packages* that the port builds.  Thus, IMHO it would
be best to make a separate port for the data file and have the main
program (port) depend on it.  This would make sure that not only people
who build the port "by hand" do not download the data file more often
than necessary, but also the people who use packages do not download
needlessly big packages for each program update with no data change.

Hope that came out clear enough; I know I'm not thinking straight today.

G'luck,
Peter

-- 
Peter Pentchev  r...@ringlet.netr...@space.bgr...@freebsd.org
PGP key:http://people.FreeBSD.org/~roam/roam.key.asc
Key fingerprint FDBA FD79 C26F 3C51 C95E  DF9E ED18 B68D 1619 4553


signature.asc
Description: Digital signature


Re: Data files and ports

2010-06-11 Thread RW
On Fri, 11 Jun 2010 10:58:50 -0300
Jesse Smith  wrote:

> I'm trying to port a program which is distributed in two separate
> packages from the upstream project. One package contains the
> executable program and the other contains data files. The Data
> package rarely changes. The idea being packaging them together would
> use up a lot of extra bandwidth.

> Which brings me to the question: Since the executable relies on the
> data files being in place before it's run, how should I handle that
> in the port? Should I just get the executable to install and let the
> user manually get the data files? Should I create a second port for
> the data package? Or should I find some way of making the
> executable's makefile download and unpack the data package?


I think it depends on how the data is versioned. If it has a version
number in the filename that's the same as the executable, then a single
port is best. If they have separate version numbers, then go with two
ports.


If the data is not versioned at all, it might be best to create a
data port that uses a snapshot that you host separately.
___
freebsd-ports@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-ports
To unsubscribe, send any mail to "freebsd-ports-unsubscr...@freebsd.org"


Re: Data files and ports

2010-06-11 Thread Greg Larkin
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Jesse Smith wrote:
> I'm trying to teach myself how to build a FreeBSD port and, with a lot
> of help from the manual, it's going well. I have a question though
> concerning policy/style.
> 
> I'm trying to port a program which is distributed in two separate
> packages from the upstream project. One package contains the executable
> program and the other contains data files. The Data package rarely
> changes. The idea being packaging them together would use up a lot of
> extra bandwidth.
> 
> Which brings me to the question: Since the executable relies on the data
> files being in place before it's run, how should I handle that in the
> port? Should I just get the executable to install and let the user
> manually get the data files? Should I create a second port for the data
> package? Or should I find some way of making the executable's makefile
> download and unpack the data package?
> 
> My instinct is to create a separate port for the Data package and list
> it as a dependency for the Executable port. I'd appreciate some
> guidance.
> 
> Thanks.

Hi Jesse,

Welcome to the fray, and I'm glad to hear that you're learning how to
develop FreeBSD ports!

To answer your question - your port Makefile can download multiple
distribution files from the upstream download site.  For a couple of
examples, see these Makefiles:

#1 - www/zend-framework:
http://www.freebsd.org/cgi/cvsweb.cgi/ports/www/zend-framework/Makefile?rev=1.48;content-type=text%2Fplain

Note the DISTFILES value and how it is affected by setting NOPORTDOCS.
You can show the different values like so:

cd /usr/ports/www/zend-framework
make -V DISTFILES
make NOPORTDOCS=yes -V DISTFILES

The ZF port is a little different than yours because the distribution
files do change at each release, but the idea is the same.

#2 - lang/gcc45:
http://www.freebsd.org/cgi/cvsweb.cgi/ports/lang/gcc45/Makefile?rev=1.444;content-type=text%2Fplain

This example is somewhat more complicated.  I recently worked with
gerald@ to include support for the GNU Java Compiler (gcj) in the gcc45
port.

Search for "WITHOUT_JAVA" in the file, and you can see some use of
additional distribution files, including the use of tagging
(http://www.freebsd.org/doc/en/books/porters-handbook/makefile-distfiles.html#PORTING-MASTER-SITES-N)
and preventing some distribution files from being automatically extracted.

If you have any further questions about your new port or the examples
above, please post back to the list.

Hope that helps,
Greg
- --
Greg Larkin

http://www.FreeBSD.org/   - The Power To Serve
http://www.sourcehosting.net/ - Ready. Set. Code.
http://twitter.com/sourcehosting/ - Follow me, follow you
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.7 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iD8DBQFMEkWK0sRouByUApARAi2RAJ9BsjY6G/uCNpjo5Hb3hMr0my+18gCgzO/N
1zbqQjs5FbBshIvSnYboHn0=
=RUVI
-END PGP SIGNATURE-

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


Data files and ports

2010-06-11 Thread Jesse Smith
I'm trying to teach myself how to build a FreeBSD port and, with a lot
of help from the manual, it's going well. I have a question though
concerning policy/style.

I'm trying to port a program which is distributed in two separate
packages from the upstream project. One package contains the executable
program and the other contains data files. The Data package rarely
changes. The idea being packaging them together would use up a lot of
extra bandwidth.

Which brings me to the question: Since the executable relies on the data
files being in place before it's run, how should I handle that in the
port? Should I just get the executable to install and let the user
manually get the data files? Should I create a second port for the data
package? Or should I find some way of making the executable's makefile
download and unpack the data package?

My instinct is to create a separate port for the Data package and list
it as a dependency for the Executable port. I'd appreciate some
guidance.

Thanks.



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