/[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 - (hide annotations) (download) (as text)
Fri Nov 1 17:04:48 2013 UTC (5 months, 2 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 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.16 VERSION="4.1.3.2"
9     BINVERSION="4.1.3.2"
10 dilfridge 1.8 OPTS="-v"
11 ago 1.6 USEFILE="/etc/portage/package.use/libreo"
12     MYPKGDIR="$( portageq pkgdir )"
13 dilfridge 1.16 MYTMPDIR=/root/tmp
14     MYDISTDIR=/root/distfiles
15    
16 ago 1.6 ################################################
17    
18 dilfridge 1.14 # bug 473974
19     export LC_MESSAGES=C
20    
21 scarabeus 1.1 die() {
22 ago 1.6 echo "${1}"
23     exit 1
24 scarabeus 1.1 }
25    
26 ago 1.6 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 dilfridge 1.10 die "Arch $( uname -m ) not supported"
34 ago 1.6 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 dilfridge 1.10 die "Missing some basic utility in your system"
49 ago 1.6 fi
50     done
51 scarabeus 1.1
52     # first the default subset of useflags
53 dilfridge 1.15 IUSES_BASE="bash-completion branding cups dbus gstreamer gtk opengl vba webdav -aqua -binfilter -bluetooth -debug -gtk3 -jemalloc -mysql -odk -postgres -telepathy"
54 dilfridge 1.7
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 scarabeus 1.1
66     # now for the options
67 scarabeus 1.9 IUSES_J="java libreoffice_extensions_nlpsolver"
68 scarabeus 1.1 IUSES_NJ="-java"
69     IUSES_G="gnome eds"
70     IUSES_NG="-gnome -eds"
71     IUSES_K="kde"
72     IUSES_NK="-kde"
73    
74 ago 1.5 if [ -f /etc/portage/package.use ] ; then
75 dilfridge 1.10 die "Please save your package.use and re-create it as a directory"
76 ago 1.5 fi
77    
78 dilfridge 1.10 mkdir -p /etc/portage/package.use/ || die
79 scarabeus 1.1
80 dilfridge 1.10 mkdir -p "${MYPKGDIR}"
81 ago 1.6 if [ -z "${MYPKGDIR}" -o ! -d "${MYPKGDIR}" ] ; then
82     die "Anything goes wrong"
83     fi
84 ago 1.5
85 scarabeus 1.1 # compile the flavor
86     echo "Base"
87 ago 1.6 echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_NJ} ${IUSES_NG} ${IUSES_NK}" > ${USEFILE}
88 ago 1.11 FEATURES="${FEATURES} splitdebug" CFLAGS="${MYFLAGS}" CXXFLAGS="${MYFLAGS}" emerge ${OPTS} =libreoffice-${VERSION} || die "emerge failed"
89 scarabeus 1.1 quickpkg libreoffice --include-config=y
90 dilfridge 1.16 mv ${MYPKGDIR}/app-office/libreoffice-${VERSION}.tbz2 ${MYTMPDIR}/libreoffice-base-${BINVERSION}.tbz2 || die "Moving package failed"
91 scarabeus 1.1
92     echo "Base - java"
93 ago 1.6 echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_J} ${IUSES_NG} ${IUSES_NK}" > ${USEFILE}
94 ago 1.11 FEATURES="${FEATURES} splitdebug" CFLAGS="${MYFLAGS}" CXXFLAGS="${MYFLAGS}" emerge ${OPTS} =libreoffice-${VERSION} || die "emerge failed"
95 scarabeus 1.1 quickpkg libreoffice --include-config=y
96 dilfridge 1.16 mv ${MYPKGDIR}/app-office/libreoffice-${VERSION}.tbz2 ${MYTMPDIR}/libreoffice-base-java-${BINVERSION}.tbz2 || die "Moving package failed"
97 scarabeus 1.1
98     # kde flavor
99     echo "KDE"
100 ago 1.6 echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_NJ} ${IUSES_NG} ${IUSES_K}" > ${USEFILE}
101 ago 1.11 FEATURES="${FEATURES} splitdebug" CFLAGS="${MYFLAGS}" CXXFLAGS="${MYFLAGS}" emerge ${OPTS} =libreoffice-${VERSION} || die "emerge failed"
102 scarabeus 1.1 quickpkg libreoffice --include-config=y
103 dilfridge 1.16 mv ${MYPKGDIR}/app-office/libreoffice-${VERSION}.tbz2 ${MYTMPDIR}/libreoffice-kde-${BINVERSION}.tbz2 || die "Moving package failed"
104 scarabeus 1.1
105     echo "KDE - java"
106 ago 1.6 echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_J} ${IUSES_NG} ${IUSES_K}" > ${USEFILE}
107 ago 1.11 FEATURES="${FEATURES} splitdebug" CFLAGS="${MYFLAGS}" CXXFLAGS="${MYFLAGS}" emerge ${OPTS} =libreoffice-${VERSION} || die "emerge failed"
108 scarabeus 1.1 quickpkg libreoffice --include-config=y
109 dilfridge 1.16 mv ${MYPKGDIR}/app-office/libreoffice-${VERSION}.tbz2 ${MYTMPDIR}/libreoffice-kde-java-${BINVERSION}.tbz2 || die "Moving package failed"
110 scarabeus 1.1
111     # gnome flavor
112     echo "Gnome"
113 ago 1.6 echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_NJ} ${IUSES_G} ${IUSES_NK}" > ${USEFILE}
114 ago 1.11 FEATURES="${FEATURES} splitdebug" CFLAGS="${MYFLAGS}" CXXFLAGS="${MYFLAGS}" emerge ${OPTS} =libreoffice-${VERSION} || die "emerge failed"
115 scarabeus 1.1 quickpkg libreoffice --include-config=y
116 dilfridge 1.16 mv ${MYPKGDIR}/app-office/libreoffice-${VERSION}.tbz2 ${MYTMPDIR}/libreoffice-gnome-${BINVERSION}.tbz2 || die "Moving package failed"
117 scarabeus 1.1
118     echo "Gnome -java"
119 ago 1.6 echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_J} ${IUSES_G} ${IUSES_NK}" > ${USEFILE}
120 ago 1.11 FEATURES="${FEATURES} splitdebug" CFLAGS="${MYFLAGS}" CXXFLAGS="${MYFLAGS}" emerge ${OPTS} =libreoffice-${VERSION} || die "emerge failed"
121 scarabeus 1.1 quickpkg libreoffice --include-config=y
122 dilfridge 1.16 mv ${MYPKGDIR}/app-office/libreoffice-${VERSION}.tbz2 ${MYTMPDIR}/libreoffice-gnome-java-${BINVERSION}.tbz2 || die "Moving package failed"
123 dilfridge 1.2
124 dilfridge 1.16 cd ${MYTMPDIR}
125 dilfridge 1.2
126 ago 1.5 for name in ./libreoffice-*-${BINVERSION}.tbz2 ; do
127 dilfridge 1.2
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 ago 1.6 tar cfvJ ../../$ARCH-bin-$BN.tar.xz --owner root --group root ./*
143 dilfridge 1.2
144     echo "Re-packing debug info"
145     cd ../p2
146 ago 1.6 tar cfvJ ../../$ARCH-debug-$BN.tar.xz --owner root --group root ./*
147 dilfridge 1.2
148     echo "Removing unpacked files"
149     cd ../..
150     rm -rf tmp.lo
151 scarabeus 1.1
152 dilfridge 1.16 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 dilfridge 1.2 echo "Done with $BN.tbz2"
160 scarabeus 1.1
161 dilfridge 1.2 done
162 ago 1.6
163 dilfridge 1.10 rm -f ${USEFILE} || die "Removing ${USEFILE} failed"

  ViewVC Help
Powered by ViewVC 1.1.20