/[gentoo-x86]/app-office/libreoffice/files/generate_libreoffice_package.sh
Gentoo

Diff of /app-office/libreoffice/files/generate_libreoffice_package.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.1 Revision 1.2
1#!/bin/bash 1#!/bin/bash
2
3# important: you need to use the most general CFLAGS to build the packages
4# recommendation:
5# * for x86 : CFLAGS="-march=i586 -mtune=generic -O2 -pipe -g"
6# * for amd64: CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -g"
2 7
3die() { 8die() {
4 echo "${1}" 9 echo "${1}"
5 exit 1 10 exit 1
6} 11}
7 12
8VERSION="3.4.5.2" 13VERSION="3.5.2.2"
14
15BINRELEASE="-r1"
9 16
10# first the default subset of useflags 17# first the default subset of useflags
11IUSES_BASE="bash-completion binfilter branding dbus graphite gstreamer gtk python templates webdav odk" 18IUSES_BASE="bash-completion binfilter branding cups dbus graphite gstreamer gtk nsplugin python vba webdav xmlsec -aqua -jemalloc -mysql -nlpsolver -odk -opengl -pdfimport -postgres -svg"
12 19
13# now for the options 20# now for the options
14IUSES_J="java" 21IUSES_J="java"
15IUSES_NJ="-java" 22IUSES_NJ="-java"
16IUSES_G="gnome eds" 23IUSES_G="gnome eds"
23# compile the flavor 30# compile the flavor
24echo "Base" 31echo "Base"
25echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_NJ} ${IUSES_NG} ${IUSES_NK}" > /etc/portage/package.use/libreo 32echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_NJ} ${IUSES_NG} ${IUSES_NK}" > /etc/portage/package.use/libreo
26emerge -v =libreoffice-${VERSION} || die "emerge failed" 33emerge -v =libreoffice-${VERSION} || die "emerge failed"
27quickpkg libreoffice --include-config=y 34quickpkg libreoffice --include-config=y
28cp /usr/portage/packages/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-base-${VERSION}.tbz2 || die "Copying package failed" 35mv /tmp/portage/packages/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-base-${VERSION}${BINRELEASE}.tbz2 || die "Moving package failed"
29 36
30echo "Base - java" 37echo "Base - java"
31echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_J} ${IUSES_NG} ${IUSES_NK}" > /etc/portage/package.use/libreo 38echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_J} ${IUSES_NG} ${IUSES_NK}" > /etc/portage/package.use/libreo
32emerge -v =libreoffice-${VERSION} || die "emerge failed" 39emerge -v =libreoffice-${VERSION} || die "emerge failed"
33quickpkg libreoffice --include-config=y 40quickpkg libreoffice --include-config=y
34cp /usr/portage/packages/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-base-java-${VERSION}.tbz2 || die "Copying package failed" 41mv /tmp/portage/packages/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-base-java-${VERSION}${BINRELEASE}.tbz2 || die "Moving package failed"
35 42
36# kde flavor 43# kde flavor
37echo "KDE" 44echo "KDE"
38echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_NJ} ${IUSES_NG} ${IUSES_K}" > /etc/portage/package.use/libreo 45echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_NJ} ${IUSES_NG} ${IUSES_K}" > /etc/portage/package.use/libreo
39emerge -v =libreoffice-${VERSION} || die "emerge failed" 46emerge -v =libreoffice-${VERSION} || die "emerge failed"
40quickpkg libreoffice --include-config=y 47quickpkg libreoffice --include-config=y
41cp /usr/portage/packages/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-kde-${VERSION}.tbz2 || die "Copying package failed" 48mv /tmp/portage/packages/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-kde-${VERSION}${BINRELEASE}.tbz2 || die "Moving package failed"
42 49
43echo "KDE - java" 50echo "KDE - java"
44echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_J} ${IUSES_NG} ${IUSES_K}" > /etc/portage/package.use/libreo 51echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_J} ${IUSES_NG} ${IUSES_K}" > /etc/portage/package.use/libreo
45emerge -v =libreoffice-${VERSION} || die "emerge failed" 52emerge -v =libreoffice-${VERSION} || die "emerge failed"
46quickpkg libreoffice --include-config=y 53quickpkg libreoffice --include-config=y
47cp /usr/portage/packages/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-kde-java-${VERSION}.tbz2 || die "Copying package failed" 54mv /tmp/portage/packages/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-kde-java-${VERSION}${BINRELEASE}.tbz2 || die "Moving package failed"
48 55
49# gnome flavor 56# gnome flavor
50echo "Gnome" 57echo "Gnome"
51echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_NJ} ${IUSES_G} ${IUSES_NK}" > /etc/portage/package.use/libreo 58echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_NJ} ${IUSES_G} ${IUSES_NK}" > /etc/portage/package.use/libreo
52emerge -v =libreoffice-${VERSION} || die "emerge failed" 59emerge -v =libreoffice-${VERSION} || die "emerge failed"
53quickpkg libreoffice --include-config=y 60quickpkg libreoffice --include-config=y
54cp /usr/portage/packages/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-gnome-${VERSION}.tbz2 || die "Copying package failed" 61mv /tmp/portage/packages/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-gnome-${VERSION}${BINRELEASE}.tbz2 || die "Moving package failed"
55 62
56echo "Gnome -java" 63echo "Gnome -java"
57echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_J} ${IUSES_G} ${IUSES_NK}" > /etc/portage/package.use/libreo 64echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_J} ${IUSES_G} ${IUSES_NK}" > /etc/portage/package.use/libreo
58emerge -v =libreoffice-${VERSION} || die "emerge failed" 65emerge -v =libreoffice-${VERSION} || die "emerge failed"
59quickpkg libreoffice --include-config=y 66quickpkg libreoffice --include-config=y
60cp /usr/portage/packages/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-gnome-java-${VERSION}.tbz2 || die "Copying package failed" 67mv /tmp/portage/packages/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-gnome-java-${VERSION}${BINRELEASE}.tbz2 || die "Moving package failed"
61 68
62 69
70for name in ./libreoffice-*-${VERSION}${BINRELEASE}.tbz2 ; do
71
72 BN=`basename $name .tbz2`
73
74 rm -rf tmp.lo
75 mkdir -vp tmp.lo/p1 tmp.lo/p2
76 cd tmp.lo/p1
77
78 echo "Unpacking complete archive $BN.tbz2"
79 tar xfvjp ../../$BN.tbz2
80
81 echo "Moving debug info"
82 mkdir -vp ../p2/usr/lib
83 mv -v usr/lib/debug ../p2/usr/lib/
84
85 echo "Re-packing program"
86 tar cfvJ ../../bin-$BN.tar.xz --owner root --group root ./*
87
88 echo "Re-packing debug info"
89 cd ../p2
90 tar cfvJ ../../debug-$BN.tar.xz --owner root --group root ./*
91
92 echo "Removing unpacked files"
93 cd ../..
94 rm -rf tmp.lo
95
96 echo "Done with $BN.tbz2"
97
98done

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.20