/[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.7 - (hide annotations) (download) (as text)
Sun Nov 18 12:07:28 2012 UTC (22 months, 1 week ago) by dilfridge
Branch: MAIN
Changes since 1.6: +12 -1 lines
File MIME type: text/x-sh
Add extension handling

(Portage version: 2.2.0_alpha142/cvs/Linux x86_64, signed Manifest commit with key B6C5F7DE)

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

  ViewVC Help
Powered by ViewVC 1.1.20