/[gentoo-x86]/app-office/libreoffice/files/generate_libreoffice_package.sh
Gentoo

Diff of /app-office/libreoffice/files/generate_libreoffice_package.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

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

Legend:
Removed from v.1.8  
changed lines
  Added in v.1.16

  ViewVC Help
Powered by ViewVC 1.1.20