rpms/openoffice.org-voikko/F-7 openoffice.org-voikko.spec,1.1,1.2
Ville-Pekka Vainio (vpv)
fedora-extras-commits at redhat.com
Mon Feb 11 23:02:22 UTC 2008
Author: vpv
Update of /cvs/pkgs/rpms/openoffice.org-voikko/F-7
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv9131
Modified Files:
openoffice.org-voikko.spec
Log Message:
Fix the severely broken package
Index: openoffice.org-voikko.spec
===================================================================
RCS file: /cvs/pkgs/rpms/openoffice.org-voikko/F-7/openoffice.org-voikko.spec,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- openoffice.org-voikko.spec 23 Jan 2008 19:26:54 -0000 1.1
+++ openoffice.org-voikko.spec 11 Feb 2008 23:01:48 -0000 1.2
@@ -1,6 +1,6 @@
Name: openoffice.org-voikko
Version: 2.1
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: Finnish spellchecker and hyphenator extension for OpenOffice.org
Group: Applications/Productivity
@@ -9,16 +9,21 @@
Source0: http://downloads.sourceforge.net/voikko/%{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
-BuildRequires: openoffice.org-sdk >= 2.0.4 libvoikko-devel >= 1.5
+BuildRequires: openoffice.org-sdk >= 2.0.4 libvoikko-devel >= 1.5
Requires(pre): openoffice.org-core
Requires(post): openoffice.org-core
Requires(preun): openoffice.org-core
Requires(postun): openoffice.org-core
-Requires: openoffice.org-core >= 2.0.4 libvoikko >= 1.5
+Requires: openoffice.org-core >= 2.0.4 libvoikko >= 1.5
%define oo2_sdk %{_libdir}/openoffice.org/sdk
%define oo2 %{_libdir}/openoffice.org
%define unopkg %{oo2}/program/unopkg
+%define voikkodir %{_libdir}/%{name}
+%define voikkoext %{_libdir}/%{name}/voikko.oxt
+
+# Can't make debug package as long as we need to install the .oxt file
+%define debug_package %{nil}
%description
This package contains a Finnish spell-checking and hyphenation component for
@@ -40,29 +45,53 @@
cd build
voikkoPackage=$(pwd)/voikko.oxt;
# OOo extension
-install -d -m 755 $RPM_BUILD_ROOT%{_libdir}/voikko.uno.pkg
-unzip "$voikkoPackage" -d $RPM_BUILD_ROOT%{_libdir}/voikko.uno.pkg
+install -d -m 755 $RPM_BUILD_ROOT%{voikkodir}
+install -p -m 644 "$voikkoPackage" $RPM_BUILD_ROOT%{voikkodir}
+
+# The TMP_HOME trick is taken from the Debian scripts by Teemu Likonen:
+# Registering program 'unopkg' writes things to $HOME/.openoffice* directory
+# (even with the '--shared' option). We must set $HOME to some temporary
+# directory so that these (root owned) files don't get written to the regular
+# user's HOME in case he/she runs this with sudo.
%pre
if [ $1 -gt 1 ]; then
# Upgrade => deregister old extension
- %{unopkg} remove --shared org.puimula.ooovoikko -env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1 || :
+ TMP_HOME="$(mktemp -t -d %{name}.XXXXXX)" || exit 1
+ export HOME="$TMP_HOME"
+ # Clean up after a broken package version which left a broken package in
+ # unopkg
+ if %{unopkg} list --shared | grep -q 'Identifier: org.openoffice.legacy.voikko.uno.pkg'
+ then
+ %{unopkg} remove --shared org.openoffice.legacy.voikko.uno.pkg -env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1 || :
+ else
+ %{unopkg} remove --shared org.puimula.ooovoikko -env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1 || :
+ fi
+ rm -rf "$TMP_HOME"
fi
%post
# register extension
- %{unopkg} add --shared %{_libdir}/voikko.uno.pkg -env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1 || :
+ TMP_HOME="$(mktemp -t -d %{name}.XXXXXX)" || exit 1
+ export HOME="$TMP_HOME"
+ %{unopkg} add --shared %{voikkoext} -env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1 || :
+ rm -rf "$TMP_HOME"
%preun
if [ $1 -eq 0 ]; then
# not upgrading => deregister
+ TMP_HOME="$(mktemp -t -d %{name}.XXXXXX)" || exit 1
+ export HOME="$TMP_HOME"
%{unopkg} remove --shared org.puimula.ooovoikko -env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1 || :
+ rm -rf "$TMP_HOME"
fi
%postun
# clear disk cache
+ TMP_HOME="$(mktemp -t -d %{name}.XXXXXX)" || exit 1
+ export HOME="$TMP_HOME"
%{unopkg} list --shared -env:JFW_PLUGIN_DO_NOT_CHECK_ACCESSIBILITY=1 > /dev/null 2>&1 || :
-
+ rm -rf "$TMP_HOME"
%clean
@@ -71,11 +100,20 @@
%files
%defattr(-,root,root,-)
-%{_libdir}/voikko.uno.pkg
+%{voikkodir}
%doc ChangeLog COPYING README
%changelog
+* Tue Feb 12 2008 Ville-Pekka Vainio <vpivaini AT cs.helsinki.fi> - 2.1-2
+- Install the .oxt file, don't unzip it, unzipped extensions work only in
+ Rawhide currently
+- Install to /usr/lib/openoffice.org-voikko/ for now
+- Clean up after the previous broken package
+- Set $HOME to be a temporary directory while using unopkg. Otherwise unopkg
+ causes problems if the package is installed with sudo
+- Disable debuginfo package as long as we must install the .oxt file
+
* Wed Jan 23 2008 Ville-Pekka Vainio <vpivaini AT cs.helsinki.fi> - 2.1-1
- Bump release for the initial Fedora build
More information about the fedora-extras-commits
mailing list