/[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.2 - (hide annotations) (download) (as text)
Sun May 27 15:30:31 2012 UTC (3 years, 1 month ago) by dilfridge
Branch: MAIN
Changes since 1.1: +44 -8 lines
File MIME type: text/x-sh
Update package generation script

(Portage version: 2.2.0_alpha108/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.2 VERSION="3.5.2.2"
14    
15     BINRELEASE="-r1"
16 scarabeus 1.1
17     # first the default subset of useflags
18 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"
19 scarabeus 1.1
20     # now for the options
21     IUSES_J="java"
22     IUSES_NJ="-java"
23     IUSES_G="gnome eds"
24     IUSES_NG="-gnome -eds"
25     IUSES_K="kde"
26     IUSES_NK="-kde"
27    
28     mkdir -p /etc/portage/package.use/
29    
30     # compile the flavor
31     echo "Base"
32     echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_NJ} ${IUSES_NG} ${IUSES_NK}" > /etc/portage/package.use/libreo
33     emerge -v =libreoffice-${VERSION} || die "emerge failed"
34     quickpkg libreoffice --include-config=y
35 dilfridge 1.2 mv /tmp/portage/packages/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-base-${VERSION}${BINRELEASE}.tbz2 || die "Moving package failed"
36 scarabeus 1.1
37     echo "Base - java"
38     echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_J} ${IUSES_NG} ${IUSES_NK}" > /etc/portage/package.use/libreo
39     emerge -v =libreoffice-${VERSION} || die "emerge failed"
40     quickpkg libreoffice --include-config=y
41 dilfridge 1.2 mv /tmp/portage/packages/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-base-java-${VERSION}${BINRELEASE}.tbz2 || die "Moving package failed"
42 scarabeus 1.1
43     # kde flavor
44     echo "KDE"
45     echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_NJ} ${IUSES_NG} ${IUSES_K}" > /etc/portage/package.use/libreo
46     emerge -v =libreoffice-${VERSION} || die "emerge failed"
47     quickpkg libreoffice --include-config=y
48 dilfridge 1.2 mv /tmp/portage/packages/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-kde-${VERSION}${BINRELEASE}.tbz2 || die "Moving package failed"
49 scarabeus 1.1
50     echo "KDE - java"
51     echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_J} ${IUSES_NG} ${IUSES_K}" > /etc/portage/package.use/libreo
52     emerge -v =libreoffice-${VERSION} || die "emerge failed"
53     quickpkg libreoffice --include-config=y
54 dilfridge 1.2 mv /tmp/portage/packages/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-kde-java-${VERSION}${BINRELEASE}.tbz2 || die "Moving package failed"
55 scarabeus 1.1
56     # gnome flavor
57     echo "Gnome"
58     echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_NJ} ${IUSES_G} ${IUSES_NK}" > /etc/portage/package.use/libreo
59     emerge -v =libreoffice-${VERSION} || die "emerge failed"
60     quickpkg libreoffice --include-config=y
61 dilfridge 1.2 mv /tmp/portage/packages/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-gnome-${VERSION}${BINRELEASE}.tbz2 || die "Moving package failed"
62 scarabeus 1.1
63     echo "Gnome -java"
64     echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_J} ${IUSES_G} ${IUSES_NK}" > /etc/portage/package.use/libreo
65     emerge -v =libreoffice-${VERSION} || die "emerge failed"
66     quickpkg libreoffice --include-config=y
67 dilfridge 1.2 mv /tmp/portage/packages/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-gnome-java-${VERSION}${BINRELEASE}.tbz2 || die "Moving package failed"
68    
69    
70     for 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 scarabeus 1.1
96 dilfridge 1.2 echo "Done with $BN.tbz2"
97 scarabeus 1.1
98 dilfridge 1.2 done

  ViewVC Help
Powered by ViewVC 1.1.20