Commit 2f14d8e6 authored by Simon McVittie's avatar Simon McVittie

Rename $docdir to $pkgdocdir and $licensedir to $pkglicensedir

We were not entirely consistent about whether substituted variables
meant a generic directory like /usr/share/doc, or a package-specific
directory like /usr/share/doc/quake3-data. In Autoconf and the GNU
coding standards, package-specific directories are consistently
named pkgfoodir: borrow that convention.

This means we can consistently use lower-case variable names
(again consistent with Autoconf); do so, by renaming $LICENSEDIR
to $licensedir.
parent 2a644674
......@@ -180,13 +180,13 @@ files:
- license.txt
symbol_p22.gif:
install_to: $docdir/diary
install_to: $pkgdocdir/diary
symbol_p23.gif:
install_to: $docdir/diary
install_to: $pkgdocdir/diary
symbol_p25.gif:
install_to: $docdir/diary
install_to: $pkgdocdir/diary
symbol_p27.gif:
install_to: $docdir/diary
install_to: $pkgdocdir/diary
dreamweb-cd-uk-1.1.zip:
download: http://prdownloads.sourceforge.net/scummvm/dreamweb-cd-uk-1.1.zip?download
......@@ -213,11 +213,11 @@ files:
- license.txt
coverde.png?diary:
install_to: $docdir/diary
install_to: $pkgdocdir/diary
tagebuch.html:
install_to: $docdir/diary
install_to: $pkgdocdir/diary
tagebuch.txt:
install_to: $docdir/diary
install_to: $pkgdocdir/diary
dreamweb-cd-de-1.1.zip:
download: http://prdownloads.sourceforge.net/scummvm/dreamweb-cd-de-1.1.zip?download
......
......@@ -84,7 +84,7 @@ files:
- Leisure Suit Larry 1 - Manual.pdf
- Leisure Suit Larrys Greatest Hits and Misses - Manual.pdf
Leisure Suit Larrys Greatest Hits and Misses - Manual.pdf:
install_to: $docdir
install_to: $pkgdocdir
setup_leisure_suit_larry_vga_2.2.0.20.exe:
unpack:
......
......@@ -33,7 +33,7 @@ packages:
files:
Leisure Suit Larrys Greatest Hits and Misses - Manual.pdf:
install_to: $docdir
install_to: $pkgdocdir
setup_leisure_suit_larry2_2.2.0.18.exe:
unpack:
format: innoextract
......
......@@ -36,7 +36,7 @@ packages:
files:
Leisure Suit Larrys Greatest Hits and Misses - Manual.pdf:
install_to: $docdir
install_to: $pkgdocdir
setup_leisure_suit_larry3_2.2.0.19.exe:
unpack:
format: innoextract
......
......@@ -51,7 +51,7 @@ packages:
files:
Leisure Suit Larrys Greatest Hits and Misses - Manual.pdf:
install_to: $docdir
install_to: $pkgdocdir
setup_leisure_suit_larry5_2.2.0.20.exe:
unpack:
format: innoextract
......
......@@ -47,7 +47,7 @@ files:
unsuitable: "ScummVM only support the VGA version (320x200x256), not the SVGA one (640x480x256)"
Leisure Suit Larrys Greatest Hits and Misses - Manual.pdf:
install_to: $docdir
install_to: $pkgdocdir
setup_leisure_suit_larry6_vga_2.2.0.18.exe:
unpack:
......
......@@ -81,10 +81,10 @@ packages:
usr/lib/quake3/ta/missionpack/pak2.pk3: $install_to/missionpack/pak2.pk3
usr/lib/quake3/ta/missionpack/pak3.pk3: $install_to/missionpack/pak3.pk3
# let mix win & linux html documentation
$docdir/Help/BotCommands.htm: $docdir/Help/BotCommands.html
$docdir/Help/Dedicated Server.htm: $docdir/Help/DedicatedServer.html
$docdir/Help/Index.htm: $docdir/Help/Index.html
$docdir/Help/Readme.htm: $docdir/Help/Readme.html
$pkgdocdir/Help/BotCommands.htm: $pkgdocdir/Help/BotCommands.html
$pkgdocdir/Help/Dedicated Server.htm: $pkgdocdir/Help/DedicatedServer.html
$pkgdocdir/Help/Index.htm: $pkgdocdir/Help/Index.html
$pkgdocdir/Help/Readme.htm: $pkgdocdir/Help/Readme.html
install_to: usr/share/games/quake3-data
install:
- baseq3/pak0.pk3
......
......@@ -74,8 +74,8 @@ packages:
install:
- EXTREME.RTL
symlinks:
$licensedir/LICENSE.TXT:
$LICENSEDIR/rott-registered-data/LICENSE.TXT
$pkglicensedir/LICENSE.TXT:
$licensedir/rott-registered-data/LICENSE.TXT
files:
any_registered_rtc:
......
......@@ -59,7 +59,7 @@ a mapping from unique name to a mapping:
generic names like `README.TXT`.
* `license`: boolean, default false: if true, it is listed as a license
file in generated copyright file.
Per policy, license files should go in $docdir. (see `install_to`).
Per policy, license files should go in $pkglicensedir. (see `install_to`).
* `download`: string or mapping: where to download this file. FIXME: explain
* `provides`: list of strings: unique names of some known files that can be
unpacked or extracted from this one
......@@ -78,8 +78,11 @@ a mapping from unique name to a mapping:
being installed under the name of the alternative set.
* `install_as`: string: when installing this file in a package, use this name
instead of its own.
* `install_to`: string: overide location where to install this file,
the special value $docdir will be expanded to /usr/share/doc/<package_name/.
* `install_to`: string: overide location where to install this file.
The special value $pkgdocdir will be expanded to
usr/share/doc/<package_name>, and $pkglicensedir will be expanded to
usr/share/doc/<package_name> or usr/share/licenses/<package_name>
depending on distribution.
* `look_for`: list of strings: when searching for this file, look for
these names (case-insensitively). The default is a list containing only
the unique name.
......
......@@ -91,9 +91,9 @@ class WantedFile(HashedFile):
if self._install_to is not None:
return self._install_to
if self.doc:
return '$docdir'
return '$pkgdocdir'
if self.license:
return '$licensedir'
return '$pkglicensedir'
return None
@install_to.setter
def install_to(self, value):
......
......@@ -1306,8 +1306,8 @@ class PackagingTask(object):
return complete
def fill_docs(self, package, destdir, docdir):
copy_to = os.path.join(destdir, docdir, 'copyright')
def fill_docs(self, package, destdir, pkgdocdir):
copy_to = os.path.join(destdir, pkgdocdir, 'copyright')
for n in (package.name, self.game.shortname):
copy_from = os.path.join(DATADIR, n + '.copyright')
if os.path.exists(copy_from):
......@@ -1366,9 +1366,9 @@ class PackagingTask(object):
if self.file_status[f.name] is FillResult.IMPOSSIBLE:
continue
install_to = f.install_to
if install_to and install_to.startswith('$docdir'):
if install_to and install_to.startswith('$pkgdocdir'):
count_doc +=1
elif install_to and install_to.startswith('$licensedir'):
elif install_to and install_to.startswith('$pkglicensedir'):
pass
else:
count_usr +=1
......@@ -1553,16 +1553,16 @@ class PackagingTask(object):
if not self.check_complete(package, log=True):
return False
docdir = os.path.join('usr/share/doc', package.name)
dest_docdir = os.path.join(destdir, docdir)
mkdir_p(dest_docdir)
# only create licensedir if needed
licensedir = os.path.join(self.packaging.LICENSEDIR, package.name)
dest_licensedir = os.path.join(destdir, licensedir)
pkgdocdir = os.path.join('usr/share/doc', package.name)
dest_pkgdocdir = os.path.join(destdir, pkgdocdir)
mkdir_p(dest_pkgdocdir)
# only create license directory if needed
pkglicensedir = os.path.join(self.packaging.LICENSEDIR, package.name)
dest_pkglicensedir = os.path.join(destdir, pkglicensedir)
shutil.copyfile(os.path.join(DATADIR, 'changelog.gz'),
os.path.join(destdir, docdir, 'changelog.gz'))
os.path.join(destdir, pkgdocdir, 'changelog.gz'))
self.fill_docs(package, destdir, docdir)
self.fill_docs(package, destdir, pkgdocdir)
for wanted in (package.install_files | package.optional_files):
install_as = wanted.install_as
......@@ -1596,13 +1596,11 @@ class PackagingTask(object):
if install_to.startswith('$assets'):
install_to = self.packaging.ASSETS + install_to[7:]
elif install_to.startswith('$docdir'):
install_to = 'usr/share/doc/%s%s' % (package.name,
install_to[7:])
elif install_to.startswith('$licensedir'):
mkdir_p(dest_licensedir)
install_to = '%s/%s%s' % (self.packaging.LICENSEDIR,
package.name, install_to[11:])
elif install_to.startswith('$pkgdocdir'):
install_to = pkgdocdir + install_to[10:]
elif install_to.startswith('$pkglicensedir'):
mkdir_p(dest_pkglicensedir)
install_to = pkglicensedir + install_to[14:]
copy_to = os.path.join(destdir, install_to, install_as)
copy_to_dir = os.path.dirname(copy_to)
......@@ -1626,16 +1624,16 @@ class PackagingTask(object):
symlink = string.Template(symlink).safe_substitute(
assets=self.packaging.ASSETS,
bindir=self.packaging.BINDIR,
docdir=docdir,
LICENSEDIR=self.packaging.LICENSEDIR,
licensedir=licensedir,
licensedir=self.packaging.LICENSEDIR,
pkgdocdir=pkgdocdir,
pkglicensedir=pkglicensedir,
install_to=package.install_to)
real_file = string.Template(real_file).safe_substitute(
assets=self.packaging.ASSETS,
bindir=self.packaging.BINDIR,
docdir=docdir,
LICENSEDIR=self.packaging.LICENSEDIR,
licensedir=licensedir,
pkgdocdir=pkgdocdir,
licensedir=self.packaging.LICENSEDIR,
pkglicensedir=pkglicensedir,
install_to=package.install_to)
toplevel, rest = symlink.split('/', 1)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment