buildout.cfg 1.79 KB
Newer Older
1
[buildout]
2 3 4 5
extends =
  ../cpio/buildout.cfg
  ../rpm2cpio/buildout.cfg

6 7 8 9
parts =
  libreoffice-bin

[libreoffice-bin]
10
recipe = slapos.recipe.build
11
# here, two %s are used, first one is for directory name (eg. x86_64), and second one is for filename (eg. x86-64).
12
version = 4.3.3.2
13
url = http://downloadarchive.documentfoundation.org/libreoffice/old/${:version}/rpm/%s/LibreOffice_${:version}_Linux_%s_rpm.tar.gz
14
# supported architectures md5sums
15 16
md5sum_x86 = c24d4d7db03a5c983633efde754efae4
md5sum_x86-64 = 94e0c1027d864f26a65e742874514b92
17 18

# where office code can be found?
19
officedir = libreoffice4.3
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36

# script to install
script =
  location = %(location)r
  self.failIfPathExists(location)
  import sys
  ARCH_DIR_MAP = { 'x86': 'x86', 'x86-64': 'x86_64' }
  platform = guessPlatform()
  url = self.options['url'] %% (ARCH_DIR_MAP[platform], platform)
  md5sum = self.options['md5sum_' + platform]
  extract_dir = self.extract(self.download(url, md5sum))
  workdir = guessworkdir(extract_dir)
  storagedir = os.path.join(workdir, 'storage')
  os.mkdir(storagedir)
  rpmsdir = os.path.join(workdir, [q for q in os.listdir(workdir) if q == 'RPMS'][0])
  rpmlist = [os.path.join(rpmsdir, q) for q in os.listdir(rpmsdir) if q.endswith('.rpm') and 'javafilter' not in q and 'xsltfilter' not in q]
  [self.pipeCommand([[sys.executable, '${:rpm2cpio}', rpm], ['${:cpio}', '-idum']], cwd=storagedir) for rpm in rpmlist]
37 38 39 40 41
  self.copyTree(os.path.join(storagedir, 'opt', '${:officedir}'), location, ['ure-link'])
  os.symlink('ure', os.path.join(location, 'ure-link'))
  # backward compatibility for cloudooo configuration
  os.mkdir(os.path.join(location, 'basis-link'))
  os.symlink(os.path.join('..', 'program'), os.path.join(location, 'basis-link', 'program'))
42

43
# helper binaries
44
cpio = ${cpio:location}/bin/cpio
45
rpm2cpio = ${rpm2cpio:target}