/[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.13 - (hide annotations) (download) (as text)
Sat Jul 13 18:44:04 2013 UTC (14 months ago) by dilfridge
Branch: MAIN
Changes since 1.12: +3 -3 lines
File MIME type: text/x-sh
Minor adaptions to build script

(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 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 dilfridge 1.10 die "Arch $( uname -m ) not supported"
28 ago 1.6 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 dilfridge 1.10 die "Missing some basic utility in your system"
43 ago 1.6 fi
44     done
45 scarabeus 1.1
46     # first the default subset of useflags
47 dilfridge 1.13 IUSES_BASE="bash-completion branding cups dbus gstreamer gtk opengl vba webdav -aqua -binfilter -bluetooth -debug -jemalloc -mysql -odk -postgres -telepathy"
48 dilfridge 1.7
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 scarabeus 1.9 IUSES_J="java libreoffice_extensions_nlpsolver"
62 scarabeus 1.1 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 dilfridge 1.10 die "Please save your package.use and re-create it as a directory"
70 ago 1.5 fi
71    
72 dilfridge 1.10 mkdir -p /etc/portage/package.use/ || die
73 scarabeus 1.1
74 dilfridge 1.10 mkdir -p "${MYPKGDIR}"
75 ago 1.6 if [ -z "${MYPKGDIR}" -o ! -d "${MYPKGDIR}" ] ; then
76     die "Anything goes wrong"
77     fi
78 ago 1.5
79 scarabeus 1.1 # compile the flavor
80     echo "Base"
81 ago 1.6 echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_NJ} ${IUSES_NG} ${IUSES_NK}" > ${USEFILE}
82 ago 1.11 FEATURES="${FEATURES} splitdebug" CFLAGS="${MYFLAGS}" CXXFLAGS="${MYFLAGS}" emerge ${OPTS} =libreoffice-${VERSION} || die "emerge failed"
83 scarabeus 1.1 quickpkg libreoffice --include-config=y
84 ago 1.5 mv ${MYPKGDIR}/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-base-${BINVERSION}.tbz2 || die "Moving package failed"
85 scarabeus 1.1
86     echo "Base - java"
87 ago 1.6 echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_J} ${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 ago 1.5 mv ${MYPKGDIR}/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-base-java-${BINVERSION}.tbz2 || die "Moving package failed"
91 scarabeus 1.1
92     # kde flavor
93     echo "KDE"
94 ago 1.6 echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_NJ} ${IUSES_NG} ${IUSES_K}" > ${USEFILE}
95 ago 1.11 FEATURES="${FEATURES} splitdebug" CFLAGS="${MYFLAGS}" CXXFLAGS="${MYFLAGS}" emerge ${OPTS} =libreoffice-${VERSION} || die "emerge failed"
96 scarabeus 1.1 quickpkg libreoffice --include-config=y
97 ago 1.5 mv ${MYPKGDIR}/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-kde-${BINVERSION}.tbz2 || die "Moving package failed"
98 scarabeus 1.1
99     echo "KDE - java"
100 ago 1.6 echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_J} ${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 ago 1.5 mv ${MYPKGDIR}/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-kde-java-${BINVERSION}.tbz2 || die "Moving package failed"
104 scarabeus 1.1
105     # gnome flavor
106     echo "Gnome"
107 ago 1.6 echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_NJ} ${IUSES_G} ${IUSES_NK}" > ${USEFILE}
108 ago 1.11 FEATURES="${FEATURES} splitdebug" CFLAGS="${MYFLAGS}" CXXFLAGS="${MYFLAGS}" emerge ${OPTS} =libreoffice-${VERSION} || die "emerge failed"
109 scarabeus 1.1 quickpkg libreoffice --include-config=y
110 ago 1.5 mv ${MYPKGDIR}/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-gnome-${BINVERSION}.tbz2 || die "Moving package failed"
111 scarabeus 1.1
112     echo "Gnome -java"
113 ago 1.6 echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_J} ${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 ago 1.5 mv ${MYPKGDIR}/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-gnome-java-${BINVERSION}.tbz2 || die "Moving package failed"
117 dilfridge 1.2
118    
119 ago 1.5 for name in ./libreoffice-*-${BINVERSION}.tbz2 ; do
120 dilfridge 1.2
121     BN=`basename $name .tbz2`
122    
123     rm -rf tmp.lo
124     mkdir -vp tmp.lo/p1 tmp.lo/p2
125     cd tmp.lo/p1
126    
127     echo "Unpacking complete archive $BN.tbz2"
128     tar xfvjp ../../$BN.tbz2
129    
130     echo "Moving debug info"
131     mkdir -vp ../p2/usr/lib
132     mv -v usr/lib/debug ../p2/usr/lib/
133    
134     echo "Re-packing program"
135 ago 1.6 tar cfvJ ../../$ARCH-bin-$BN.tar.xz --owner root --group root ./*
136 dilfridge 1.2
137     echo "Re-packing debug info"
138     cd ../p2
139 ago 1.6 tar cfvJ ../../$ARCH-debug-$BN.tar.xz --owner root --group root ./*
140 dilfridge 1.2
141     echo "Removing unpacked files"
142     cd ../..
143     rm -rf tmp.lo
144 scarabeus 1.1
145 dilfridge 1.2 echo "Done with $BN.tbz2"
146 scarabeus 1.1
147 dilfridge 1.2 done
148 ago 1.6
149 dilfridge 1.10 rm -f ${USEFILE} || die "Removing ${USEFILE} failed"
150 ago 1.6
151 dilfridge 1.10 rm -f libreoffice*${VERSION}*.tbz2 || die "Removing un-split package files failed"

  ViewVC Help
Powered by ViewVC 1.1.20