Browse Source

updated: Qt4, cmake, qca2, uim

git-svn-id: http://trac.vinelinux.org/repos/projects/specs@1442 ec354946-7b23-47d6-9f5a-488ba84defc7
inagaki 13 years ago
parent
commit
f000163df5
4 changed files with 266 additions and 92 deletions
  1. 9 5
      c/cmake/cmake-vl.spec
  2. 9 5
      q/qca2/qca2-vl.spec
  3. 92 28
      q/qt4/qt4-vl.spec
  4. 156 54
      u/uim/uim-vl.spec

+ 9 - 5
c/cmake/cmake-vl.spec

@@ -1,14 +1,15 @@
-Summary: Cross-platform make system
 Name: cmake
-Version: 2.6.4
-Release: 3%{?_dist_release}
-Source0: http://www.cmake.org/files/v2.6/%{name}-%{version}.tar.gz
-Source1: macros.cmake
+Summary: Cross-platform make system
+Version: 2.8.2
+Release: 1%{?_dist_release}
 
 License: Insight Consortium
 Group: Development/Tools
 URL: http://www.cmake.org/
 
+Source0: http://www.cmake.org/files/v2.8/%{name}-%{version}.tar.gz
+Source1: macros.cmake
+
 BuildRoot: %{_tmppath}/%{name}-%{version}-root
 
 Vendor: Project Vine
@@ -54,6 +55,9 @@ rm -rf $RPM_BUILD_ROOT
 %{_mandir}/man1/*
 
 %changelog
+* Sun Jul 25 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 2.8.2-1
+- new upstream release
+
 * Fri Feb 05 2010 Shu KONNO <owa@bg.wakwak.com> 2.6.4-3
 - rebuilt with new toolchain
 

+ 9 - 5
q/qca2/qca2-vl.spec

@@ -1,7 +1,7 @@
 Name:           qca2
-Version:        2.0.2
-Release:        5%{?_dist_release}
 Summary:        Qt Cryptographic Architecture
+Version:        2.0.2
+Release:        6%{?_dist_release}
 
 Group:          System Environment/Libraries
 License:        LGPLv2+
@@ -12,7 +12,8 @@ BuildRoot:      %{_tmppath}/%{name}-%{version}-root
 BuildRequires:  qt4-devel
 BuildRequires:  pkgconfig
 
-%define         qtver %(pkg-config --modversion %{_libdir}/pkgconfig/QtCore.pc)
+%define qt4_ver 4.6.3
+%define _qt4_version %(pkg-config --modversion --silence-errors Qt 2>/dev/null || echo %{qt4_ver})
 
 %description
 Taking a hint from the similarly-named Java Cryptography Architecture,
@@ -28,7 +29,7 @@ application!
 Summary:        Qt Cryptographic Architecture development files
 Group:          Development/Libraries
 Requires:       %{name} = %{version}-%{release}
-Requires:       qt4-devel = %{qtver}
+Requires:       qt4-devel = %{_qt4_version}
 Requires:       pkgconfig
 
 %description    devel
@@ -78,10 +79,13 @@ rm -rf $RPM_BUILD_ROOT
 %{_libdir}/*.so
 %{_libdir}/pkgconfig/qca2.pc
 %{_libdir}/libqca.prl
-%{_libdir}/qt-%{qtver}/mkspecs/features/crypto.prf
+%{_libdir}/qt-%{_qt4_version}/mkspecs/features/crypto.prf
 
 
 %changelog
+* Sat Jul 24 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> - 2.0.2-6
+- rebuilt with qt-4.6.3
+
 * Fri Feb 05 2010 Shu KONNO <owa@bg.wakwak.com> 2.0.2-5
 - rebuilt with new toolchain, qt4-4.6.1
 

+ 92 - 28
q/qt4/qt4-vl.spec

@@ -1,3 +1,5 @@
+%define _default_patch_fuzz 3 
+
 %define phonon 0
 %define MySQL 1
 %define PostgreSQL 1 
@@ -21,13 +23,12 @@
 %define _qt4_translationdir %{_datadir}/qt4/translations
 
 %define build_compat32 %{?_with_compat32:1}%{!?_with_compat32:0}
-%define platform linux-g++
 
 Summary: Qt toolkit
 Summary(ja): Qt ツールキット
 Name: qt4
-Version: 4.6.1
-Release: 5%{?_dist_release}
+Version: 4.6.3
+Release: 1%{?_dist_release}
 
 # See LGPL_EXCEPTIONS.txt, LICENSE.GPL3, respectively, for exception details
 License: LGPLv2 with exceptions or GPLv3 with exceptions
@@ -57,6 +58,7 @@ Source31: hi48-app-qt4-logo.png
 # multilib hacks 
 Patch2: qt-x11-opensource-src-4.2.2-multilib-optflags.patch
 Patch3: qt-x11-opensource-src-4.2.2-multilib-QMAKEPATH.patch
+Patch4: qt-everywhere-opensource-src-4.7.0-beta1-uic_multilib.patch
 Patch5: qt-all-opensource-src-4.4.0-rc1-as_IN-437440.patch
 # hack around gcc/ppc crasher, http://bugzilla.redhat.com/492185
 Patch13: qt-x11-opensource-src-4.5.0-gcc_hack.patch
@@ -67,20 +69,45 @@ Patch16: qt-x11-opensource-src-4.5.1-kde4_plugins.patch
 Patch17: qt-x11-opensource-src-4.5.2-pulseaudio.patch
 Patch19: qt-x11-opensource-src-4.5.1-phonon.patch
 Patch21: qt-everywhere-opensource-src-4.6.0-gst-pulsaudio.patch
+# may be upstreamable, not sure yet
+# workaround for gdal/grass crashers wrt glib_eventloop null deref's
+Patch23: qt-everywhere-opensource-src-4.6.3-glib_eventloop_nullcheck.patch
 
 ## upstreamable bits
 # http://bugzilla.redhat.com/485677
 Patch51: qt-everywhere-opensource-src-4.6.0-beta1-qdoc3.patch 
-Patch52: qt-4.5-sparc64.patch
 # fix invalid inline assembly in qatomic_{i386,x86_64}.h (de)ref implementations
 Patch53: qt-x11-opensource-src-4.5.0-fix-qatomic-inline-asm.patch
 # fix invalid assumptions about mysql_config --libs
 # http://bugzilla.redhat.com/440673
 Patch54: qt-x11-opensource-src-4.5.1-mysql_config.patch
-# http://bugreports.qt.nokia.com/browse/QTBUG-7255
-Patch55: http://bugreports.qt.nokia.com/secure/attachment/12488/konsole-nvidia-font-speed.diff
+# http://bugs.kde.org/show_bug.cgi?id=180051#c22
+Patch55: qt-everywhere-opensource-src-4.6.2-cups.patch
+# fix type cast issue on s390x
+Patch56: qt-everywhere-opensource-src-4.6.2-webkit-s390x.patch
+# fix type cast issue on sparc64
+Patch57: qt-everywhere-opensource-src-4.6.2-webkit-sparc64.patch
+# qtwebkit to search nspluginwrapper paths too
+Patch58: qt-everywhere-opensource-src-4.7.0-beta1-qtwebkit_pluginpath.patch
 
 # security patches
+# https://bugs.webkit.org/show_bug.cgi?id=40567
+Patch100: qt-everywhere-opensource-src-4.7.0-beta1-qtwebkit_gtk_init.patch
+Patch104: qt-everywhere-opensource-src-4.6.2-cve-2010-0051-lax-css-parsing-cross-domain-theft.patch
+Patch106: qt-everywhere-opensource-src-4.6.2-cve-2010-0656.patch
+Patch108: qt-everywhere-opensource-src-4.6.2-cve-2010-0648.patch
+Patch109: qt-everywhere-opensource-src-4.6.3-CVE-2010-1303_1304.patch
+Patch110: qt-everywhere-opensource-src-4.6.3-CVE-2010-1392.patch
+Patch111: qt-everywhere-opensource-src-4.6.3-CVE-2010-1396.patch
+Patch112: qt-everywhere-opensource-src-4.6.3-CVE-2010-1397.patch
+Patch113: qt-everywhere-opensource-src-4.6.3-CVE-2010-1398.patch
+Patch114: qt-everywhere-opensource-src-4.6.3-CVE-2010-1400.patch
+Patch115: qt-everywhere-opensource-src-4.6.3-CVE-2010-1412.patch
+Patch116: qt-everywhere-opensource-src-4.6.3-CVE-2010-1770.patch
+Patch117: qt-everywhere-opensource-src-4.6.3-CVE-2010-1773.patch
+Patch118: qt-everywhere-opensource-src-4.6.3-CVE-2010-1774.patch
+Patch119: qt-everywhere-opensource-src-4.6.3-CVE-2010-1119.patch
+Patch120: qt-everywhere-opensource-src-4.6.3-CVE-2010-1778.patch
 
 # kde-qt git patches
 Patch201: 0001-This-patch-uses-object-name-as-a-fallback-for-window.patch
@@ -92,12 +119,10 @@ Patch206: 0006-Fix-configure.exe-to-do-an-out-of-source-build-on-wi.patch
 Patch207: 0007-When-using-qmake-outside-qt-src-tree-it-sometimes-ge.patch
 Patch208: 0008-This-patch-makes-the-raster-graphics-system-use-shar.patch
 Patch209: 0009-Restore-a-section-of-the-file-that-got-removed-due-t.patch
-## older, but actually applies, version of patches 208, 209, 213 (double check)
-Patch274: 0274-shm-native-image-fix.patch
-Patch210: 0010-Fix-error-line-not-to-have-a-as-it-s-not-correct.patch
-Patch211: 0011-Fill-gap-of-X.org-XFree-multimedia-special-launcher-.patch
 Patch212: 0012-Add-context-to-tr-calls-in-QShortcut.patch
-Patch213: 0013-Fix-QNativeImage-constructor.patch
+Patch217: http://qt.gitorious.org/+kde-developers/qt/kde-qt/commit/55ef01d93f8257b5927660290fc1ead0b2b74ec9.patch
+# QTBUG-9793
+Patch218: http://qt.gitorious.org/qt/qt/commit/0ebc9783d8ca0c4b27208bbc002c53c52c19ab4c.patch
 
 # Vine Patches
 # use system ca-bundle certs, http://bugzilla.redhat.com/521911
@@ -291,6 +316,8 @@ toolkit.
 #if "%{_qt4_datadir}" != "%{_qt4_prefix}"
 #patch3 -p1 -b .multilib-QMAKEPATH
 #endif
+%patch4 -p1 -b .uic_multilib
+
 %patch5 -p1 -b .bz#437440-as_IN-437440
 %patch13 -p1 -b .gcc_hack
 %patch15 -p1 -b .enable_ft_lcdfilter
@@ -298,34 +325,49 @@ toolkit.
 %patch17 -p1 -b .phonon-pulseaudio
 %patch19 -p1 -b .servicesfile
 %patch21 -p1 -b .gst-pulsaudio
-#patch51 -p1 -b .qdoc3
-## FIXME: port patch
-#patch52 -p1 -b .sparc64
+%patch23 -p1 -b .glib_eventloop_nullcheck
+%patch51 -p1 -b .qdoc3
 ## TODO: still worth carrying?  if so, upstream it.
 %patch53 -p1 -b .qatomic-inline-asm
 ## TODO: upstream me
 %patch54 -p1 -b .mysql_config
-%patch55 -p0 -b .bitmap_font_speed
+%patch55 -p1 -b .cups-1
+%patch56 -p1 -b .typecast_s390x
+%patch57 -p1 -b .typecast_sparc64
+%patch58 -p1 -b .qtwebkit_pluginpath
+
+# upstream patches
+%patch100 -p1 -b .qtwebkit_gtk_init
 
 # security fixes
+%patch104 -p1 -b .cve-2010-0051-lax-css-parsing-cross-domain-theft
+%patch106 -p1 -b .cve-2010-0656
+%patch108 -p1 -b .cve-2010-0648
+%patch109 -p1 -b .CVE-2010-1303_1304
+%patch110 -p1 -b .CVE-2010-1392
+%patch111 -p1 -b .CVE-2010-1396
+%patch112 -p1 -b .CVE-2010-1397
+%patch113 -p1 -b .CVE-2010-1398
+%patch114 -p1 -b .CVE-2010-1400
+%patch115 -p1 -b .CVE-2010-1412
+%patch116 -p1 -b .CVE-2010-1770
+%patch117 -p1 -b .CVE-2010-1773
+%patch118 -p1 -b .CVE-2010-1774
+%patch119 -p1 -b .CVE-2010-1119
+%patch120 -p1 -b .CVE-2010-1778
+
 
 # kde-qt branch
-#patch201 -p1 -b .kde-qt-0001
+%patch201 -p1 -b .kde-qt-0001
 %patch202 -p1 -b .kde-qt-0002
 %patch203 -p1 -b .kde-qt-0003
 %patch204 -p1 -b .kde-qt-0004
 %patch205 -p1 -b .kde-qt-0005
 %patch206 -p1 -b .kde-qt-0006
 %patch207 -p1 -b .kde-qt-0007
-## needs manual love
-#patch208 -p1 -b .kde-qt-0008
-#patch209 -p1 -b .kde-qt-0009
-#patch274 -p1 -b .qt-copy-0274
-## already applied
-#patch210 -p1 -b .kde-qt-0010
-#patch211 -p1 -b .kde-qt-0011
 %patch212 -p1 -b .kde-qt-0012
-#patch213 -p1 -b .kde-qt-0013
+%patch217 -p1 -b .QT_GRAPHICSSYSTEM
+%patch218 -p1 -b .QTBUG-9793
 
 # Patches for Vine
 %patch1022 -p1 -b .system_ca_certificates
@@ -333,6 +375,18 @@ toolkit.
 # drop -fexceptions from $RPM_OPT_FLAGS
 RPM_OPT_FLAGS=`echo $RPM_OPT_FLAGS | sed 's|-fexceptions||g'`
 
+%define platform linux-g++
+
+# some 64bit platforms assume -64 suffix, https://bugzilla.redhat.com/569542
+%if "%{?__isa_bits}"  == "64"
+%define platform linux-g++-64                    
+%endif
+
+# https://bugzilla.redhat.com/478481
+%ifarch x86_64
+%define platform linux-g++
+%endif
+
 sed -i \
   -e "s|-O2|$RPM_OPT_FLAGS|g" \
   -e "s|g++.conf|g++-multilib.conf|g" mkspecs/%{platform}/qmake.conf
@@ -351,9 +405,9 @@ if [ "%{_lib}" == "lib64" ] ; then
 fi
 
 # let makefile create missing .qm files, the .qm files should be included in qt upstream
-for f in translations/*.ts ; do
-  touch ${f%.ts}.qm
-done
+#for f in translations/*.ts ; do
+#  touch ${f%.ts}.qm
+#done
 
 %build
 # build shared, threaded (default) libraries
@@ -434,7 +488,7 @@ done
 make %{?_smp_mflags}
 
 # recreate .qm files
-LD_LIBRARY_PATH=`pwd`/lib bin/lrelease translations/*.ts
+#LD_LIBRARY_PATH=`pwd`/lib bin/lrelease translations/*.ts
 
 %install
 rm -rf $RPM_BUILD_ROOT
@@ -703,6 +757,8 @@ fi
 %if "%{_qt4_libdir}" != "%{_libdir}"
 %config %{_sysconfdir}/ld.so.conf.d/qt4.conf
 %endif
+%{_bindir}/qdbus
+%{_qt4_bindir}/qdbus
 %{_libdir}/qt4
 %dir %{_qt4_prefix}
 %dir %{_qt4_libdir}
@@ -731,6 +787,8 @@ fi
 %attr(0755,root,root) %config /etc/profile.d/*
 %{_bindir}/*
 %{_qt4_bindir}/*
+%exclude %{_bindir}/qdbus
+%exclude %{_qt4_bindir}/qdbus
 %exclude %{_qt4_bindir}/designer
 %exclude %{_qt4_bindir}/linguist
 %exclude %{_qt4_bindir}/lrelease
@@ -809,6 +867,7 @@ fi
 %if "%{_qt4_libdir}" != "%{_libdir}"
 %config %{_sysconfdir}/ld.so.conf.d/qt4-i386.conf
 %endif
+%{_qt4_bindir}/qdbus
 %{_libdir}/qt4
 %dir %{_qt4_prefix}
 %dir %{_qt4_libdir}
@@ -835,6 +894,7 @@ fi
 %files -n compat32-%{name}-devel
 %defattr(-,root,root,-)
 %{_qt4_bindir}/*
+%exclude %{_qt4_bindir}/qdbus
 %exclude %{_qt4_bindir}/designer
 %exclude %{_qt4_bindir}/linguist
 %exclude %{_qt4_bindir}/lrelease
@@ -851,6 +911,10 @@ fi
 %endif
 
 %changelog
+* Sat Jul 24 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 4.6.3-1
+- new upstream release
+- moved %{_bindir}/qdbus to main package
+
 * Fri Feb 12 2010 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 4.6.1-5
 - rebuilt with gcc-4.4.3-3 on ppc
 

+ 156 - 54
u/uim/uim-vl.spec

@@ -9,36 +9,71 @@
 #define with_canna	%{?_without_canna:0}%{!?_without_canna:1}
 %define with_canna	0
 
-%define qtver 3.3.8
-%define qtdir %{_libdir}/qt-%{qtver}
+%define qt3_ver 3.3.8
+%define qt4_ver 4.6.1
+# Qt3 version auto-detection -- inagaki
+%define _qt3_version %(rpm -q --queryformat "%%{version}" qt-devel 2>/dev/null || echo %{qt3_ver})
+%define _qt3_prefix  %{_libdir}/qt-%{_qt3_version}
+%define _qt3_plugindir %{_qt3_prefix}/plugins
+
+# build qt4 immodule ("--without qt4" to disable qt4)
+%bcond_without qt4
+# Qt4 version auto-detection -- inagaki
+%define _qt4_version %(pkg-config --modversion --silence-errors Qt 2>/dev/null || echo %{qt4_ver})
+%define _qt4_prefix %(pkg-config --variable prefix --silence-errors Qt 2>/dev/null || echo %{_libdir}/qt-%{qt4_ver})
+%define _qt4_plugindir %(pkg-config --variable plugindir --silence-errors Qt 2>/dev/null || echo %{_qt4_prefix}/plugins)
 
 #%%define extraver beta
 
+Name: uim
 Summary: Uim an input method library
 Summary(ja): uim - 入力メソッドライブラリ
-Name: uim
-Version: 1.5.6
-Release: 5%{?_dist_release}
+Version: 1.5.7
+Release: 1%{?_dist_release}
+
+License: LGPLv2/BSD
+Group: System Environment/Libraries
 URL: http://code.google.com/p/uim/
+
 Source0: http://uim.googlecode.com/files/uim-%{version}%{?extraver:-%extraver}.tar.bz2
 Source1: uim-el-install.sh
 Source2: uim-el-remove.sh
 Source3: uim-update-installed-modules.sh.in
-License: LGPLv2/BSD
-Group: System Environment/Libraries
+# Bug 24728
+Patch0: uim-1.5.7-qt4.patch
 
 BuildRoot: %{_tmppath}/%{name}-%{version}-root
 BuildRequires: libXft-devel libX11-devel libXext-devel 
 BuildRequires: libXrender-devel libXau-devel libXdmcp-devel libXt-devel
-BuildRequires: gtk2-devel gnome-panel qt-devel qt4-devel
-BuildRequires: ncurses-devel libgnomeui-devel
+BuildRequires: gtk2-devel 
+BuildRequires: ncurses-devel
 BuildRequires: anthy-devel m17n-lib-devel eb-devel
 BuildRequires: gettext-devel desktop-file-utils
-#BuildRequires: emacs libtool automake autoconf intltool
+%if %{with_qt}
+BuildRequires: qt-devel
+%endif
+%if %{with_qt4}
+BuildRequires: qt4-devel
+%endif
+%if %{with_gnome}
+BuildRequires: gnome-panel
+BuildRequires: libgnomeui-devel
+%endif
+%if %{with_kde}
+BuildRequires: kdelibs3-devel
+BuildRequires: kdelibs4-devel
+BuildRequires: cmake
+%endif
+%if %{with_mana}
+BuildRequires: mana
+%endif
+%if %{with_emacsen}
+BuildRequires: emacsen
+%endif
 
 BuildConflicts: uim-devel < 1.4.0
-Requires(post): ldconfig, coreutils, grep, sed
-Requires(postun): ldconfig, coreutils, grep, sed
+Requires(post): coreutils, grep, sed
+Requires(postun): coreutils, grep, sed
 
 %description
 The uim is a collection of input method for a lot of languages.
@@ -65,7 +100,8 @@ Summary(ja): uim の GTK ヘルパー
 Group: User Interface/Desktops
 Requires: %{name} = %{version}-%{release}
 Requires: gtk2
-Requires(post): gtk2 >= 2.10.0, %{name} = %{version}
+Requires(post): gtk2 >= 2.10.0
+Requires(post): %{name} = %{version}-%{release}
 Requires(postun): gtk2 >= 2.10.0
 
 %description gtk
@@ -78,11 +114,13 @@ input pad, candidate window, and preference tool using GTK.
 
 %if %{with_qt}
 %package qt
-Summary: Qt helper for uim
-Summary(ja): uim の Qt ヘルパー
+Summary: Qt3 support for Uim
+Summary(ja): uim の Qt3 サポート
 Group: User Interface/Desktops
 Requires: %{name}-xim = %{version}-%{release}
 Requires: %{name}-qt-common = %{version}-%{release}
+Requires: qt = %{_qt3_version}
+
 Obsoletes: %{name}-qt-immodule < 1.5.6-2
 Obsoletes: uim-qtkde-helper
 Provides: %{name}-qt-immodule = %{version}-%{release}
@@ -99,11 +137,12 @@ and preference tool using Qt.
 
 %if %{with_qt4}
 %package qt4
-Summary: Qt4 helper for uim
-Summary(ja): uim の Qt4 ヘルパー
+Summary: Qt4 support for Uim
+Summary(ja): Uim の Qt4 サポート
 Group: User Interface/Desktops
 Requires: %{name}-xim = %{version}-%{release}
 Requires: %{name}-qt-common = %{version}-%{release}
+Requires: qt4 = %{_qt4_version}
 
 %description qt4
 This package contains some applications like toolbar, candidate window,
@@ -160,24 +199,39 @@ uim-applet は uim の入力状態を表示する GNOME2 用パネルアプレ
 
 %if %{with_kde}
 %package kde-applet
-Summary: KDE3 panel applet for Uim
-Summary(ja): uim の KDE3 用パネルアプレット
+Summary: KDE panel applet for Uim
+Summary(ja): uim の KDE 用パネルアプレット
 Group: User Interface/Desktops
-%if %{?_dist_release} == "vl6"
-BuildRequires: kdelibs3-devel
+%if %{?_dist_release} == "vl5" || %{?_dist_release} == "vl4"
 Requires: kdelibs3
+Requires: %{name}-qt = %{version}-%{release}
 %else
-BuildRequires: kdelibs-devel
-Requires: kdelibs
+Requires: kdelibs4
+Requires: %{name}-qt4 = %{version}-%{release}
 %endif
 Requires: %{name}-xim = %{version}-%{release}
-Requires: %{name}-qt = %{version}-%{release}
 
 %description kde-applet
-uim-kde-applet is KDE3 panel applet for uim.
+uim-kde-applet is KDE panel applet for uim.
 
 %description -l ja kde-applet
-uim-kde-applet は uim の入力状態を表示する KDE3 用パネルアプレットです。
+uim-kde-applet は uim の入力状態を表示する KDE 用パネルアプレットです。
+
+%if %{?_dist_release} == "vl5" || %{?_dist_release} == "vl4"
+%package kde4-applet
+Summary: KDE4 panel applet for Uim
+Summary(ja): uim の KDE4 用パネルアプレット
+Group: User Interface/Desktops
+Requires: kdelibs4
+Requires: %{name}-qt4 = %{version}-%{release}
+Requires: %{name}-xim = %{version}-%{release}
+
+%description kde4-applet
+uim-kde-applet is KDE4 panel applet for uim.
+
+%description -l ja kde4-applet
+uim-kde-applet は uim の入力状態を表示する KDE4 用パネルアプレットです。
+%endif
 %endif
 
 %package fep
@@ -270,9 +324,10 @@ This package provides support for mana, a Japanese input method.
 Summary: Emacsen uim bridge
 Summary(ja): Emacsen-uim ブリッジ
 Group: Applications/Editors/Emacs
-PreReq: emacsen-common
-Requires: %{name} = %{version}-%{release}, emacsen
-BuildRequires: emacsen
+Requires: %{name} = %{version}-%{release}
+Requires: emacsen
+Requires(post): emacsen-common
+Requires(preun): emacsen-common
 
 %description el
 uim.el is a bridge software between Emacsen and uim.
@@ -294,7 +349,7 @@ Requires: uim = %{version}-%{release}
 Requires(post):	gtk2 /usr/bin/uim-module-manager
 Requires(postun): gtk2 /usr/bin/uim-module-manager
 
-%description	m17n
+%description m17n
 This package provides support for m17n-lib, which allows input of
 many languages using the input table map from m17n-db.
 
@@ -314,10 +369,12 @@ uim-devel パッケージには libuim を利用したアプリケーション
 
 %prep
 %setup -q -n %{name}-%{version}%{?extraver:-%extraver}
+%patch0 -p0
 
 %build
 %if %{with_qt}
-export QTDIR=%{qtdir}
+unset QTDIR
+export QTDIR=%{_qt3_prefix}
 %endif
 
 %configure --with-x --with-xft \
@@ -340,14 +397,18 @@ export QTDIR=%{qtdir}
 	--without-qt-immodule \
 %endif
 %if %{with_qt4}
+	--with-qt4 \
 	--with-qt4-immodule \
 %else
+	--without-qt4 \
 	--without-qt4-immodule \
 %endif
 %if %{with_kde}
 	--enable-kde-applet \
+	--enable-kde4-applet \
 %else
 	--disable-kde-applet \
+	--disable-kde4-applet \
 %endif
 %if %{with_canna}
 	--with-canna \
@@ -363,11 +424,17 @@ export QTDIR=%{qtdir}
 	--without-mana 
 %endif
 
-#%if %{with_qtimm}
-#	--with-qt-immodule \
-#%else
-#	--without-qt-immodule \
-#%endif
+# generate Makefile properly for kde4-applets (ad-hoc)
+%if %{with_kde}
+pushd qt4/toolbar/build
+QTDIR=%{_qt4_prefix} %{cmake} \
+    -DCMAKE_BUILD_TYPE=release \
+    -DDATA_INSTALL_DIR:PATH=%{_datadir}/kde4/apps \
+    -DINCLUDE_INSTALL_DIR:PATH=%{_includedir}/kde4 \
+    -DLIBEXEC_INSTALL_DIR:PATH=%{_libexecdir}/kde4 \
+    ..
+popd
+%endif
 
 sed -i -e 's/^\(hardcode_direct=\)$/\1no/' -e 's/^\(hardcode_minus_L=\)$/\1no/' -e 's/^\(libext=\)$/\1"a"/' libtool
 LD_LIBRARY_PATH=$RPM_BUILD_DIR/%{name}-%{version}/uim/.libs:$LD_LIBRARY_PATH make
@@ -396,7 +463,8 @@ make install DESTDIR=%{buildroot}
 %__rm -f %{buildroot}%{_libdir}/uim/plugin/*.{a,la}
 %__rm -f %{buildroot}%{_datadir}/uim/pixmaps/scim.*
 %__rm -f %{buildroot}%{_datadir}/uim/pixmaps/prime*.*
-%__rm -f %{buildroot}%{qtdir}/plugins/inputmethods/*.{a,la}
+%__rm -f %{buildroot}%{_qt3_plugindir}/inputmethods/*.{a,la}
+%__rm -f %{buildroot}%{_qt4_plugindir}/inputmethods/*.{a,la}
 
 %if ! %{with_canna}
 %__rm -f %{buildroot}%{_libdir}/uim/plugin/libuim-canna.so
@@ -411,12 +479,14 @@ make install DESTDIR=%{buildroot}
 %__rm -f %{buildroot}%{_datadir}/uim/pixmaps/mana.*
 %endif
 
-%if %{with_qt}
-#find_lang %{name}-chardict-qt
-%else
+%if ! %{with_qt}
 %__rm -f %{buildroot}%{_datadir}/locale/*/LC_MESSAGES/uim-chardict-qt.mo
 %endif
 
+%if ! %{with_qt4}
+%__rm -f %{buildroot}%{_datadir}/locale/*/LC_MESSAGES/uim-chardict-qt4.mo
+%endif
+
 %if %{with_emacsen}
 %__mkdir_p %{buildroot}%{_prefix}/lib/emacsen-common/packages/install
 %__mkdir_p %{buildroot}%{_prefix}/lib/emacsen-common/packages/remove
@@ -567,34 +637,43 @@ fi
 %{_datadir}/applications/uim.desktop
 
 %if %{with_qt}
-#%files qt -f %{name}-chardict-qt.lang
 %files qt
 %defattr(-,root,root)
-%doc AUTHORS COPYING ChangeLog* NEWS README
-%{qtdir}/plugins/inputmethods/*.so
+# BSD and LGPLv2+
+%{_bindir}/uim-chardict-qt
+# BSD
+%{_bindir}/uim-im-switcher-qt
+# BSD and LGPLv2+
+%{_bindir}/uim-pref-qt
+# BSD
+%{_bindir}/uim-toolbar-qt
+%{_libexecdir}/uim-candwin-qt
+%{_qt3_plugindir}/inputmethods/*.so
+%{_datadir}/locale/*/*/uim-chardict-qt.mo
 %endif
 
 %if %{with_qt4}
 %files qt4
 %defattr(-,root,root)
