Autor Wątek: LibreOffice 4.4.0 beta  (Przeczytany 4063 razy)

0 użytkowników i 1 Gość przegląda ten wątek.

pavbaranov

  • Administrator
  • Ekspert
  • *****
  • Wiadomości: 848
  • Reputacja +25/-0
  • Architektura: x86_64
  • DE/WM: KF5.16+Plasma5.4.95+KDEApps 15.11.80+git na KF5
  • Distro: Arch Linux
  • GPU: Radeon free
  • Kernel: 4.3 (BFQ/CK/BLD/UKSM/+optymalizacje)
LibreOffice 4.4.0 beta
« dnia: Grudzień 09, 2014, 13:54:22 »
Przedstawiam tu PKGBUILDa dla rozwojowej linii LibreOffice (obecnie to beta2). Jeśli ktoś chciałby skorzystać, ewentualnie pomóc w rozwoju - będę wdzięczny. Oryginalny PKGBUILD pochodzi z "projektu" libreoffice-fresh-rpm: https://aur.archlinux.org/packages/libreoffice-fresh-rpm
Paczka nie jest budowana lokalnie na komputerze ze źródeł; jej budowa polega na przekonwertowaniu udostępnionej przez Document Fundation paczki rpm na format Archa (pkg). Operacja nie trwa bardzo długo (jak budowa samego LO). Proszę jednak wziąć pod uwagę, że paczka liczy ok. 0,5GB.

##PKGBUILD##
# Contributor: Red_Squirrel <evangelion87d@gmail.com>
# Contributor: Xavier114fch <xavier114fch@gmail.com>
# Contributor: nachoig      <areta@outlook.com.br>
# Contributor: nTia89       <mattia.b89@gmail.com>
# Contributor: Mark E. Lee  <mark@markelee.com>
# Maintainer : Mark E. Lee  <mark@markelee.com>
# Maintainer : pavbaranov <pavbaranov@gmail.com>

## Changelog :
## changed build function to package function (since nothing is built)
## removed rpmextract dependency since bsdtar can already extract rpms (per Red_Squirrel's advice)
## removed double posting query
## fixed up pkgver and pkgrel variables
## updated to libreoffice 4.0.1
## added libnp12 as a dependency due to <https://bugassistant.libreoffice.org/show_bug.cgi?id=61571> as reported by xavier114fch
## fixed up some file permissions for :
##    FILE/DIR                        PERMISSIONS
##    --------                        -----------
##    /usr/bin/                          755
##    /opt/libreoffice4.0/LICENSE        644
##    /opt/libreoffice4.0/CREDITS.odt    644
##    /opt/libreoffice4.0/LICENSE.odt    644
## Using package defaults for rest
## Updated to pkgver 4.0.2
## Updated to pkgver 4.0.3
## Updated to pkgver 4.0.4
## Changed ${pkgver%.3} to $(echo $pkgver | awk -F'.' 'OFS="." {print $1,$2}')  for easy upgrades (just change the pkver and pkgrel variable)
## Updated to pkgver 4.1.0
## Moved language packs to prepare function
## removed code to extract 4.0 desktop integration; it is now extracted in a usr directory; added code to copy the usr directory
## changed directory copying code to copy all */ in the RPMS directories
## updated to upstream 4.1.1
## updated to upstream 4.1.2
## updated to upstream 4.1.3
## updated to upstream 4.1.4
## switched to sha256 sums + PGP sigs (see mailing list : <https://mailman.archlinux.org/pipermail/arch-general/2014-January/034744.html>)
## using custom linux kernel version check in package() due usage of custom kernels (the issue was brought up by nachoig, the fix was from Mark E. Lee)
## updated to upstream 4.2.0
## using curl instead of wget due to Arch upstream change as requested by nTia89
## updated to upstream 4.2.1
## updated to upstream 4.2.2
## updated to upstream 4.2.3
## updated to upstream 4.2.4
## updated to upstream 4.2.5
## removed gnome from opt-depends and added gstreamer0.10-plugins per nachoig's suggestion
## removed gstreamer0.10-plugins and added gst-plugins per nachoig's suggestion
## updated to upstream 4.3.0
## changed pkgname to libreoffice-fresh-rpm per nachoig's suggestion
## updated to upstream 4.3.1
## updated to upstream 4.3.2
## updated to upstream 4.3.3
## changed name to libreoffice-dev-rpm
## version of pkgrel corresponds to the version of beta LibreOfficeDev

