/[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 - (show annotations) (download) (as text)
Wed Nov 14 22:32:55 2012 UTC (23 months, 1 week 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 #!/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"
7
8 die() {
9 echo "${1}"
10 exit 1
11 }
12
13 VERSION="3.5.5.3"
14 BINVERSION="3.5.5.3"
15
16 # first the default subset of useflags
17 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
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 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 mkdir -p /etc/portage/package.use/
33
34 OPTS="-v"
35
36 MYPKGDIR="$( emerge --info | grep PKGDIR | sed "s:PKGDIR=::;s:\"::g" )"
37
38 # 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 emerge ${OPTS} =libreoffice-${VERSION} || die "emerge failed"
42 quickpkg libreoffice --include-config=y
43 mv ${MYPKGDIR}/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-base-${BINVERSION}.tbz2 || die "Moving package failed"
44
45 echo "Base - java"
46 echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_J} ${IUSES_NG} ${IUSES_NK}" > /etc/portage/package.use/libreo
47 emerge ${OPTS} =libreoffice-${VERSION} || die "emerge failed"
48 quickpkg libreoffice --include-config=y
49 mv ${MYPKGDIR}/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-base-java-${BINVERSION}.tbz2 || die "Moving package failed"
50
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 emerge ${OPTS} =libreoffice-${VERSION} || die "emerge failed"
55 quickpkg libreoffice --include-config=y
56 mv ${MYPKGDIR}/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-kde-${BINVERSION}.tbz2 || die "Moving package failed"
57
58 echo "KDE - java"
59 echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_J} ${IUSES_NG} ${IUSES_K}" > /etc/portage/package.use/libreo
60 emerge ${OPTS} =libreoffice-${VERSION} || die "emerge failed"
61 quickpkg libreoffice --include-config=y
62 mv ${MYPKGDIR}/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-kde-java-${BINVERSION}.tbz2 || die "Moving package failed"
63
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 emerge ${OPTS} =libreoffice-${VERSION} || die "emerge failed"
68 quickpkg libreoffice --include-config=y
69 mv ${MYPKGDIR}/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-gnome-${BINVERSION}.tbz2 || die "Moving package failed"
70
71 echo "Gnome -java"
72 echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_J} ${IUSES_G} ${IUSES_NK}" > /etc/portage/package.use/libreo
73 emerge ${OPTS} =libreoffice-${VERSION} || die "emerge failed"
74 quickpkg libreoffice --include-config=y
75 mv ${MYPKGDIR}/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-gnome-java-${BINVERSION}.tbz2 || die "Moving package failed"
76
77
78 for name in ./libreoffice-*-${BINVERSION}.tbz2 ; do
79
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
104 echo "Done with $BN.tbz2"
105
106 done

  ViewVC Help
Powered by ViewVC 1.1.20