-%doc AUTHORS COPYING ChangeLog* NEWS qt4/immodule/README.en
+%lang(en) %doc qt4/immodule/README.en
 %lang(ja) %doc qt4/immodule/README.ja
-%{_libdir}/qt-4*/plugins/inputmethods/*.so
+# BSD and LGPLv2+
+%{_bindir}/uim-chardict-qt4
+# BSD
+%{_bindir}/uim-im-switcher-qt4
+# BSD and LGPLv2+
+%{_bindir}/uim-pref-qt4
+# BSD
+%{_bindir}/uim-toolbar-qt4
+%{_libexecdir}/uim-candwin-qt4
+%{_qt4_plugindir}/inputmethods/*.so
+%{_datadir}/locale/*/*/uim-chardict-qt4.mo
 %endif
 
 %if (%{with_qt}%{with_qt4})
 %files qt-common
 %defattr(-,root,root)
 %doc AUTHORS COPYING ChangeLog* NEWS README
-# BSD and LGPLv2+
-%{_bindir}/uim-chardict-qt
-# BSD
-%{_bindir}/uim-im-switcher-qt
-# BSD and LGPLv2+
-%{_bindir}/uim-pref-qt
-# BSD
-%{_bindir}/uim-toolbar-qt
-%{_libexecdir}/uim-candwin-qt
 %endif
 
 #%if %{with_qtimm}
