/[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.5 - (hide annotations) (download) (as text)
Wed Nov 14 22:32:55 2012 UTC (22 months ago) by ago
Branch: MAIN
Changes since 1.4: +23 -14 lines
File MIME type: text/x-sh
Make the generator script more usable

(Portage version: 2.1.11.31/cvs/Linux x86_64, unsigned Manifest commit)

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 ago 1.5 # recommendation:
5 dilfridge 1.2 # * 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 ago 1.5 if [ -f /etc/portage/package.use ] ; then
28     echo "Please save your package.use and make it as a directory"
29     exit 1
30     fi
31    
32 scarabeus 1.1 mkdir -p /etc/portage/package.use/
33    
34 ago 1.5 OPTS="-v"
35    
36     MYPKGDIR="$( emerge --info | grep PKGDIR | sed "s:PKGDIR=::;s:\"::g" )"
37    
38 scarabeus 1.1 # compile the flavor
39     echo "Base"
40     echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_NJ} ${IUSES_NG} ${IUSES_NK}" > /etc/portage/package.use/libreo
41 ago 1.5 emerge ${OPTS} =libreoffice-${VERSION} || die "emerge failed"
42 scarabeus 1.1 quickpkg libreoffice --include-config=y
43 ago 1.5 mv ${MYPKGDIR}/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-base-${BINVERSION}.tbz2 || die "Moving package failed"
44 scarabeus 1.1
45     echo "Base - java"
46     echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_J} ${IUSES_NG} ${IUSES_NK}" > /etc/portage/package.use/libreo
47 ago 1.5 emerge ${OPTS} =libreoffice-${VERSION} || die "emerge failed"
48 scarabeus 1.1 quickpkg libreoffice --include-config=y
49 ago 1.5 mv ${MYPKGDIR}/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-base-java-${BINVERSION}.tbz2 || die "Moving package failed"
50 scarabeus 1.1
51     # kde flavor
52     echo "KDE"
53     echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_NJ} ${IUSES_NG} ${IUSES_K}" > /etc/portage/package.use/libreo
54 ago 1.5 emerge ${OPTS} =libreoffice-${VERSION} || die "emerge failed"
55 scarabeus 1.1 quickpkg libreoffice --include-config=y
56 ago 1.5 mv ${MYPKGDIR}/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-kde-${BINVERSION}.tbz2 || die "Moving package failed"
57 scarabeus 1.1
58     echo "KDE - java"
59     echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_J} ${IUSES_NG} ${IUSES_K}" > /etc/portage/package.use/libreo
60 ago 1.5 emerge ${OPTS} =libreoffice-${VERSION} || die "emerge failed"
61 scarabeus 1.1 quickpkg libreoffice --include-config=y
62 ago 1.5 mv ${MYPKGDIR}/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-kde-java-${BINVERSION}.tbz2 || die "Moving package failed"
63 scarabeus 1.1
64     # gnome flavor
65     echo "Gnome"
66     echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_NJ} ${IUSES_G} ${IUSES_NK}" > /etc/portage/package.use/libreo
67 ago 1.5 emerge ${OPTS} =libreoffice-${VERSION} || die "emerge failed"
68 scarabeus 1.1 quickpkg libreoffice --include-config=y
69 ago 1.5 mv ${MYPKGDIR}/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-gnome-${BINVERSION}.tbz2 || die "Moving package failed"
70 scarabeus 1.1
71     echo "Gnome -java"
72     echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_J} ${IUSES_G} ${IUSES_NK}" > /etc/portage/package.use/libreo
73 ago 1.5 emerge ${OPTS} =libreoffice-${VERSION} || die "emerge failed"
74 scarabeus 1.1 quickpkg libreoffice --include-config=y
75 ago 1.5 mv ${MYPKGDIR}/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-gnome-java-${BINVERSION}.tbz2 || die "Moving package failed"
76 dilfridge 1.2
77    
78 ago 1.5 for name in ./libreoffice-*-${BINVERSION}.tbz2 ; do
79 dilfridge 1.2
80     BN=`basename $name .tbz2`
81    
82     rm -rf tmp.lo
83     mkdir -vp tmp.lo/p1 tmp.lo/p2
84     cd tmp.lo/p1
85    
86     echo "Unpacking complete archive $BN.tbz2"
87     tar xfvjp ../../$BN.tbz2
88    
89     echo "Moving debug info"
90     mkdir -vp ../p2/usr/lib
91     mv -v usr/lib/debug ../p2/usr/lib/
92    
93     echo "Re-packing program"
94     tar cfvJ ../../bin-$BN.tar.xz --owner root --group root ./*
95    
96     echo "Re-packing debug info"
97     cd ../p2
98     tar cfvJ ../../debug-$BN.tar.xz --owner root --group root ./*
99    
100     echo "Removing unpacked files"
101     cd ../..
102     rm -rf tmp.lo
103 scarabeus 1.1
104 dilfridge 1.2 echo "Done with $BN.tbz2"
105 scarabeus 1.1
106 dilfridge 1.2 done

  ViewVC Help
Powered by ViewVC 1.1.20