dchappelle said:
The binary python tarballs are compatible with pkg_add so someone must have already went through the pains of packaging it.
What binary Python tarballs? Python is only officially distributed in binary format for Windows, AFAIK.
What I want to be able to do is type:
[red]./configure ...[/red]
make
make package
and have a package created that I can use with pkg_add.
If you're making packages, you should be using ports, which means
not using the configure (or any other build/install) scripts which are included with the official release. Ports wraps all of the build up, such that you only interact with the port's Makefile.
To configure the port, use
make config. This gives you access to a couple of options (which get passed to
configure when the port is built). If you need options which the Makefile does not make available, you can hack them in by adding the appropriate strings into the CONFIGURE_ARGS variable within the port's Makefile. For example, if you wanted to build with Py_DEBUG (a configure option available in Python 2.6 which isn't exposed by the Makefile), a quick hack would be to just add the line
CONFIGURE_ARGS+= --enable-pydebug. A more robust approach would be to add a new option, but it probably isn't necessary if you're just going to build once and redistribute the package.
You can sometimes get away with re-running the
configure script
after the Makefile does, such that it builds with the options you configure it with. The downside here is that you might overlook and overwrite something that the Makefile does and end up with a broken binary.
ie,
Code:
cd /usr/ports/lang/python26
make config
./work/Python-2.6/configure
make package
In any case, if you're using configure args which aren't exposed by the Makefile, you might end up with a binary which doesn't work -- only the options available in the Makefile are typically "guaranteed" to work. With some of the more exotic options available, you might find cases which require patching the application's source before it builds/runs properly.