buildout.cfg 1.97 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
version = 3.5.6
16 17
#url = http://download.documentfoundation.org/libreoffice/stable/${:version}/rpm/%s/LibO_${:version}_Linux_%s_install-rpm_en-US.tar.gz
url = http://ftp.psu.ac.th/pub/libreoffice/${:version}/rpm/%s/LibO_${:version}_Linux_%s_install-rpm_en-US.tar.gz
18
# supported architectures md5sums
19 20
md5sum_x86 = 079609188b86ede3b3eebe2b75862b31
md5sum_x86-64 = 6a559fa9c62c810464254d129bd2dc17
21 22

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

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

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