/[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.4
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.5.3"
14BINVERSION="3.5.5.3"
9 15
10# first the default subset of useflags 16# first the default subset of useflags
11IUSES_BASE="bash-completion binfilter branding dbus graphite gstreamer gtk python templates webdav odk" 17IUSES_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 18
13# now for the options 19# now for the options
14IUSES_J="java" 20IUSES_J="java"
15IUSES_NJ="-java" 21IUSES_NJ="-java"
16IUSES_G="gnome eds" 22IUSES_G="gnome eds"
23# compile the flavor 29# compile the flavor
24echo "Base" 30echo "Base"
25echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_NJ} ${IUSES_NG} ${IUSES_NK}" > /etc/portage/package.use/libreo 31echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_NJ} ${IUSES_NG} ${IUSES_NK}" > /etc/portage/package.use/libreo
26emerge -v =libreoffice-${VERSION} || die "emerge failed" 32emerge -v =libreoffice-${VERSION} || die "emerge failed"
27quickpkg libreoffice --include-config=y 33quickpkg libreoffice --include-config=y
28cp /usr/portage/packages/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-base-${VERSION}.tbz2 || die "Copying package failed" 34mv /tmp/portage/packages/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-base-${BINVERSION}.tbz2 || die "Moving package failed"
29 35
30echo "Base - java" 36echo "Base - java"
31echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_J} ${IUSES_NG} ${IUSES_NK}" > /etc/portage/package.use/libreo 37echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_J} ${IUSES_NG} ${IUSES_NK}" > /etc/portage/package.use/libreo
32emerge -v =libreoffice-${VERSION} || die "emerge failed" 38emerge -v =libreoffice-${VERSION} || die "emerge failed"
33quickpkg libreoffice --include-config=y 39quickpkg libreoffice --include-config=y
34cp /usr/portage/packages/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-base-java-${VERSION}.tbz2 || die "Copying package failed" 40mv /tmp/portage/packages/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-base-java-${BINVERSION}.tbz2 || die "Moving package failed"
35 41
36# kde flavor 42# kde flavor
37echo "KDE" 43echo "KDE"
38echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_NJ} ${IUSES_NG} ${IUSES_K}" > /etc/portage/package.use/libreo 44echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_NJ} ${IUSES_NG} ${IUSES_K}" > /etc/portage/package.use/libreo
39emerge -v =libreoffice-${VERSION} || die "emerge failed" 45emerge -v =libreoffice-${VERSION} || die "emerge failed"
40quickpkg libreoffice --include-config=y 46quickpkg libreoffice --include-config=y
41cp /usr/portage/packages/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-kde-${VERSION}.tbz2 || die "Copying package failed" 47mv /tmp/portage/packages/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-kde-${BINVERSION}.tbz2 || die "Moving package failed"
42 48
43echo "KDE - java" 49echo "KDE - java"
44echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_J} ${IUSES_NG} ${IUSES_K}" > /etc/portage/package.use/libreo 50echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_J} ${IUSES_NG} ${IUSES_K}" > /etc/portage/package.use/libreo
45emerge -v =libreoffice-${VERSION} || die "emerge failed" 51emerge -v =libreoffice-${VERSION} || die "emerge failed"
46quickpkg libreoffice --include-config=y 52quickpkg libreoffice --include-config=y
47cp /usr/portage/packages/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-kde-java-${VERSION}.tbz2 || die "Copying package failed" 53mv /tmp/portage/packages/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-kde-java-${BINVERSION}.tbz2 || die "Moving package failed"
48 54
49# gnome flavor 55# gnome flavor
50echo "Gnome" 56echo "Gnome"
51echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_NJ} ${IUSES_G} ${IUSES_NK}" > /etc/portage/package.use/libreo 57echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_NJ} ${IUSES_G} ${IUSES_NK}" > /etc/portage/package.use/libreo
52emerge -v =libreoffice-${VERSION} || die "emerge failed" 58emerge -v =libreoffice-${VERSION} || die "emerge failed"
53quickpkg libreoffice --include-config=y 59quickpkg libreoffice --include-config=y
54cp /usr/portage/packages/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-gnome-${VERSION}.tbz2 || die "Copying package failed" 60mv /tmp/portage/packages/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-gnome-${BINVERSION}.tbz2 || die "Moving package failed"
55 61
56echo "Gnome -java" 62echo "Gnome -java"
57echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_J} ${IUSES_G} ${IUSES_NK}" > /etc/portage/package.use/libreo 63echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_J} ${IUSES_G} ${IUSES_NK}" > /etc/portage/package.use/libreo
58emerge -v =libreoffice-${VERSION} || die "emerge failed" 64emerge -v =libreoffice-${VERSION} || die "emerge failed"
59quickpkg libreoffice --include-config=y 65quickpkg libreoffice --include-config=y
60cp /usr/portage/packages/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-gnome-java-${VERSION}.tbz2 || die "Copying package failed" 66mv /tmp/portage/packages/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-gnome-java-${BINVERSION}.tbz2 || die "Moving package failed"
61 67
62 68
69for name in ./libreoffice-*-${BINVERSION}.tbz2 ; do
70
71 BN=`basename $name .tbz2`
72
73 rm -rf tmp.lo
74 mkdir -vp tmp.lo/p1 tmp.lo/p2
75 cd tmp.lo/p1
76
77 echo "Unpacking complete archive $BN.tbz2"
78 tar xfvjp ../../$BN.tbz2
79
80 echo "Moving debug info"
81 mkdir -vp ../p2/usr/lib
82 mv -v usr/lib/debug ../p2/usr/lib/
83
84 echo "Re-packing program"
85 tar cfvJ ../../bin-$BN.tar.xz --owner root --group root ./*
86
87 echo "Re-packing debug info"
88 cd ../p2
89 tar cfvJ ../../debug-$BN.tar.xz --owner root --group root ./*
90
91 echo "Removing unpacked files"
92 cd ../..
93 rm -rf tmp.lo
94
95 echo "Done with $BN.tbz2"
96
97done

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

  ViewVC Help
Powered by ViewVC 1.1.20