Git Repositories

SLKBUILD for LibreOffice under Salix.
authorCyrille Pontvieux <jrd@enialis.net>
Thu, 19 Feb 2015 15:16:34 +0000 (16:16 +0100)
committerCyrille Pontvieux <jrd@enialis.net>
Fri, 20 Feb 2015 14:33:24 +0000 (15:33 +0100)
slkbuild 0.9.1m required.

.gitignore [new file with mode: 0644]
Makefile [new file with mode: 0644]
SLKBUILD.tpl [new file with mode: 0644]
generate-SLKBUILD.py [new file with mode: 0755]
helps [new file with mode: 0644]
langs [new file with mode: 0644]
languages [new file with mode: 0644]

diff --git a/.gitignore b/.gitignore
new file mode 100644 (file)
index 0000000..9d4cf96
--- /dev/null
@@ -0,0 +1,8 @@
+*.xz
+SLKBUILD
+src
+pkg
+pkg_*
+*.log
+*.txz
+*.md5
diff --git a/Makefile b/Makefile
new file mode 100644 (file)
index 0000000..5267305
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,10 @@
+.PHONY: build clean
+
+build: SLKBUILD
+
+SLKBUILD: langs helps languages SLKBUILD.tpl
+       @echo "Generating SLKBUILD from langs and helps"
+       @python generate-SLKBUILD.py
+
+clean:
+       @rm -f SLKBUILD
diff --git a/SLKBUILD.tpl b/SLKBUILD.tpl
new file mode 100644 (file)
index 0000000..f93ed5f
--- /dev/null
@@ -0,0 +1,212 @@
+# vim: syn=sh ft=sh et sw=2 sts=2 ts=2 tw=0:
+#Packager: Cyrille Pontvieux <jrd~at~salixos~dot~org>
+#Former Maintainer: Dimitris Tzemos <djemos~at~slackel~dot~gr>
+#execute this script with arch=i686 fakeroot slkbuild -X
+#to produce the i686 binary
+#fakeroot slkbuild -X produce the x86_64 package
+
+pkgname=libreoffice
+pkgver=4.4.0.3
+pkgrel=1cp
+arch=${arch:-x86_64}
+source=(
+  SLKBUILD.tpl
+  helps
+  langs
+  languages
+  Makefile
+  generate-SLKBUILD.py
+  "http://download.documentfoundation.org/libreoffice/src/$(echo $pkgver|cut -d. -f1-3)/${pkgname}-${pkgver}.tar.xz"
+  "http://download.documentfoundation.org/libreoffice/src/$(echo $pkgver|cut -d. -f1-3)/${pkgname}-translations-${pkgver}.tar.xz"
+  "http://download.documentfoundation.org/libreoffice/src/$(echo $pkgver|cut -d. -f1-3)/${pkgname}-dictionaries-${pkgver}.tar.xz"
+  "http://download.documentfoundation.org/libreoffice/src/$(echo $pkgver|cut -d. -f1-3)/${pkgname}-help-${pkgver}.tar.xz"
+)
+options=("noextract")
+url=http://www.libreoffice.org/
+multi=(
+__libreoffice_l10n_LANG__
+__libreoffice_help_LANG__
+)
+
+slackdesc=\
+(
+#|-----handy-ruler------------------------------------------------------|
+"$pkgname (free office suite)"
+"LibreOffice is an Open Source, community-developed, office"
+"productivity suite. It includes key desktop applications, such as a"
+"word processor, spreadsheet, presentation manager, formula editor and"
+"drawing program, with a user interface and feature set similar to"
+"other office suites. LibreOffice also works transparently with a"
+"variety of file formats, including Microsoft Office File Formats."
+)
+
+__libreoffice_l10n_LANG_slackdesc__
+
+__libreoffice_help_LANG_slackdesc__
+
+build() {
+  lang_list="__lang_list__"
+  dict_list=$(cat <<EOF
+__dict_list__
+EOF
+)
+  help_list="__help_list__"
+  cd $SRC
+  tar xf ${pkgname}-${pkgver}.tar.xz || return 1
+  mkdir -p ${pkgname}-${pkgver}/external/tarballs
+  (
+    cd ${pkgname}-${pkgver}/external/tarballs
+    ln -s -v ../../../${pkgname}-translations-${pkgver}.tar.xz .
+    ln -s -v ../../../${pkgname}-dictionaries-${pkgver}.tar.xz .
+    ln -s -v ../../../${pkgname}-help-${pkgver}.tar.xz .
+  )
+  cd ${pkgname}-${pkgver}
+  # for external archives (langs, dicts, helps)
+  chmod +x bin/unpack-sources
+  # gnome-vfs is disabled because LO wants GVFS >= 2.6 and only 2.0 is used in Salix 14.1
+  ./configure \
+    --prefix=/usr \
+    --libdir=/usr/lib${LIBDIRSUFFIX} \
+    --localstatedir=/var \
+    --sysconfdir=/etc \
+    --disable-ccache \
+    --enable-release-build=yes \
+    --enable-ext-wiki-publisher \
+    --enable-graphite \
+    --enable-orcus \
+    --disable-gconf \
+    --disable-gnome-vfs \
+    --enable-vlc \
+    --enable-eot \
+    --enable-extra-gallery \
+    --enable-extra-template \
+    --enable-extra-sample \
+    --enable-extra-font \
+    --enable-ext-watch-window \
+    --enable-ext-diagram \
+    --enable-ext-validator \
+    --enable-ext-barcode \
+    --enable-ext-ct2n \
+    --enable-ext-numbertext \
+    --enable-ext-hunart \
+    --enable-ext-typo \
+    --enable-ext-google-docs \
+    --enable-ext-nlpsolver \
+    --enable-ext-languagetool \
+    --without-krb5 \
+    --without-gssapi \
+    --without-junit \
+    --with-alloc=system \
+    --with-lang=ALL \
+    --with-help \
+    --with-myspell-dicts \
+    --without-system-dicts \
+    --with-system-boost \
+    --with-system-clucene \
+    --with-system-cairo \
+    --with-system-curl \
+    --with-system-expat \
+    --with-system-harfbuzz \
+    --with-system-icu \
+    --with-system-jpeg \
+    --with-system-lcms2 \
+    --with-system-libpng \
+    --with-system-libxml \
+    --with-system-mesa-headers \
+    --with-system-neon \
+    --with-system-nss \
+    --with-system-openldap \
+    --with-system-openssl \
+    --with-system-poppler \
+    --with-system-redland \
+    --with-system-zlib \
+    --with-vendor="Salix OS" \
+    --with-build-version=$pkgrel \
+    --build=$arch-slackware-linux \
+    || return 1
+  # we don't need to have these file lists
+  sed -i "/distro-install-file-lists/d" Makefile || return 1
+  # make needs a internet connection to download additionnal packages
+  make -j $numjobs build || return 1
+  make distro-pack-install DESTDIR=$PKG || return 1
+       # we don't need the included fonts, we already have packages for
+       # them anyway. We want to keep the opens___.ttf and fc_local.conf files.
+       find $PKG/usr/lib${LIBDIRSUFFIX}/$pkgname/share/fonts/truetype/ ! -name "opens___.ttf" ! -name "fc_local.conf" \
+    -type f \
+    -exec rm {} \;
+  ##############
+  # LANG PACKS #
+  ##############
+  echo "Preparing language packages: langs"
+  for l in $lang_list; do
+    echo ". $l"
+    for m in $PKG/gid_Module_Langpack_*_$l $PKG/gid_Module_Optional_Accessories_*_$l; do
+      [ -f "$m" ] || continue
+      for d in $(sed -rn '/^%dir/ {s/%dir //;p}' $m|sort -u); do
+        mkdir -p ${PKG}_libreoffice_l10n_${l}${d}
+      done
+      for f in $(grep '^/' $m|sort -u); do
+        mv ${PKG}${f} ${PKG}_libreoffice_l10n_${l}${f}
+      done
+      for d in $(sed -rn '/^%dir/ {s/%dir //;p}' $m|sort -r -u); do
+        rmdir ${PKG}${d} 2> /dev/null || true
+      done
+    done
+  done
+  echo "Preparing language packages: dicts"
+  for ld in $dict_list; do
+    l=$(echo $ld|cut -d: -f1)
+    # gnu sed necessary
+    dict=$(echo $ld|cut -d: -f2)
+    if [ -n "$dict" ]; then
+      echo ". $dict"
+      # funny names used in the package module filename,
+      # so try to determine it with some heuristics.
+      dict_dir1=$(echo $l|tr A-Z a-z|sed -r 's/^(.)/\U\1/; s/_(.)/_\U\1/;')
+      dict_dir2=$(echo $dict|tr A-Z a-z|sed -r 's/^(.)/\U\1/; s/_(.)/_\U\1/;')
+      dict_dir3=$(echo $dict_dir2|sed 's/_.*//')
+      for dict_dir in $dict_dir1 $dict_dir2 $dict_dir3; do
+        m=$PKG/gid_Module_Root_Extension_Dictionary_$dict_dir
+        [ -f "$m" ] || continue
+        for d in $(sed -rn '/^%dir/ {s/%dir //;p}' $m|sort -u); do
+          mkdir -p ${PKG}_libreoffice_l10n_${l}${d}
+        done
+        for f in $(grep '^/' $m|sort -u); do
+          cp ${PKG}${f} ${PKG}_libreoffice_l10n_${l}${f}
+        done
+        # do not try another
+        break
+      done
+    fi
+  done
+  echo "Cleaning dictionaries in main package"
+  for m in $PKG/gid_Module_Root_Extension_Dictionary_*; do
+    [ -f "$m" ] || continue
+    for f in $(grep '^/' $m|sort -u); do
+      rm ${PKG}${f} 2>/dev/null || true
+    done
+    for d in $(sed -rn '/^%dir/ {s/%dir //;p}' $m|sort -r -u); do
+      rmdir ${PKG}${d} 2>/dev/null || true
+    done
+  done
+  ##############
+  # HELP PACKS #
+  ##############
+  echo "Preparing help packages"
+  for h in $help_list; do
+    echo ". $h"
+    for m in $PKG/gid_Module_Helppack_*_$h; do
+      [ -f "$m" ] || continue
+      for d in $(sed -rn '/^%dir/ {s/%dir //;p}' $m|sort -u); do
+        mkdir -p ${PKG}_libreoffice_help_${h}${d}
+      done
+      for f in $(grep '^/' $m|sort -u); do
+        mv ${PKG}${f} ${PKG}_libreoffice_help_${h}${f}
+      done
+      for d in $(sed -rn '/^%dir/ {s/%dir //;p}' $m|sort -r -u); do
+        rmdir ${PKG}${d} 2>/dev/null || true
+      done
+    done
+  done
+  rm ${PKG}/gid_Module_*
+}
diff --git a/generate-SLKBUILD.py b/generate-SLKBUILD.py
new file mode 100755 (executable)
index 0000000..f5a6755
--- /dev/null
@@ -0,0 +1,100 @@
+#!/usr/bin/env python
+# coding: utf-8
+# vim: set ai et sw=2 sts=2 ts=2 tw=0:
+
+from __future__ import division, print_function, unicode_literals
+import sys
+
+def gen_lang_list(langs):
+  return ' '.join(sorted(langs.keys()))
+
+def gen_dict_list(langs):
+  s = ''
+  for codel in sorted(langs.keys()):
+    if langs[codel][1]:
+      if s:
+        s += "\n"
+      s += codel + ":" + langs[codel][1]
+  return s
+
+def gen_help_list(helps):
+  return ' '.join(sorted(helps.keys()))
+
+def gen_lang_pkg_list(langs):
+  s = ''
+  for code in sorted(langs.keys()):
+    if s:
+      s += "\n"
+    s += '"libreoffice-l10n-' + code + '"'
+  return s
+
+def gen_help_pkg_list(helps):
+  s = ''
+  for code in sorted(helps.keys()):
+    if s:
+      s += "\n"
+    s += '"libreoffice-help-' + code + '"'
+  return s
+
+def gen_lang_slackdesc_list(langs):
+  s = ''
+  for code in sorted(langs.keys()):
+    if s:
+      s += "\n"
+    s += """libreoffice_l10n_{codeu}_slackdesc=\\
+(
+#|-----handy-ruler------------------------------------------------------|
+"libreoffice-l10n-{code} ({descr})"
+"{descr} language pack for LibreOffice"
+"Use this package if you want to run LibreOffice in"
+"{descr}."
+)
+""".format(code=code, codeu=code.replace('-', '_'), descr=langs[code][0])
+  return s
+
+def gen_help_slackdesc_list(helps):
+  s = ''
+  for code in sorted(helps.keys()):
+    if s:
+      s += "\n"
+    s += """libreoffice_help_{codeu}_slackdesc=\\
+(
+#|-----handy-ruler------------------------------------------------------|
+"libreoffice-help-{code} ({descr})"
+"{descr} help pack for LibreOffice"
+"Use this package if you want to have the help pages locally in"
+"{descr}."
+)
+""".format(code=code, codeu=code.replace('-', '_'), descr=helps[code])
+  return s
+
+def main():
+  languages = {}
+  with open('languages', 'r') as f:
+    for l in f:
+      (code, desc) = l.rstrip('\n').split(':')
+      languages[code] = desc
+  langs = {}
+  with open('langs', 'r') as f:
+    for l in f:
+      (codel, coded) = l.rstrip('\n').split(':')
+      langs[codel] = (languages[codel], coded)
+  helps = {}
+  with open('helps', 'r') as f:
+    for code in f:
+      code = code.rstrip('\n')
+      helps[code] = languages[code]
+  tpl_string = None
+  with open('SLKBUILD.tpl', 'r') as tpl:
+    tpl_string = tpl.read()
+  slk_string = tpl_string \
+    .replace('__lang_list__', gen_lang_list(langs)) \
+    .replace('__dict_list__', gen_dict_list(langs)) \
+    .replace('__help_list__', gen_help_list(helps)) \
+    .replace('__libreoffice_l10n_LANG__', gen_lang_pkg_list(langs)) \
+    .replace('__libreoffice_help_LANG__', gen_help_pkg_list(helps)) \
+    .replace('__libreoffice_l10n_LANG_slackdesc__', gen_lang_slackdesc_list(langs)) \
+    .replace('__libreoffice_help_LANG_slackdesc__', gen_help_slackdesc_list(helps))
+  with open('SLKBUILD', 'w') as slk:
+    slk.write(slk_string)
+main()
diff --git a/helps b/helps
new file mode 100644 (file)
index 0000000..7ca9034
--- /dev/null
+++ b/helps
@@ -0,0 +1,107 @@
+af
+am
+ar
+as
+ast
+be
+bg
+bn
+bn-IN
+bo
+br
+brx
+bs
+ca
+ca-valencia
+cs
+cy
+da
+de
+dgo
+dz
+el
+en-GB
+en-US
+en-ZA
+eo
+es
+et
+eu
+fa
+fi
+fr
+ga
+gl
+gu
+he
+hi
+hr
+hu
+id
+is
+it
+ja
+ka
+kk
+km
+kmr-Latn
+kn
+ko
+kok
+ks
+lo
+lt
+lv
+mai
+mk
+ml
+mn
+mni
+mr
+my
+nb
+ne
+nl
+nn
+nr
+nso
+oc
+om
+or
+pa-IN
+pl
+pt
+pt-BR
+ro
+ru
+rw
+sa-IN
+sat
+sd
+si
+sid
+sk
+sl
+sq
+sr
+sr-Latn
+ss
+st
+sv
+sw-TZ
+ta
+te
+tg
+th
+tn
+tr
+ts
+ug
+uk
+uz
+ve
+vi
+xh
+zh-CN
+zh-TW
+zu
diff --git a/langs b/langs
new file mode 100644 (file)
index 0000000..2cfc573
--- /dev/null
+++ b/langs
@@ -0,0 +1,119 @@
+ab:
+af:af_ZA
+am:
+an:an_ES
+ar:ar
+as:
+ast:
+az:
+be:be_BY
+bg:bg_BG
+bn:bn_BD
+bn-IN:bn_BD
+bo:
+br:br_FR
+brx:
+bs:bs_BA
+ca:ca
+ca-valencia:ca
+cs:cs_CZ
+cy:
+da:da_DK
+de:de
+dgo:
+dz:
+el:el_GR
+en-GB:en
+en-ZA:en
+eo:
+es:es
+et:et_EE
+eu:
+fa:
+fi:
+fr:fr_FR
+ga:
+gd:gd_GB
+gl:gl
+gn:
+gu:gu_IN
+he:he_IL
+hi:hi_IN
+hr:hr_HR
+hu:hu_HU
+id:
+is:is
+it:it_IT
+ja:
+jv:
+ka:
+kk:
+kl:
+km:
+kmr-Latn:kmr_Latn
+kn:
+ko:
+kok:
+ks:
+ky:
+lb:
+lo:lo_LA
+lt:lt_LT
+lv:lv_LV
+mai:
+mk:
+ml:
+mn:
+mni:
+mr:
+my:
+nb:no
+ne:ne_NP
+nl:nl_NL
+nn:no
+nr:
+nso:
+oc:oc_FR
+om:
+or:
+pa-IN:
+pl:pl_PL
+pt:pt_PT
+pt-BR:pt_BR
+ro:ro
+ru:ru_RU
+rw:
+sa-IN:
+sah:
+sat:
+sd:
+si:si_LK
+sid:
+sk:sk_SK
+sl:sl_SI
+sq:
+sr:sr
+sr-Latn:sr
+ss:
+st:
+sv:sv_SE
+sw-TZ:sw_TZ
+ta:
+te:te_IN
+tg:
+th:th_TH
+ti:
+tn:
+tr:
+ts:
+tt:
+ug:
+uk:uk_UA
+ur:
+uz:
+ve:
+vi:vi
+xh:
+zh-CN:
+zh-TW:
+zu:zu_ZA
diff --git a/languages b/languages
new file mode 100644 (file)
index 0000000..d20fcaf
--- /dev/null
+++ b/languages
@@ -0,0 +1,122 @@
+ab:Abkhazian
+af:Afrikaans
+am:Amharic
+an:Aragonese
+ar:Arabic
+as:Assamese
+ast:Asturian
+az:Azerbaijani
+be:Belarusian
+bg:Bulgarian
+bn:Bengali
+bn-IN:Bengali (India)
+bo:Tibetan
+br:Breton
+brx:Bodo (India)
+bs:Bosnian
+ca:Catalan
+ca-valencia:Valencia
+cs:Czech
+cy:Welsh
+da:Danish
+de:German
+dgo:Dogri
+dz:Dzongkha
+el:Greek
+en:English
+en-GB:English (British)
+en-US:English (American)
+en-ZA:English (South Africa)
+eo:Esperanto
+es:Spanish
+et:Estonian
+eu:Basque
+fa:Farsi
+fi:Finnish
+fr:French
+ga:Gaelic
+gd:Gaelic (Scottish)
+gl:Galician
+gn:Guarani
+gu:Gujarati
+he:Hebrew
+hi:Hindi
+hr:Croatian
+hu:Hungarian
+id:Indonesian
+is:Icelandic
+it:Italian
+ja:Japanese
+jv:Javanese
+ka:Georgian
+kk:Kazakh
+kl:Kalaallisut
+km:Khmer
+kmr-Latn:Kurmanji
+kn:Kannada
+ko:Korean
+kok:Konkani
+ks:Kashmiri
+ky:Kyrgyz
+lb:Letzeburgesch
+lo:Lao
+lt:Lithuanian
+lv:Latvian
+mai:Maithili
+mk:Macedonian
+ml:Malayalam
+mn:Mongolian
+mni:Manipuri
+mr:Marathi
+my:Burmese
+nb:Norwegian Bokmal
+ne:Nepali
+nl:Nederlands
+nn:Norwegian Nynorsk
+no:Norwegian
+nr:Ndebele
+nso:Northern Sotho
+oc:Occitan
+om:Oromo
+or:Oriya
+pa-IN:Panjabi (India)
+pl:Polish
+pt:Portuguese (Portugal)
+pt-BR:Portuguese (Brasil)
+ro:Romanian
+ru:Russian
+rw:Kinyarwanda
+sa-IN:Sanskrit (India)
+sah:Sakha
+sat:Santali
+sd:Sindhi
+si:Sinhala
+sid:Sidamo
+sk:Slovak
+sl:Slovenian
+sq:Albanian
+sr:Serbian
+sr-Latn:Serbian in Latin script
+ss:Swati
+st:Southen Sotho
+sv:Swedish
+sw-TZ:Kiswahili
+ta:Tamil
+te:Telugu
+tg:Tajik
+th:Thai
+ti:Tigrinya
+tn:Tswana
+tr:Turkish
+ts:Tsonga
+tt:Tatar
+ug:Uighur
+uk:Ukrainian
+ur:Urdu
+uz:Uzbek
+ve:Venda
+vi:Vietnamese
+xh:Xhosa
+zh-CN:Chinese Simplified
+zh-TW:Chinese Traditional
+zu:Zulu