pkgname=libreoffice-dev-rpm
pkgver=4.4.0
pkgrel=2
pkgdesc="LGPL Office Suite installed from rpms"
arch=('i686' 'x86_64')
url='http://www.libreoffice.org'
license=('LGPL')
depends=('glibc>=2.5' 'gtk2>=2.10.4' 'xorg-server')
makedepends=('curl' 'awk')
optdepends=('jre7-openjdk' 'gtk3' 'gst-plugins-base' 'gst-plugins-good' 'gst-plugins-bad' 'gst-plugins-ugly')
if [ "$(uname -m)" == "i686" ]; then  ## convert bit architecture to libreoffice format
  arch_mod='x86';
  sha256sums+=('3fcdd45774e4d83feaa417f789403ae7c0986346bda2cf8e46b73415f38a1b46'
              'SKIP');
 
source+=("https://download.documentfoundation.org/libreoffice/testing/${pkgver}/rpm/${arch_mod}/LibreOfficeDev_${pkgver}.0.beta${pkgrel}_Linux_${arch_mod/_/-}_rpm.tar.gz"
           
"https://download.documentfoundation.org/libreoffice/testing/${pkgver}/rpm/${arch_mod}/LibreOfficeDev_${pkgver}.0.beta${pkgrel}_Linux_${arch_mod/_/-}_rpm.tar.gz.asc")
 else
  arch_mod='x86_64';
  sha256sums+=('c0c499b78e36915b376b6f8717765bbbb090bbef4a77bd0224924c6dcd40103a'
              'SKIP')
 
source+=("https://download.documentfoundation.org/libreoffice/testing/${pkgver}/rpm/${arch_mod}/LibreOfficeDev_${pkgver}.0.beta${pkgrel}_Linux_${arch_mod/_/-}_rpm.tar.gz"
           
"https://download.documentfoundation.org/libreoffice/testing/${pkgver}/rpm/${arch_mod}/LibreOfficeDev_${pkgver}.0.beta${pkgrel}_Linux_${arch_mod/_/-}_rpm.tar.gz.asc")
fi;

prepare() { ## prepare function

## install optional language & help packs (queries user)
curl "http://download.documentfoundation.org/libreoffice/testing/${pkgver}/rpm/${arch_mod}/" -o index.html;  ## get index.html
declare -ar opt_pak=('langpack' 'helppack');  ## declare optional extensions
for a in ${opt_pak[@]}; do  ## loop for all optional extensions
  read -p "Do you want to install additional ${a} (Y/y/N/n)?" opt_ans;
  case $opt_ans in  ## evaluate the answer
    Y|y)
       echo "Which ${a} do you want to install?";
       ## generate a menu for all available packages
       select opt_ext in $(cat index.html | awk -F'_' "/${a}/ && !/.asc/ {print \$7}" | awk -F'.' '{print $1}'); do
         ## download the rpm package
         msg "Retrieving LibreOffice_${pkgver}_Linux_${arch_mod/_/-}_rpm_${a}_${opt_ext}.tar.gz...";
         curl -L -O "http://download.documentfoundation.org/libreoffice/testing/${pkgver}/rpm/${arch_mod}/LibreOfficeDev_${pkgver}.0.beta${pkgrel}_Linux_${arch_mod/_/-}_rpm_${a}_${opt_ext}.tar.gz";
         ## download the rpm sha256
         # curl -L -O "http://download.documentfoundation.org/libreoffice/testing/${pkgver}/rpm/${arch_mod}/LibreOfficeDev_${pkgver}.0.beta${pkgrel}_Linux_${arch_mod/_/-}_rpm_${a}_${opt_ext}.tar.gz.sha256";
         ## check the sha256 sum for the package
         msg "Done";
         msg "Validating LibreOffice_${pkgver}_Linux_${arch_mod/_/-}_rpm_${a}_${opt_ext}.tar.gz with sha256sum...";
         # sha256sum -c "LibreOffice_${pkgver}_Linux_${arch_mod/_/-}_rpm_${a}_${opt_ext}.tar.gz.sha256"
         if [ ! $? -eq 0 ]; then  ## check the sha256sum error
            echo "Failed sha256sum check for http://download.documentfoundation.org/libreoffice/stable/${pkgver}/rpm/${arch_mod}/LibreOffice_${pkgver}_Linux_${arch_mod/_/-}_rpm_${a}_${opt_ext}.tar.gz";
            exit;
          else
            msg "Done";
            ## extract the help/lang pack archive
            msg "Extracting LibreOffice_${pkgver}_Linux_${arch_mod/_/-}_rpm_${a}_${opt_ext}.tar.gz..."
            tar -xf "LibreOfficeDev_${pkgver}.0.beta${pkgrel}_Linux_${arch_mod/_/-}_rpm_${a}_${opt_ext}.tar.gz";
            msg "Done";
         fi;
         break;  ## break the select loop
       done;
       ;;
    N|n)
       echo "Not installing additional $a";
       ;;
    *)
       echo "Not a valid answer";
       ;;
  esac;
