summaryrefslogtreecommitdiffstats
path: root/libreoffice/Pkgfile
blob: e87e84fce514eb2393208ac19c8bb01cfeb7dbbb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
# Description: Suite pour le bureau libre
# URL: http://www.libreoffice.org
# Maintainer: cgit.freedesktop.org/libreoffice/core
# Packager: thierryn1 at hispeed dot ch
# Depends on: cups, curl, gperf, gtk, gtk3, p5-archive-zip, p5-xml-parser, boost, expat, gst-plugins-base, libgsf, librsvg, libxml2, libxslt, neon, nss, poppler, libpostgresql, redland, icu, hunspell, gsfonts, dejavu-ttf
# Run on: cups,curl,gperf,gtk,gtk3,expat,gst-plugins-base,libgsf,librsvg,libxslt,neon,nss,poppler,libpostgresql,redland,icu,hunspell

name=libreoffice
version=3.5.2.2
release=1
source=(http://download.documentfoundation.org/libreoffice/src/3.5.2/$name-core-$version.tar.xz 
			http://download.documentfoundation.org/libreoffice/src/3.5.2/$name-dictionaries-$version.tar.xz
			http://download.documentfoundation.org/libreoffice/src/3.5.2/$name-help-$version.tar.xz
			http://download.documentfoundation.org/libreoffice/src/3.5.2/$name-translations-$version.tar.xz )
build() {

	rm -r $name-translations-$version
	rm -r $name-help-$version
	rm -r $name-dictionaries-$version
	cd $name-core-$version
	tar -xf $PKGMK_SOURCE_DIR/$name-translations-$version.tar.xz --strip-components=1
	tar -xf $PKGMK_SOURCE_DIR/$name-help-$version.tar.xz --strip-components=1
	tar -xf $PKGMK_SOURCE_DIR/$name-dictionaries-$version.tar.xz --strip-components=1
	sed -i '/$Prepend/s:^[^#]:# &:' \
	i18npool/source/breakiterator/data/char{,_in}.txt
	./autogen.sh --prefix=/usr \
	--disable-binfilter      \
	--disable-gconf          \
	--disable-mozilla        \
	--disable-odk            \
	--with-system-boost      \
	--with-system-cairo      \
	--with-system-curl       \
	--with-system-db         \
	--with-system-expat      \
	--with-system-hunspell   \
	--with-system-icu        \
	--with-system-jpeg       \
	--with-system-libpng     \
	--with-system-libxml     \
	--with-system-neon       \
	--with-system-nss        \
	--with-system-openssl    \
	--with-system-poppler    \
	--with-system-postgresql \
	--with-system-redland    \
	--with-system-zlib       \
	--with-num-cpus=$(getconf _NPROCESSORS_ONLN) \
	--with-lang="fr"      \
	--without-java
	./download
	mkdir -p ../libre-office-downloads 
	cp -rf src/* ../libre-office-downloads
	make
	make DESTDIR=$PKG install
	# Nettoyages des fichiers inutiles
	mkdir -p $SRC/tmp
	mv $PKG/* $SRC/tmp
	mv $SRC/tmp/usr $PKG/
	# Lanceurs
	mkdir -p $PKG/usr/bin
	for program in base calc draw impress math writer
	do
		echo '#!/bin/bash' > $PKG/usr/bin/${program}
	done
	for program in base calc draw impress math writer
	do
		echo "exec /usr/lib/libreoffice/program/soffice --nologo --${program} \"\${@}\"" >> $PKG/usr/bin/${program}
		chmod 755 $PKG/usr/bin/${program}
	done
	# Icones
	for res in 16 32 48 128 256
	do
		mkdir -p $PKG/usr/share/icons/hicolor/${res}x${res}/{apps,mimetypes}
		cp sysui/desktop/icons/hicolor/${res}x${res}/apps/*.png \
		$PKG/usr/share/icons/hicolor/${res}x${res}/apps
		cp sysui/desktop/icons/hicolor/${res}x${res}/mimetypes/*.png \
		$PKG/usr/share/icons/hicolor/${res}x${res}/mimetypes
	done

	# les liens
	ln -s ../lib/libreoffice/program/spadmin $PKG/usr/bin/printeradmin
	ln -s ../lib/libreoffice/program/unopkg $PKG/usr/bin

	# Manuels
	mkdir -p $PKG/usr/share/man/man1
	cp -v sysui/desktop/man/{libreoffice,unopkg}.1 \
	$PKG/usr/share/man/man1/

	# Les lançeurs graphiques
	mkdir -p $PKG/usr/share/applications
	for program in base calc draw impress math writer
	do echo "[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=${program^}
Comment=Libre Office ${program^}
Icon=${program}
Exec=${program}
Categories=Office;Application;
StartupNotify=true
Terminal=false" > $PKG/usr/share/applications/${program}.desktop
	done
echo "[Desktop Entry]
Encoding=UTF-8
Type=Application
Name=Printer Administration
Comment=Libre Office Printer Administration
Icon=printeradmin
Exec=printeradmin
Categories=Office;Printing;Application;
StartupNotify=true
Terminal=false" > $PKG/usr/share/applications/printeradmin.desktop
}