/[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.17 - (show annotations) (download) (as text)
Fri Nov 1 17:04:48 2013 UTC (11 months, 3 weeks ago) by dilfridge
Branch: MAIN
CVS Tags: HEAD
Changes since 1.16: +0 -0 lines
File MIME type: text/x-sh
FILE REMOVED
Move build scripts to https://gitorious.org/gentoo-stuff/lo-bin-build

(Portage version: 2.2.7/cvs/Linux x86_64, signed Manifest commit with key 84AD142F)

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

  ViewVC Help
Powered by ViewVC 1.1.20