summaryrefslogtreecommitdiff
blob: 41ce83f51a067259430fe55140b6590834030d4c (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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
# Copyright 1999-2004 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-office/openoffice-ximian-bin/openoffice-ximian-bin-1.1.52.ebuild,v 1.4 2004/06/02 02:32:17 agriffis Exp $

inherit rpm

OO_VER=1.1.1
INSTDIR="/opt/Ximian-OpenOffice"
S="${WORKDIR}/usr"
DESCRIPTION="Ximian-ized version of OpenOffice.org, a full office productivity suite."
SRC_URI="ftp://ftp.ximian.com/pub/xd-unstable/suse-90-i586/ooo-1.1.1-0.ximian.8.1.1.snap.1.1.52.1.i586.rpm
	ftp://ftp.ximian.com/pub/xd-unstable/suse-90-i586/ooo-fonts-1.1.3-0.ximian.8.2.noarch.rpm"

HOMEPAGE="http://ooo.ximian.com"
LICENSE="LGPL-2 | SISSL-1.1"
SLOT="0"
KEYWORDS="~x86"
IUSE="gnome kde"

RDEPEND=">=sys-libs/glibc-2.1
	!=sys-libs/glibc-2.3.1*
	>=dev-lang/perl-5.0
	>=x11-libs/gtk+-2.0
	>=gnome-base/libgnome-2.2
	>=gnome-base/gnome-vfs-2.0
	>=net-print/libgnomecups-0.1.4
	>=net-print/gnome-cups-manager-0.16
	>=dev-libs/libxml2-2.0
	>=media-libs/libart_lgpl-2.3.13
	>=x11-libs/startup-notification-0.5
	media-fonts/ttf-bitstream-vera
	media-libs/fontconfig
	media-libs/libpng
	sys-devel/flex
	sys-devel/bison
	virtual/x11
	app-arch/zip
	app-arch/unzip
	dev-libs/expat
	net-libs/linc
	!app-office/openoffice-ximian
	virtual/lpr
	ppc? ( >=sys-libs/glibc-2.2.5-r7
	>=sys-devel/gcc-3.2.1 )
	>=media-libs/freetype-2.1.4"

DEPEND="${RDEPEND}
	dev-util/intltool"

src_unpack() {
	rpm_src_unpack
}

src_install() {

	# Sandbox issues; bug #11838
	addpredict "/user"
	addpredict "/share"
	addpredict "/dev/dri"
	addpredict "/usr/bin/soffice"
	addpredict "/pspfontcache"

	# Autoresponse file for main installation
	cat > ${T}/rsfile-global <<-"END_RS"
		[ENVIRONMENT]
		INSTALLATIONMODE=INSTALL_NETWORK
		INSTALLATIONTYPE=STANDARD
		DESTINATIONPATH=<destdir>
		OUTERPATH=
		LOGFILE=
		LANGUAGELIST=<LANGUAGE>

		[JAVA]
		JavaSupport=preinstalled_or_none
	END_RS

	# Autoresponse file for user installation
	cat > ${T}/rsfile-local <<-"END_RS"
		[ENVIRONMENT]
		INSTALLATIONMODE=INSTALL_WORKSTATION
		INSTALLATIONTYPE=WORKSTATION
		DESTINATIONPATH=<home>/.xopenoffice/<pv>

		[JAVA]
		JavaSupport=none
	END_RS

	# Fixing install location in response file
	sed -e "s|<destdir>|${D}${INSTDIR}|" \
		${T}/rsfile-global > ${T}/autoresponse

	einfo "Installing Ximian-OpenOffice.org into build root..."
	dodir ${INSTDIR}
	cd ${S}/lib/ooo-1.1
	cp -R * ${D}${INSTDIR}

	#Fix for parallel install
	sed -i -e s/sversionrc/xversionrc/g ${D}${INSTDIR}/program/bootstraprc ${D}${INSTDIR}/program/instdb.ins

	echo
	einfo "Removing build root from registry..."
	# Remove totally useless stuff.
	rm -f ${D}${INSTDIR}/program/{setup.log,sopatchlevel.sh}
	# Remove build root from registry and co
	egrep -rl "${D}" ${D}${INSTDIR}/* | \
		xargs -i perl -pi -e "s|${D}||g" {} || :

	einfo "Fixing permissions..."
	# Fix permissions
	find ${D}${INSTDIR}/ -type f -exec chmod a+r {} \;
	chmod a+x ${D}${INSTDIR}/share/config/webcast/*.pl
	find ${D}${INSTDIR}/ -type d -exec chmod a+rx {} \;

	# Fix symlinks
	dosym program/setup ${INSTDIR}/setup

	# Install user autoresponse file
	insinto /etc/ximian-openoffice
	sed -e "s|<pv>|${OO_VER}|g" ${T}/rsfile-local > ${T}/autoresponse-${OO_VER}.conf
	doins ${T}/autoresponse-${OO_VER}.conf

	# Install wrapper script
	exeinto /usr/bin
	sed -e "s|<pv>|${OO_VER}|g" \
		${FILESDIR}/${OO_VER}/xooffice-wrapper-1.3 > ${T}/xooffice
	doexe ${T}/xooffice

	# Component symlinks
	for app in calc draw impress html math writer setup; do
		dosym xooffice /usr/bin/xoo${app}
	done

	# Install ximian icons
	cd ${S}/share/pixmaps
	insinto /usr/share/pixmaps
	doins *.png

	cd ${S}/share/gnome/ximian/applications/
	rm -f *1.1*
	sed -i -e s/'=oo'/'=xoo'/g *.desktop

	einfo "Installing Menu shortcuts and mime info (need \"gnome\" or \"kde\" in USE)..."
	if use gnome
	then
		insinto /usr/share/applications
		doins *.desktop
		insinto /usr/share/application-registry
		doins ${FILESDIR}/${OO_VER}/ximian-openoffice.applications
		insinto /usr/share/mime-info
		doins ${FILESDIR}/${OO_VER}/ximian-openoffice.keys
	fi

	if use kde
	then
		insinto /usr/share/applnk/Ximian-OpenOffice.org
		doins *.desktop
	fi

	# Install corrected Symbol Font
	insinto /usr/X11R6/lib/X11/fonts/truetype/
	doins ${S}/share/fonts/default/TrueType/symbol/*.ttf

	# Install missing Dictionary installer
	insinto ${INSTDIR}/share/dict/ooo
	doins ${FILESDIR}/${OO_VER}/DicOOo.sxw

	# Remove unneeded stuff
	rm -rf ${D}${INSTDIR}/share/cde

	# Make sure these do not get nuked.
	keepdir ${INSTDIR}/user/registry/res/en-us/org/openoffice/{Office,ucb}
	keepdir ${INSTDIR}/user/psprint/{driver,fontmetric}
	keepdir ${INSTDIR}/user/{autocorr,backup,plugin,store,temp,template}
}

pkg_postinst() {

	einfo "******************************************************************"
	einfo " To start Ximian-OpenOffice.org, run:"
	einfo
	einfo "   $ xooffice"
	einfo
	einfo " Also, for individual components, you can use any of:"
	einfo
	einfo "   xoocalc, xoodraw, xooimpress, xoomath, xooweb or xoowriter"
	einfo
	einfo "******************************************************************"
	einfo
	einfo "******************************************************************"
	einfo " If you are upgrading from an older Ximian-OpenOffice.org"
	einfo " you will have to redo your settings."
	einfo
	einfo "******************************************************************"
}