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

6 7 8 9 10 11 12
parts =
  libreoffice-bin

find-links =
  http://www.nexedi.org/static/packages/source/

[libreoffice-bin]
13
recipe = slapos.recipe.build
14
# here, two %s are used, first one is for directory name (eg. x86_64), and second one is for filename (eg. x86-64).
15 16
version = 3.6.7.2
url = http://downloadarchive.documentfoundation.org/libreoffice/old/${:version}/rpm/%s/LibO_${:version}_Linux_%s_install-rpm_en-US.tar.gz
17
# supported architectures md5sums
18 19
md5sum_x86 = 4097e53922a42996a30e573777809b33
md5sum_x86-64 = 85eccac0bcb11f8789d49a3249546749
20 21

# where office code can be found?
22
officedir = libreoffice3.6
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39

# 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]
40 41 42 43 44
  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'))
45

46
# helper binaries
47
cpio = ${cpio:location}/bin/cpio
48
rpm2cpio = ${rpm2cpio:target}