/[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.14 - (hide annotations) (download) (as text)
Sun Jul 14 11:42:24 2013 UTC (17 months, 1 week ago) by dilfridge
Branch: MAIN
Changes since 1.13: +3 -0 lines
File MIME type: text/x-sh
Add workaround for bug 473974

(Portage version: 2.2.0_alpha188/cvs/Linux x86_64, signed Manifest commit with key EBE6A336BE19039C!)

1 scarabeus 1.1 #!/bin/bash
2    
3 ago 1.6 # important: you need to use the most general CFLAGS to build the packages:
4 dilfridge 1.2 # * for x86 : CFLAGS="-march=i586 -mtune=generic -O2 -pipe -g"
5     # * for amd64: CFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -g"
6    
7 ago 1.6 # What you can set:
8 dilfridge 1.13 VERSION="4.0.4.2"
9     BINVERSION="4.0.4.2"
10 dilfridge 1.8 OPTS="-v"
11 ago 1.6 USEFILE="/etc/portage/package.use/libreo"
12     MYPKGDIR="$( portageq pkgdir )"
13     ################################################
14    
15 dilfridge 1.14 # bug 473974
16     export LC_MESSAGES=C
17    
18 scarabeus 1.1 die() {
19 ago 1.6 echo "${1}"
20     exit 1
21 scarabeus 1.1 }
22    
23 ago 1.6 if [ "$( uname -m )" = "x86_64" ] ; then
24     MYFLAGS="-march=x86-64 -mtune=generic -O2 -pipe -g"
25     ARCH="amd64"
26     elif [ "$( uname -m )" = "i686" ] ; then
27     MYFLAGS="-march=i586 -mtune=generic -O2 -pipe -g"
28     ARCH="x86"
29     else
30 dilfridge 1.10 die "Arch $( uname -m ) not supported"
31 ago 1.6 fi
32    
33     for i in \
34     "/bin/echo" \
35     "/bin/mkdir" \
36     "/bin/mv" \
37     "/bin/rm" \
38     "/bin/sed" \
39     "/bin/tar" \
40     "/usr/bin/emerge" \
41     "/usr/bin/portageq" \
42     "/usr/bin/quickpkg"
43     do
44     if [ ! -e "${i}" ] ; then
45 dilfridge 1.10 die "Missing some basic utility in your system"
46 ago 1.6 fi
47     done
48 scarabeus 1.1
49     # first the default subset of useflags
50 dilfridge 1.13 IUSES_BASE="bash-completion branding cups dbus gstreamer gtk opengl vba webdav -aqua -binfilter -bluetooth -debug -jemalloc -mysql -odk -postgres -telepathy"
51 dilfridge 1.7
52     ENABLE_EXTENSIONS="presenter-console presenter-minimizer"
53     DISABLE_EXTENSIONS="nlpsolver pdfimport scripting-beanshell scripting-javascript wiki-publisher"
54    
55     for lo_xt in ${ENABLE_EXTENSIONS}; do
56     IUSES_BASE+=" libreoffice_extensions_${lo_xt}"
57     done
58     for lo_xt in ${DISABLE_EXTENSIONS}; do
59     IUSES_BASE+=" -libreoffice_extensions_${lo_xt}"
60     done
61     unset lo_xt
62 scarabeus 1.1
63     # now for the options
64 scarabeus 1.9 IUSES_J="java libreoffice_extensions_nlpsolver"
65 scarabeus 1.1 IUSES_NJ="-java"
66     IUSES_G="gnome eds"
67     IUSES_NG="-gnome -eds"
68     IUSES_K="kde"
69     IUSES_NK="-kde"
70    
71 ago 1.5 if [ -f /etc/portage/package.use ] ; then
72 dilfridge 1.10 die "Please save your package.use and re-create it as a directory"
73 ago 1.5 fi
74    
75 dilfridge 1.10 mkdir -p /etc/portage/package.use/ || die
76 scarabeus 1.1
77 dilfridge 1.10 mkdir -p "${MYPKGDIR}"
78 ago 1.6 if [ -z "${MYPKGDIR}" -o ! -d "${MYPKGDIR}" ] ; then
79     die "Anything goes wrong"
80     fi
81 ago 1.5
82 scarabeus 1.1 # compile the flavor
83     echo "Base"
84 ago 1.6 echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_NJ} ${IUSES_NG} ${IUSES_NK}" > ${USEFILE}
85 ago 1.11 FEATURES="${FEATURES} splitdebug" CFLAGS="${MYFLAGS}" CXXFLAGS="${MYFLAGS}" emerge ${OPTS} =libreoffice-${VERSION} || die "emerge failed"
86 scarabeus 1.1 quickpkg libreoffice --include-config=y
87 ago 1.5 mv ${MYPKGDIR}/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-base-${BINVERSION}.tbz2 || die "Moving package failed"
88 scarabeus 1.1
89     echo "Base - java"
90 ago 1.6 echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_J} ${IUSES_NG} ${IUSES_NK}" > ${USEFILE}
91 ago 1.11 FEATURES="${FEATURES} splitdebug" CFLAGS="${MYFLAGS}" CXXFLAGS="${MYFLAGS}" emerge ${OPTS} =libreoffice-${VERSION} || die "emerge failed"
92 scarabeus 1.1 quickpkg libreoffice --include-config=y
93 ago 1.5 mv ${MYPKGDIR}/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-base-java-${BINVERSION}.tbz2 || die "Moving package failed"
94 scarabeus 1.1
95     # kde flavor
96     echo "KDE"
97 ago 1.6 echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_NJ} ${IUSES_NG} ${IUSES_K}" > ${USEFILE}
98 ago 1.11 FEATURES="${FEATURES} splitdebug" CFLAGS="${MYFLAGS}" CXXFLAGS="${MYFLAGS}" emerge ${OPTS} =libreoffice-${VERSION} || die "emerge failed"
99 scarabeus 1.1 quickpkg libreoffice --include-config=y
100 ago 1.5 mv ${MYPKGDIR}/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-kde-${BINVERSION}.tbz2 || die "Moving package failed"
101 scarabeus 1.1
102     echo "KDE - java"
103 ago 1.6 echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_J} ${IUSES_NG} ${IUSES_K}" > ${USEFILE}
104 ago 1.11 FEATURES="${FEATURES} splitdebug" CFLAGS="${MYFLAGS}" CXXFLAGS="${MYFLAGS}" emerge ${OPTS} =libreoffice-${VERSION} || die "emerge failed"
105 scarabeus 1.1 quickpkg libreoffice --include-config=y
106 ago 1.5 mv ${MYPKGDIR}/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-kde-java-${BINVERSION}.tbz2 || die "Moving package failed"
107 scarabeus 1.1
108     # gnome flavor
109     echo "Gnome"
110 ago 1.6 echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_NJ} ${IUSES_G} ${IUSES_NK}" > ${USEFILE}
111 ago 1.11 FEATURES="${FEATURES} splitdebug" CFLAGS="${MYFLAGS}" CXXFLAGS="${MYFLAGS}" emerge ${OPTS} =libreoffice-${VERSION} || die "emerge failed"
112 scarabeus 1.1 quickpkg libreoffice --include-config=y
113 ago 1.5 mv ${MYPKGDIR}/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-gnome-${BINVERSION}.tbz2 || die "Moving package failed"
114 scarabeus 1.1
115     echo "Gnome -java"
116 ago 1.6 echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_J} ${IUSES_G} ${IUSES_NK}" > ${USEFILE}
117 ago 1.11 FEATURES="${FEATURES} splitdebug" CFLAGS="${MYFLAGS}" CXXFLAGS="${MYFLAGS}" emerge ${OPTS} =libreoffice-${VERSION} || die "emerge failed"
118 scarabeus 1.1 quickpkg libreoffice --include-config=y
119 ago 1.5 mv ${MYPKGDIR}/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-gnome-java-${BINVERSION}.tbz2 || die "Moving package failed"
120 dilfridge 1.2
121    
122 ago 1.5 for name in ./libreoffice-*-${BINVERSION}.tbz2 ; do
123 dilfridge 1.2
124     BN=`basename $name .tbz2`
125    
126     rm -rf tmp.lo
127     mkdir -vp tmp.lo/p1 tmp.lo/p2
128     cd tmp.lo/p1
129    
130     echo "Unpacking complete archive $BN.tbz2"
131     tar xfvjp ../../$BN.tbz2
132    
133     echo "Moving debug info"
134     mkdir -vp ../p2/usr/lib
135     mv -v usr/lib/debug ../p2/usr/lib/
136    
137     echo "Re-packing program"
138 ago 1.6 tar cfvJ ../../$ARCH-bin-$BN.tar.xz --owner root --group root ./*
139 dilfridge 1.2
140     echo "Re-packing debug info"
141     cd ../p2
142 ago 1.6 tar cfvJ ../../$ARCH-debug-$BN.tar.xz --owner root --group root ./*
143 dilfridge 1.2
144     echo "Removing unpacked files"
145     cd ../..
146     rm -rf tmp.lo
147 scarabeus 1.1
148 dilfridge 1.2 echo "Done with $BN.tbz2"
149 scarabeus 1.1
150 dilfridge 1.2 done
151 ago 1.6
152 dilfridge 1.10 rm -f ${USEFILE} || die "Removing ${USEFILE} failed"
153 ago 1.6
154 dilfridge 1.10 rm -f libreoffice*${VERSION}*.tbz2 || die "Removing un-split package files failed"

  ViewVC Help
Powered by ViewVC 1.1.20