buildout.cfg 1.6 KB
Newer Older
1
[buildout]
Priscila Manhaes's avatar
Priscila Manhaes committed
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]
Priscila Manhaes's avatar
Priscila Manhaes committed
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).
Priscila Manhaes's avatar
Priscila Manhaes committed
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
url = http://download.documentfoundation.org/libreoffice/stable/3.4.3/rpm/%s/LibO_3.4.3_Linux_%s_install-rpm_en-US.tar.gz

# supported architectures md5sums
md5sum_x86 = ae1b2b387dcef513c378cc95b255affc
md5sum_x86-64 = b2d6a902182c1af82ca088fbb665d0e3

# where office code can be found?
officedir = libreoffice3.4

# 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]
  self.copyTree(os.path.join(storagedir, 'opt', '${:officedir}'), location, ['basis3.4', 'basis3.3', 'ure'])
41

Priscila Manhaes's avatar
Priscila Manhaes committed
42
# helper binaries
43
cpio = ${cpio:location}/bin/cpio
Priscila Manhaes's avatar
Priscila Manhaes committed
44
rpm2cpio = ${rpm2cpio:target}