@@ -612,8 +691,21 @@ fi
 %if %{with_kde}
 %files kde-applet
 %defattr(-,root,root)
+%if %{?_dist_release} == "vl5" || %{?_dist_release} == "vl4"
 %{_libdir}/kde3/uim_panelapplet.*
 %{_datadir}/apps/kicker/applets/uimapplet.desktop
+
+%files kde4-applet
+%defattr(-,root,root)
+%{_libdir}/kde4/plasma_applet_uim.*
+%{_datadir}/kde4/services/plasma-applet-uim.desktop
+%else
+%{_libdir}/kde4/plasma_applet_uim.*
+%{_datadir}/kde4/services/plasma-applet-uim.desktop
+%exclude %{_libdir}/kde3/uim_panelapplet.*
+%exclude %{_datadir}/apps/kicker/applets/uimapplet.desktop
+
+%endif
 %endif
 
 %files fep
@@ -683,6 +775,16 @@ fi
 %{_libdir}/pkgconfig/*
 
 %changelog
+* Sun Jul 25 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.5.7-1
+- new upstream release
+- added Patch0
+- added BR: cmake
+- provides KDE4 applets
+- updated Qt version auto detection macros
+
+* Sun Jan 31 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.5.6-6
+- updated Qt version detection macros to build properly
+
 * Fri Jan 22 2010 Ryoichi INAGAKI <ryo1@bc.wakwak.com> 1.5.6-5
 - rebuilt with qt-4.6.1