/[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.3 - (show annotations) (download) (as text)
Sat Jun 2 09:41:50 2012 UTC (22 months, 3 weeks ago) by dilfridge
Branch: MAIN
Changes since 1.2: +9 -10 lines
File MIME type: text/x-sh
Need more general version handling

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

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.4.2-r1"
14 BINVERSION="3.5.4.2-r1"
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 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 mv /tmp/portage/packages/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-base-${BINVERSION}.tbz2 || die "Moving package failed"
35
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 mv /tmp/portage/packages/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-base-java-${BINVERSION}.tbz2 || die "Moving package failed"
41
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 mv /tmp/portage/packages/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-kde-${BINVERSION}.tbz2 || die "Moving package failed"
48
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 mv /tmp/portage/packages/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-kde-java-${BINVERSION}.tbz2 || die "Moving package failed"
54
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 mv /tmp/portage/packages/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-gnome-${BINVERSION}.tbz2 || die "Moving package failed"
61
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 mv /tmp/portage/packages/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-gnome-java-${BINVERSION}.tbz2 || die "Moving package failed"
67
68
69 for 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
97 done

  ViewVC Help
Powered by ViewVC 1.1.20