done;

}

package() {   ## package function

## check kernel version to allow arbitrarily patched kernels
## need to be above linux 2.6.18 = 20618
## pad the middle digit with two digits since Torvalds doesn't want to go past 99 in kernel versions and to ensure the check works
min_kern_ver=20618;
kern_ver=$(uname -r | awk -F'-' '{print $1}' | awk -F'.' '{print $1"0"$2$3}');
if [ $kern_ver -lt $min_kern_ver ]; then
   msg "The kernel version needs to be at least 2.6.18. The current kernel version is $(uname -r). Please update your linux kernel";
   exit;
fi;

cd ${srcdir};  ## enter the package source directory
## extract rpms and install them
for a in $(ls -d */); do  ## loop for all directories found
  cd "${srcdir}/${a}/RPMS";  ## enter the RPMS directory
  for b in *.rpm; do  ## loop for all rpm files found
    bsdtar -xf $b;  ## extract the rpm files
  done;
 
  cp -rf */ ${pkgdir}/;  ## copy and merge all found directories to the package directory

  ## change the permissions for files that shouldn't be executable
  # declare -a wrongexec=("opt/libreoffice$(echo $pkgver | awk -F'.' 'OFS="." {print $1,$2}')/CREDITS.fodt" "opt/libreoffice$(echo $pkgver | awk -F'.' 'OFS="." {print $1,$2}')/LICENSE.fodt" "opt/libreoffice$(echo $pkgver | awk -F'.' 'OFS="." {print $1,$2}')/NOTICE");  ## set the array to change permissions
  for a in ${wrongexec[@]}; do
    chmod 644 ${pkgdir}/$a; ## change permissions to read/write for root, read only for users
  done;
done;

}
sha256sums=('5820d52a97bf04d80181b1952471d4181ec491050d0c4808d832a1096eec8729'
            'SKIP')

Sposób instalacji:
- należy skopiować ww. kod PKGBUILD do pliku o nazwie PKGBUILD w jakimkolwiek katalogu (u mnie to ~/tmp/LODev/
- w katalogu tym wywołać w konsoli:
makepkg -sircPowinno zadziałać.

W przypadku pojawienia się nowej wersji beta dla LO, chcąc ją zbudować:
- zmieniamy wartość pkgrel w PKGBUILD na odpowiadającą tej wersji (np. w najbliższym wydaniu będzie to 3, które trzeba wpisać w miejscu 2),
- wpisujemy w katalogu z PKGBUILD: updpkgsums i instalujemy jak wyżej (makepkg).

PS: Istnieje możliwość, że paczka nie buduje polskich lokalizacji (proszę sprawdzić).

 

Polityka cookies
Darmowe Fora | Darmowe Forum
polskiedobrerpg ppiz endercraft weganizm gangpod