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

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

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (hide annotations) (download) (as text)
Wed Aug 1 09:00:12 2012 UTC (2 years, 4 months ago) by dilfridge
Branch: MAIN
Changes since 1.3: +2 -2 lines
File MIME type: text/x-sh
Update script

(Portage version: 2.2.0_alpha120/cvs/Linux x86_64)

1 scarabeus 1.1 #!/bin/bash
2    
3 dilfridge 1.2 # 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"
7    
8 scarabeus 1.1 die() {
9     echo "${1}"
10     exit 1
11     }
12    
13 dilfridge 1.4 VERSION="3.5.5.3"
14     BINVERSION="3.5.5.3"
15 scarabeus 1.1
16     # first the default subset of useflags
17 dilfridge 1.2 IUSES_BASE="bash-completion binfilter branding cups dbus graphite gstreamer gtk nsplugin python vba webdav xmlsec -aqua -jemalloc -mysql -nlpsolver -odk -opengl -pdfimport -postgres -svg"
18 scarabeus 1.1
19     # now for the options
20     IUSES_J="java"
21     IUSES_NJ="-java"
22     IUSES_G="gnome eds"
23     IUSES_NG="-gnome -eds"
24     IUSES_K="kde"
25     IUSES_NK="-kde"
26    
27     mkdir -p /etc/portage/package.use/
28    
29     # compile the flavor
30     echo "Base"
31     echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_NJ} ${IUSES_NG} ${IUSES_NK}" > /etc/portage/package.use/libreo
32     emerge -v =libreoffice-${VERSION} || die "emerge failed"
33     quickpkg libreoffice --include-config=y
34 dilfridge 1.3 mv /tmp/portage/packages/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-base-${BINVERSION}.tbz2 || die "Moving package failed"
35 scarabeus 1.1
36     echo "Base - java"
37     echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_J} ${IUSES_NG} ${IUSES_NK}" > /etc/portage/package.use/libreo
38     emerge -v =libreoffice-${VERSION} || die "emerge failed"
39     quickpkg libreoffice --include-config=y
40 dilfridge 1.3 mv /tmp/portage/packages/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-base-java-${BINVERSION}.tbz2 || die "Moving package failed"
41 scarabeus 1.1
42     # kde flavor
43     echo "KDE"
44     echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_NJ} ${IUSES_NG} ${IUSES_K}" > /etc/portage/package.use/libreo
45     emerge -v =libreoffice-${VERSION} || die "emerge failed"
46     quickpkg libreoffice --include-config=y
47 dilfridge 1.3 mv /tmp/portage/packages/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-kde-${BINVERSION}.tbz2 || die "Moving package failed"
48 scarabeus 1.1
49     echo "KDE - java"
50     echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_J} ${IUSES_NG} ${IUSES_K}" > /etc/portage/package.use/libreo
51     emerge -v =libreoffice-${VERSION} || die "emerge failed"
52     quickpkg libreoffice --include-config=y
53 dilfridge 1.3 mv /tmp/portage/packages/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-kde-java-${BINVERSION}.tbz2 || die "Moving package failed"
54 scarabeus 1.1
55     # gnome flavor
56     echo "Gnome"
57     echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_NJ} ${IUSES_G} ${IUSES_NK}" > /etc/portage/package.use/libreo
58     emerge -v =libreoffice-${VERSION} || die "emerge failed"
59     quickpkg libreoffice --include-config=y
60 dilfridge 1.3 mv /tmp/portage/packages/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-gnome-${BINVERSION}.tbz2 || die "Moving package failed"
61 scarabeus 1.1
62     echo "Gnome -java"
63     echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_J} ${IUSES_G} ${IUSES_NK}" > /etc/portage/package.use/libreo
64     emerge -v =libreoffice-${VERSION} || die "emerge failed"
65     quickpkg libreoffice --include-config=y
66 dilfridge 1.3 mv /tmp/portage/packages/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-gnome-java-${BINVERSION}.tbz2 || die "Moving package failed"
67 dilfridge 1.2
68    
69 dilfridge 1.3 for name in ./libreoffice-*-${BINVERSION}.tbz2 ; do
70 dilfridge 1.2
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 scarabeus 1.1
95 dilfridge 1.2 echo "Done with $BN.tbz2"
96 scarabeus 1.1
97 dilfridge 1.2 done

  ViewVC Help
Powered by ViewVC 1.1.20