PYTHON_SITELIBDIR gets parsed incorrectly
Hello. I'm creating a port that uses python. I've set in Makefile: USE_PYTHON= yes PYTHON_SITELIBDIR=${PYTHON_SITELIBDIR:S|^${PREFIX}/||g} PLIST_SUB+= PYTHON_SITELIBDIR=${PYTHON_SITELIBDIR} And pkg-plist has entries a'la: %%BINDINGSPYTHON_SITELIBDIR%%/ This %%BINDINGS%% gets replaced with , so that should not be an issue. Anyway, when I install port, +CONTENTS contains lines a'la: /usr/local/lib/python2.5/site-packages/museek/__init__.py And when I try deinstalling it, I get errors a'la: pkg_delete: file '/usr/local//usr/local/lib/python2.5/site-packages/museek/__init__.py' doesn't exist Why do these files get prefixed with $LOCALBASE (or $PREFIX)? -- View this message in context: http://www.nabble.com/PYTHON_SITELIBDIR-gets-parsed-incorrectly-tp20930607p20930607.html Sent from the freebsd-ports mailing list archive at Nabble.com. ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: PYTHON_SITELIBDIR gets parsed incorrectly
Hello! On Wed, Dec 10, 2008 at 12:57:52AM -0800, Silver Salonen wrote: Hello. I'm creating a port that uses python. I've set in Makefile: USE_PYTHON= yes PYTHON_SITELIBDIR=${PYTHON_SITELIBDIR:S|^${PREFIX}/||g} PLIST_SUB+= PYTHON_SITELIBDIR=${PYTHON_SITELIBDIR} And pkg-plist has entries a'la: %%BINDINGSPYTHON_SITELIBDIR%%/ This %%BINDINGS%% gets replaced with , so that should not be an issue. Anyway, when I install port, +CONTENTS contains lines a'la: /usr/local/lib/python2.5/site-packages/museek/__init__.py This is wrong. They should be relative to ${LOCALBASE}, lib/python2.5/site-packages/bla-bla-bla in this case. Can't say why %) Examine the behavior of PYTHON_SITELIBDIR variable in the Makefile. And when I try deinstalling it, I get errors a'la: pkg_delete: file '/usr/local//usr/local/lib/python2.5/site-packages/museek/__init__.py' doesn't exist Why do these files get prefixed with $LOCALBASE (or $PREFIX)? 0.02$, Alexey. ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to [EMAIL PROTECTED]
Please include emulators/open-vm-tools in 7.1 release
The open-vm-tools port has been working fine for months, but at the time of RELEASE_7_1_0 tagging of the ports tree there were some pkg-list and install problems, so it was marked BROKEN. Those problems have been solved since several weeks now, so I think it would be really a pity non to have a binary package for open-vm-tools and open-vm-tools-nox11 in the 7.1 release. Thanks, Angelo Turetta ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: PYTHON_SITELIBDIR gets parsed incorrectly
On 12/10/08, Silver Salonen [EMAIL PROTECTED] wrote: Hello. I'm creating a port that uses python. I've set in Makefile: USE_PYTHON= yes PYTHON_SITELIBDIR=${PYTHON_SITELIBDIR:S|^${PREFIX}/||g} PLIST_SUB+= PYTHON_SITELIBDIR=${PYTHON_SITELIBDIR} And pkg-plist has entries a'la: %%BINDINGSPYTHON_SITELIBDIR%%/ This %%BINDINGS%% gets replaced with , so that should not be an issue. Anyway, when I install port, +CONTENTS contains lines a'la: /usr/local/lib/python2.5/site-packages/museek/__init__.py And when I try deinstalling it, I get errors a'la: pkg_delete: file '/usr/local//usr/local/lib/python2.5/site-packages/museek/__init__.py' doesn't exist Why do these files get prefixed with $LOCALBASE (or $PREFIX)? The problem is that you are redefining PYTHON_SITELIBDIR in PLIST_SUB. If you remove: PYTHON_SITELIBDIR=${PYTHON_SITELIBDIR:S|^${PREFIX}/||g} PLIST_SUB+= PYTHON_SITELIBDIR=${PYTHON_SITELIBDIR} from your make file, and use 'make -V PLIST_SUB' and 'make -V PYTHON_SITELIBDIR', you should get this: $ make -V PLIST_SUB PYVER=2.5 PYVER_WITHPAT=2.5.2 PYTHON_INCLUDEDIR=include/python2.5 PYTHON_LIBDIR=lib/python2.5 PYTHON_PLATFORM=freebsd8 PYTHON_SITELIBDIR=lib/python2.5/site-packages PYTHON_VERSION=python2.5 IF_DEFAULT= X86_ONLY=@comment 32BIT_ONLY=@comment NO_NIS= OSREL=8.0 PREFIX=%D LOCALBASE=/usr/local X11BASE=/usr/local PORTDOCS= PORTEXAMPLES= PORTDATA= LIB32DIR=lib XAWVER=8 PERL_VERSION=5.8.8 PERL_VER=5.8.8 PERL_ARCH=mach SITE_PERL=lib/perl5/site_perl/5.8.8 DOCSDIR=share/doc/python25 EXAMPLESDIR=share/examples/python25 DATADIR=share/python25 WWWDIR=www/python25 ETCDIR=etc/python25 $ make -V PYTHON_SITELIBDIR /usr/local/lib/python2.5/site-packages Scot ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: [PROPOSAL] Ports using SCM repositories as source instead of distfiles
Dmitry Marakasov writes: [...] Maybe we can introduce a hack in ports system like by adding some variable like 'USES_DYNAMIC_PLIST=yes' in Makefile, which fill let the port first installed with DESTDIR=/var/tmp/ports/${PORTNAME} and then a packing list is generated and then finally whole tree is moved to ${PREFIX}, hmm...? What do you say ? Current DESTDIR implementation uses chroot and obviously requires complete system installed in DESTDIR. Also installing a port will install all dependencies in the chroot as well. The Debian package building system, also expects the package files in a directory named ${packageroot}/debian/${packagename}/ which you can install by doing 'make install DESTDIR=debian/${packagename}' in ${packageroot} directory (the directory where you've extracted the package tarball, similar to the FreeBSD's ${WRKSRC} directory. So, my idea is to specify make -C ${WRKSRC} install DESTDIR=/var/tmp/${PORTNAME} in the install target of port's Makefile, not to be confused with upstream package's Makefile. And I think you confused it with passing 'DESTDIR' variable to 'make' commandline to start port building procedure: Following is an example illustrating how port is going to be installed in the way I'm thinking: , | % sudo make -C /usr/ports/editors/emacs-cvs install | ...checkout from CVS... | ...configuring... | ./configure --prefix=${LOCALBASE} ...and other configure options ... | ...configuration messages... | ...compilation begins... | make | ...compiling the files... | ...compilation over... | make install DESTDIR=/var/tmp/emacs | ...files being copied to /var/tmp/emacs directory... | ...package list creation... | ...package list finished... | ...copying files into ${LOCALBASE}... | ...end copying files... | ...package installed successfully... ` The package list can be created via he automated package-list creation method[1] documented in porters-handbook with a 'mtree' command executed in 'pre-install' to prepare the '/var/tmp/${PORTNAME}' prior to installing package. And to assure safety to this procedure, ports should be built with a separate unprivileged user 'portbuilder' whose job is to build ports and install them in '/var/tmp/${PORTNAME}', and create a temporary package list. And to perform the actual installation, the port process should switch to 'root' user. There was proposal of another implementation that would behave as you describe without chroot, but it would require too much work, as most ports will need hacks so they install software into ${DESTDIR}/${PREFIX}, but the software would think that it's installed into ${PREFIX}. That is not even always possible, so the idea was dropped. Thus, the only reliable way to generate plist with standart tools is using fat chroot. My idea however is monitor all filesystem writes by port's make and all descendant processes. That may be done with monitoring or replacing syscalls and may be done with LD_PRELOAD or some *trace kernel facilities. The former is what I'm currently experimenting with. This is also a cool way if something like this can be hacked ? How about using truss or other syscall tracing facilities, hmm..? Thanks for the links and replies. References: [1] - http://www.freebsd.org/doc/en/books/porters-handbook/plist-autoplist.html -- Ashish Shukla pgphIObrzBn48.pgp Description: PGP signature
Re: PYTHON_SITELIBDIR gets parsed incorrectly
Scot Hetzel wrote: On 12/10/08, Silver Salonen [EMAIL PROTECTED] wrote: Hello. I'm creating a port that uses python. I've set in Makefile: USE_PYTHON= yes PYTHON_SITELIBDIR=${PYTHON_SITELIBDIR:S|^${PREFIX}/||g} PLIST_SUB+= PYTHON_SITELIBDIR=${PYTHON_SITELIBDIR} And pkg-plist has entries a'la: %%BINDINGSPYTHON_SITELIBDIR%%/ This %%BINDINGS%% gets replaced with , so that should not be an issue. Anyway, when I install port, +CONTENTS contains lines a'la: /usr/local/lib/python2.5/site-packages/museek/__init__.py And when I try deinstalling it, I get errors a'la: pkg_delete: file '/usr/local//usr/local/lib/python2.5/site-packages/museek/__init__.py' doesn't exist Why do these files get prefixed with $LOCALBASE (or $PREFIX)? The problem is that you are redefining PYTHON_SITELIBDIR in PLIST_SUB. If you remove: PYTHON_SITELIBDIR=${PYTHON_SITELIBDIR:S|^${PREFIX}/||g} PLIST_SUB+= PYTHON_SITELIBDIR=${PYTHON_SITELIBDIR} from your make file, and use 'make -V PLIST_SUB' and 'make -V PYTHON_SITELIBDIR', you should get this: $ make -V PLIST_SUB PYVER=2.5 PYVER_WITHPAT=2.5.2 PYTHON_INCLUDEDIR=include/python2.5 PYTHON_LIBDIR=lib/python2.5 PYTHON_PLATFORM=freebsd8 PYTHON_SITELIBDIR=lib/python2.5/site-packages PYTHON_VERSION=python2.5 IF_DEFAULT= X86_ONLY=@comment 32BIT_ONLY=@comment NO_NIS= OSREL=8.0 PREFIX=%D LOCALBASE=/usr/local X11BASE=/usr/local PORTDOCS= PORTEXAMPLES= PORTDATA= LIB32DIR=lib XAWVER=8 PERL_VERSION=5.8.8 PERL_VER=5.8.8 PERL_ARCH=mach SITE_PERL=lib/perl5/site_perl/5.8.8 DOCSDIR=share/doc/python25 EXAMPLESDIR=share/examples/python25 DATADIR=share/python25 WWWDIR=www/python25 ETCDIR=etc/python25 $ make -V PYTHON_SITELIBDIR /usr/local/lib/python2.5/site-packages Scot Aha, thanks. I didn't realize that %%PYTHON_SITELIBDIR%% gets replaced automatically (via USE_PYTHON=yes, right?). It's OK now :) -- View this message in context: http://www.nabble.com/PYTHON_SITELIBDIR-gets-parsed-incorrectly-tp20930607p20936842.html Sent from the freebsd-ports mailing list archive at Nabble.com. ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: [PROPOSAL] Ports using SCM repositories as source instead of distfiles
* Ashish Shukla आशीष शुक्ल ([EMAIL PROTECTED]) wrote: Current DESTDIR implementation uses chroot and obviously requires complete system installed in DESTDIR. Also installing a port will install all dependencies in the chroot as well. The Debian package building system, also expects the package files in a directory named ${packageroot}/debian/${packagename}/ which you can install by doing 'make install DESTDIR=debian/${packagename}' in ${packageroot} directory (the directory where you've extracted the package tarball, similar to the FreeBSD's ${WRKSRC} directory. So, my idea is to specify make -C ${WRKSRC} install DESTDIR=/var/tmp/${PORTNAME} in the install target of port's Makefile, not to be confused with upstream package's Makefile. And I think you confused it with passing 'DESTDIR' variable to 'make' commandline to start port building procedure: How do you expect all ports to respect DESTDIR in their Makefiles, while many ports don't even use make? As I've said, that will require tremendous amount of hacking and is not even possible sometimes. My idea however is monitor all filesystem writes by port's make and all descendant processes. That may be done with monitoring or replacing syscalls and may be done with LD_PRELOAD or some *trace kernel facilities. The former is what I'm currently experimenting with. This is also a cool way if something like this can be hacked ? How about using truss or other syscall tracing facilities, hmm..? Truss uses ptrace(2). There are other facilities, but they are less useable - ktrace (produces too much output, needs to be enabled in kernel) and dtrace (only available in current for now, also should be enabled in kernel). -- Dmitry Marakasov . 55B5 0596 FF1E 8D84 5F56 9510 D35A 80DD F9D2 F77D [EMAIL PROTECTED] ..: jabber: [EMAIL PROTECTED]http://www.amdmi3.ru ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: [PROPOSAL] Ports using SCM repositories as source instead of distfiles
Dmitry Marakasov writes: * Ashish Shukla आशीष शुक्ल ([EMAIL PROTECTED]) wrote: Current DESTDIR implementation uses chroot and obviously requires complete system installed in DESTDIR. Also installing a port will install all dependencies in the chroot as well. The Debian package building system, also expects the package files in a directory named ${packageroot}/debian/${packagename}/ which you can install by doing 'make install DESTDIR=debian/${packagename}' in ${packageroot} directory (the directory where you've extracted the package tarball, similar to the FreeBSD's ${WRKSRC} directory. So, my idea is to specify make -C ${WRKSRC} install DESTDIR=/var/tmp/${PORTNAME} in the install target of port's Makefile, not to be confused with upstream package's Makefile. And I think you confused it with passing 'DESTDIR' variable to 'make' commandline to start port building procedure: How do you expect all ports to respect DESTDIR in their Makefiles, while many ports don't even use make? As I've said, that will require tremendous amount of hacking and is not even possible sometimes. How about adding a variable like REQUIRES_DYNAMIC_INSTALLATION=yes, which will then generate a plist on the basis of /var/tmp/${PORTNAME}, so now it is the port's responsibility to install all contents to /var/tmp/${PORTNAME} either by make install DESTDIR=... or by some other way. Having that REQUIRES_DYNAMIC_INSTALLATION also includes a 'post-install' target which will copy all files from /var/tmp/${PORTNAME} to ${PREFIX}. -- Ashish Shukla pgplWmDn8BjDr.pgp Description: PGP signature
Re: [PROPOSAL] Ports using SCM repositories as source instead of distfiles
* Ashish Shukla आशीष शुक्ल ([EMAIL PROTECTED]) wrote: How do you expect all ports to respect DESTDIR in their Makefiles, while many ports don't even use make? As I've said, that will require tremendous amount of hacking and is not even possible sometimes. How about adding a variable like REQUIRES_DYNAMIC_INSTALLATION=yes, which will then generate a plist on the basis of /var/tmp/${PORTNAME}, so now it is the port's responsibility to install all contents to /var/tmp/${PORTNAME} either by make install DESTDIR=... or by some other way. Having that REQUIRES_DYNAMIC_INSTALLATION also includes a 'post-install' target which will copy all files from /var/tmp/${PORTNAME} to ${PREFIX}. You do not understand the basic thing. The PROBLEM is to make all ports install into one dir, but be runnable from another. As simple as that. Imagine a software like that: --- foo.c #include stdlib.h int main() { return system(cat DATAFILE); } --- datafile.dat Hello, world! --- Makefile PREFIX?=/usr/local DATADIR?= ${PREFIX}/share/foo all: foo foo: foo.c cc -DDATAFILE=\${DATADIR}/datafile.dat\ foo.c -o foo install: foo datafile.dat install -s foo ${PREFIX}/bin install -d ${DATADIR} install datafile.dat ${DATADIR} --- As you can see, if this is installed with PREFIX=/var/tmp/foobar, then moved to /usr and ran, it won't work, as it has DATAFILE compiled in as /var/tmp/foobar/share/foo/datafile.dat instead of /usr/local/share/foo/datafile.dat. To make it behave as we indend, you'll have to either hack Makefile to distinguish DESTDIR and PREFIX, or do all installation in port's Makefile by yourself. We have around 20k ports, and it will be extremely hard task to convert them all to such scheme (though afaik configure-based ones should support this without modifications). The example above is quite simple, the real life can be much more ugly, I assure. The worst thing is that we won't be able to test ports automatically, as the fact the port builds and installs successfully won't mean that it will run without problems. I wonder how debian and gentoo get around this problem... -- Dmitry Marakasov . 55B5 0596 FF1E 8D84 5F56 9510 D35A 80DD F9D2 F77D [EMAIL PROTECTED] ..: jabber: [EMAIL PROTECTED]http://www.amdmi3.ru ___ freebsd-ports@freebsd.org mailing list http://lists.freebsd.org/mailman/listinfo/freebsd-ports To unsubscribe, send any mail to [EMAIL PROTECTED]
Re: [PROPOSAL] Ports using SCM repositories as source instead of distfiles
Dmitry Marakasov writes: [snip] --- Makefile PREFIX?= /usr/local DATADIR?= ${PREFIX}/share/foo all: foo foo: foo.c cc -DDATAFILE=\${DATADIR}/datafile.dat\ foo.c -o foo install: foo datafile.dat install -s foo ${PREFIX}/bin install -d ${DATADIR} install datafile.dat ${DATADIR} # Above statements should be changed to: install -s foo ${DESTDIR}${PREFIX}/bin install -d ${DESTDIR}${DATADIR} install datafile.dat ${DESTDIR}${DATADIR} --- In above case the package list can be created with: $ find ${DESTDIR} -type f |sed -e s[${DESTDIR}${PREFIX}/[[g As you can see, if this is installed with PREFIX=/var/tmp/foobar, then moved to /usr and ran, it won't work, as it has DATAFILE compiled in as /var/tmp/foobar/share/foo/datafile.dat instead of /usr/local/share/foo/datafile.dat. To make it behave as we indend, you'll have to either hack Makefile to distinguish DESTDIR and PREFIX, or do all installation in port's Makefile by yourself. We have around 20k ports, and it will be extremely hard task to convert them all to such scheme (though afaik configure-based ones should support this without modifications). The example above is quite simple, the real life can be much more ugly, I assure. The worst thing is that we won't be able to test ports automatically, as the fact the port builds and installs successfully won't mean that it will run without problems. I wonder how debian and gentoo get around this problem... I understood what you're trying to say, but you're missing my point, so I'm explaining it in the following example: , Quoting from my earlier example | % sudo make -C /usr/ports/editors/emacs-cvs install | ...checkout from CVS... | ...configuring... | ./configure --prefix=${LOCALBASE} ...and other configure options ... That will compile Emacs with PREFIX=${LOCALBASE} (which is /usr/local by default) | ...configuration messages... | ...compilation begins... | make | ...compiling the files... | ...compilation over... | make install DESTDIR=/var/tmp/emacs This will install all files into DESTDIR=/var/tmp/emacs, with directory structure similar to following: /var/tmp/emacs /usr/local/bin/emacs /usr/local/share/emacs/23.0.60/... etc. | ...files being copied to /var/tmp/emacs directory... | ...package list creation... | ...package list finished... | ...copying files into ${LOCALBASE}... And finally this will copy all files present in /var/tmp/emacs to ${LOCALBASE} for final installation with package we recorded earlier. | ...end copying files... | ...package installed successfully... ` This is what Debian and Gentoo does. Remember we don't have to pass DESTDIR variable to 'make -C /usr/ports/editors/emacs-cvs' instead it will be passed to the 'gmake' process invoked by port's Makefile. If we pass DESTDIR to port's commandline, then it will install all dependencies in that chroot which is not desired, we simply care about the files installed by that port. Since there're already 20,000 ports we can't do it by default, so we've to hack some knob (like REQUIRES_DYNAMIC_INSTALLATION) which if defined will enable this behaviour. Following are some links: Debian's New Maintainer's Guide http://www.debian.org/doc/maint-guide/ch-modify.en.html#s-destdir Gentoo's Ebuild Quickstart Guide http://devmanual.gentoo.org/quickstart/index.html I hope I'm clear now. Thanks -- Ashish Shukla pgpANuTUI7juX.pgp Description: PGP signature