PKGNAME for install

Adriaan de Groot <adridg-FlD2LfDziEhmR6Xm/[email protected]>
Newsgroups gmane.comp.tools.aap.devel
Message-ID <[email protected]>
AAP enforces that PKGNAME needs to be set in order to install data. Why? Not 
every application follows the orderly /usr/local/share/<pkgname>/ idiom - 
KDE, for one, dumps everything in (16) directories right under 
/usr/local/share. I suppose that goes against hier(7) in FreeBSD, but that 
isn't really important. What _is_ important, is that every KDE application 
(just like every GNOME application, I might add) expects to install data into 
the kde share (/usr/local/share) or the gnome share (/usr/local/share/gnome) 
.. doing that right for gnome requires all gnome apps to set PKGDIR to gnome, 
which seems somewhat bogus. For KDE things, there's really no way to tell AAP 
that you definitely want to install data in directories based directly off of 
$PREFIX and not in $PREFIX/$PKGNAME. The attached patch aap-pkgname.diff adds 
a special case for PKGNAME == ".". Of course, if you use this, then it's 
essential that you use the {keepdir} attribute of data files, so that they 
end up in the right places and not straight in $PREFIX.

[As an aside, Python's os.makedirs() has a bug if you pass it weird paths like 
/usr/local/share/., since it tries to create . as well, and fails.]


-- 
pub  1024D/FEA2A3FE 2002-06-18 Adriaan de Groot <[email protected]>
     Key fingerprint = 934E 31AA 80A7 723F 54F9  50ED 76AC EE01 FEA2 A3FE
aap-pkgname.diff (text/x-diff, 471 B)
--- default.aap	Mon Aug 11 22:57:44 2003
+++ default.aap.new	Mon Aug 11 22:57:30 2003
@@ -497,7 +497,10 @@
 :action installdata default 
     @if not _no.get("PKGNAME"):
 	:error For installing data you must set $($)PKGNAME
-    dest = $DATADIR$PKGNAME
+    @if _no.get("PKGNAME") == ".":
+        dest = $DATADIR
+    @else:
+        dest = $DATADIR$PKGNAME
     @install_files(dest, source, _no.DATAMODE)
 :action uninstalldata default
     @if not _no.get("PKGNAME"):
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.