/[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.6 - (hide annotations) (download) (as text)
Sun Nov 18 12:02:01 2012 UTC (2 years ago) by ago
Branch: MAIN
Changes since 1.5: +59 -26 lines
File MIME type: text/x-sh
new version of the script

(Portage version: 2.1.11.31/cvs/Linux x86_64, unsigned Manifest commit)

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 ago 1.6 IUSES_BASE="bash-completion -binfilter branding cups dbus graphite gstreamer gtk nsplugin python vba webdav xmlsec -aqua -jemalloc -mysql -nlpsolver -odk -opengl -pdfimport -postgres -svg"
48 scarabeus 1.1
49     # now for the options
50     IUSES_J="java"
51     IUSES_NJ="-java"
52     IUSES_G="gnome eds"
53     IUSES_NG="-gnome -eds"
54     IUSES_K="kde"
55     IUSES_NK="-kde"
56    
57 ago 1.5 if [ -f /etc/portage/package.use ] ; then
58 ago 1.6 die "Please save your package.use and make it as a directory"
59 ago 1.5 fi
60    
61 scarabeus 1.1 mkdir -p /etc/portage/package.use/
62    
63 ago 1.6 if [ -z "${MYPKGDIR}" -o ! -d "${MYPKGDIR}" ] ; then
64     die "Anything goes wrong"
65     fi
66 ago 1.5
67 scarabeus 1.1 # compile the flavor
68     echo "Base"
69 ago 1.6 echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_NJ} ${IUSES_NG} ${IUSES_NK}" > ${USEFILE}
70     CFLAGS="${MYFLAGS}" CXXFLAGS="${MYFLAGS}" emerge ${OPTS} =libreoffice-${VERSION} || die "emerge failed"
71 scarabeus 1.1 quickpkg libreoffice --include-config=y
72 ago 1.5 mv ${MYPKGDIR}/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-base-${BINVERSION}.tbz2 || die "Moving package failed"
73 scarabeus 1.1
74     echo "Base - java"
75 ago 1.6 echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_J} ${IUSES_NG} ${IUSES_NK}" > ${USEFILE}
76     CFLAGS="${MYFLAGS}" CXXFLAGS="${MYFLAGS}" emerge ${OPTS} =libreoffice-${VERSION} || die "emerge failed"
77 scarabeus 1.1 quickpkg libreoffice --include-config=y
78 ago 1.5 mv ${MYPKGDIR}/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-base-java-${BINVERSION}.tbz2 || die "Moving package failed"
79 scarabeus 1.1
80     # kde flavor
81     echo "KDE"
82 ago 1.6 echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_NJ} ${IUSES_NG} ${IUSES_K}" > ${USEFILE}
83     CFLAGS="${MYFLAGS}" CXXFLAGS="${MYFLAGS}" emerge ${OPTS} =libreoffice-${VERSION} || die "emerge failed"
84 scarabeus 1.1 quickpkg libreoffice --include-config=y
85 ago 1.5 mv ${MYPKGDIR}/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-kde-${BINVERSION}.tbz2 || die "Moving package failed"
86 scarabeus 1.1
87     echo "KDE - java"
88 ago 1.6 echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_J} ${IUSES_NG} ${IUSES_K}" > ${USEFILE}
89     CFLAGS="${MYFLAGS}" CXXFLAGS="${MYFLAGS}" emerge ${OPTS} =libreoffice-${VERSION} || die "emerge failed"
90 scarabeus 1.1 quickpkg libreoffice --include-config=y
91 ago 1.5 mv ${MYPKGDIR}/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-kde-java-${BINVERSION}.tbz2 || die "Moving package failed"
92 scarabeus 1.1
93     # gnome flavor
94     echo "Gnome"
95 ago 1.6 echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_NJ} ${IUSES_G} ${IUSES_NK}" > ${USEFILE}
96     CFLAGS="${MYFLAGS}" CXXFLAGS="${MYFLAGS}" emerge ${OPTS} =libreoffice-${VERSION} || die "emerge failed"
97 scarabeus 1.1 quickpkg libreoffice --include-config=y
98 ago 1.5 mv ${MYPKGDIR}/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-gnome-${BINVERSION}.tbz2 || die "Moving package failed"
99 scarabeus 1.1
100     echo "Gnome -java"
101 ago 1.6 echo "app-office/libreoffice ${IUSES_BASE} ${IUSES_J} ${IUSES_G} ${IUSES_NK}" > ${USEFILE}
102     CFLAGS="${MYFLAGS}" CXXFLAGS="${MYFLAGS}" emerge ${OPTS} =libreoffice-${VERSION} || die "emerge failed"
103 scarabeus 1.1 quickpkg libreoffice --include-config=y
104 ago 1.5 mv ${MYPKGDIR}/app-office/libreoffice-${VERSION}.tbz2 ./libreoffice-gnome-java-${BINVERSION}.tbz2 || die "Moving package failed"
105 dilfridge 1.2
106    
107 ago 1.5 for name in ./libreoffice-*-${BINVERSION}.tbz2 ; do
108 dilfridge 1.2
109     BN=`basename $name .tbz2`
110    
111     rm -rf tmp.lo
112     mkdir -vp tmp.lo/p1 tmp.lo/p2
113     cd tmp.lo/p1
114    
115     echo "Unpacking complete archive $BN.tbz2"
116     tar xfvjp ../../$BN.tbz2
117    
118     echo "Moving debug info"
119     mkdir -vp ../p2/usr/lib
120     mv -v usr/lib/debug ../p2/usr/lib/
121    
122     echo "Re-packing program"
123 ago 1.6 tar cfvJ ../../$ARCH-bin-$BN.tar.xz --owner root --group root ./*
124 dilfridge 1.2
125     echo "Re-packing debug info"
126     cd ../p2
127 ago 1.6 tar cfvJ ../../$ARCH-debug-$BN.tar.xz --owner root --group root ./*
128 dilfridge 1.2
129     echo "Removing unpacked files"
130     cd ../..
131     rm -rf tmp.lo
132 scarabeus 1.1
133 dilfridge 1.2 echo "Done with $BN.tbz2"
134 scarabeus 1.1
135 dilfridge 1.2 done
136 ago 1.6
137     rm -fr ${USEFILE}
138    
139     rm -fr libreoffice*${VERSION}*.tbz2

  ViewVC Help
Powered by ViewVC 1.1.20