Am Dienstag, 4. Februar 2003 02:52 schrieb Andy Neitzke:
> Hi,
>
> I'm having a problem with the current PyQt package in contrib.  After I
> install it (together with its dependencies sip and libsip9)
> it doesn't quite work -- says it can't find libsip:
>
> [andy@teleology quasinormal]$ python
> Python 2.2.2 (#2, Jan  4 2003, 14:19:43)
> [GCC 3.2.1 (Mandrake Linux 9.1 3.2.1-2mdk)] on linux-i386
> Type "help", "copyright", "credits" or "license" for more information.
>
> >>> import qt
>
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
>   File "/usr/lib/python2.2/site-packages/qt.py", line 35, in ?
>     import libsip
> ImportError: No module named libsip
>
> I can get rid of this problem by creating a symlink but then I get an
> "undefined symbol" error in its place:
>
> [root@teleology site-packages]# ln -s libsip.so.9 libsip.so
> [root@teleology site-packages]# exit
> [andy@teleology site-packages]$ python
> [GCC 3.2.1 (Mandrake Linux 9.1 3.2.1-2mdk)] on linux-i386
> Type "help", "copyright", "credits" or "license" for more information.
>
> >>> import qt
>
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
>   File "/usr/lib/python2.2/site-packages/qt.py", line 39, in ?
>     import libqtc
> ImportError: ./libqtcmodule.so: undefined symbol:
> _ZNK9QSGIStyle9classNameEv
>
> I'm using all the Python packages from Cooker as far as I know.  A
> Google search suggests that Qt for Mandrake is compiled in some special
> way (missing some styles?) and therefore PyQt must be patched to remove
> them.  Anyone have any experience with this?

Have a look at the attached patch file. It is also used in the attached 
PyQt.spec file. If you want to use the spec files unchanged, you  have to use
snapshot versions of sip and PyQt.
If there is some interest for eric (and qscintilla) packages, I could provide 
spec files.

Ralf.

Attachment: PyQt-MandrakeBroken.patch.bz2
Description: BZip2 compressed data

%define name PyQt
%define version 3.6
%define rel 20030106
%define release snapshot%rel
%define py_ver %(%{__python} -c 'import sys; print sys.version[:3]')
%define sip_major 9
#%define sip_minor 3

%define	qtdir	/usr/lib/qt3

Summary:	Python bindings for Qt.
Name:		%{name}
Version:	%{version}
Release:	%{release}
License:	Free
Group:		Development/Python
#Source:		%{name}-%{version}.tar.bz2
Source:		%{name}-x11-gpl-snapshot-%{rel}.tar.bz2
Patch:		PyQt-MandrakeBroken.patch.bz2
URL:		http://www.riverbankcomputing.co.uk/pyqt/
BuildRoot:	%{_tmppath}/%{name}-buildroot
#BuildRequires:	libsip%{sip_major}-devel >= %{version}
BuildRequires:	libsip%{sip_major}-devel, qscintilla
Requires:	sip, python >= %{py_ver}, libsip%{sip_major}
Prefix:		%{_prefix}

%description
Python bindings for the Qt C++ class library.

%package devel
Summary: SIP specification files for Qt.
Group: Development/Python

%description devel
The SIP specification files for the Qt class library.

%package docs
Summary: Documentation for PyQt
Group: Books/Other

%description docs
Documentation for PyQt


%prep
rm -rf $RPM_BUILD_ROOT
mkdir $RPM_BUILD_ROOT

#%setup -q
%setup -q -n %{name}-x11-gpl-snapshot-%{rel}
%patch -p1

%build
mkdir -p %{buildroot}/%{_libdir}/python%{py_ver}/site-packages/PyQt
%{__python} build.py -c \
	-b %{buildroot}/%{_bindir} \
	-d %{buildroot}/%{_libdir}/python%{py_ver}/site-packages/PyQt \
	-q %{qtdir} -p /usr/bin/sip <<EOF
yes
EOF
%make

%install
%makeinstall
mkdir -p %{buildroot}/%{_datadir}/sip/qt
cd sip
for f in *.sip; do
	install -m 644 $f %{buildroot}/%{_datadir}/sip/qt
done

cat > %{buildroot}/%{_libdir}/python%{py_ver}/site-packages/qt.pth <<EOF
PyQt
EOF

%clean
rm -rf %{buildroot}

%files docs
%defattr(-, root, root, 755)
%doc ChangeLog LICENSE NEWS README* THANKS doc/PyQt examples3

%files
%defattr(-, root, root, 755)
%{_bindir}/*
%{_libdir}/python*/site-packages/PyQt/libqt*cmodule*.*
%{_libdir}/python*/site-packages/PyQt/qt*.py*
%{_libdir}/python*/site-packages/qt.pth

%files devel
%defattr(-, root, root, 755)
%{_datadir}/sip/qt

%changelog
* Sun Jan 12 2003 RA <[EMAIL PROTECTED]> 3.6-snapshot
- snapshot 20030106
- eric is no longer in PyQt dist

* Mon Nov 18 2002 Jerome Martin <[EMAIL PROTECTED]> 3.4-1mdk
- version 3.4

* Mon Nov  4 2002 Jerome Martin <[EMAIL PROTECTED]> 3.3.2-2mdk
- Create different rpms for doc and eric


* Sat Sep 06 2002 Jerome Martin <[EMAIL PROTECTED]> 3.3.2-1mdk
- version 3.3.2 with qt3 inspired from  Gerard Vermeulen <[EMAIL PROTECTED]>
- Patch to correct Qt installation broken

* Mon Apr 08 2002 Christian Belisle <[EMAIL PROTECTED]> 3.1-1mdk
- version 3.1.
- Update URL.
- Update python version.
- Macroize.
- Quiet the setup

* Tue Sep 04 2001 Lenny Cartier <[EMAIL PROTECTED]> 2.5-1mdk
- fix build 
- updated by RA <[EMAIL PROTECTED]> :
	- upgrade to 2.5

* Fri Jun 01 2001 Yves Bailly <[EMAIL PROTECTED]> 2.4-1mdk
- upgrade to 2.4

* Thu Feb 22 2001 Lenny Cartier <[EMAIL PROTECTED]> 2.3-1mdk
- used sprm from  Gerard Vermeulen <[EMAIL PROTECTED]>

* Sun Feb 04 2001 Gerard Vermeulen <[EMAIL PROTECTED]> 2.3-2mgv
- tweak %%files

* Tue Oct 10 2000 Gerard Vermeulen <[EMAIL PROTECTED]> 2.2-1mgv
- mandrakization for 7.2

%define name sip
%define version 3.6
%define rel 20030105
%define release snapshot%{rel}
%define py_ver %(%{__python} -c 'import sys; print sys.version[:3]')

%define major 9
%define minor 3
%define libname lib%{name}%{major}

Summary: Python bindings generator for C++ class libraries.
Name: %{name}
Version: %{version}
Release: %{release}
License: GPL-like
Group: Development/Python
#Source: %{name}-%{version}.tar.bz2
Source: %{name}-x11-gpl-snapshot-%{rel}.tar.bz2
URL: http://www.riverbankcomputing.co.uk/sip
BuildRoot: %{_tmppath}/%{name}-buildroot
BuildRequires: libpython%{py_ver}-devel
Requires: python = %{py_ver}

%description
Generates Python bindings for C++ class libraries from a set of class
specification files.  Also includes a runtime support library needed by all
generated bindings.

%package -n %{libname}
Summary: Python bindings generator for C++ class libraries.
Group: System/Libraries
Provides: lib%{name} = %{version}

%description -n %{libname}
Generates Python bindings for C++ class libraries from a set of class
specification files.  Also includes a runtime support library needed by all
generated bindings.

%package -n %{libname}-devel
Summary: Libraries and include files for developing.
Group: Development/C++
Requires: %{libname} = %{version}
Provides: lib%{name}-devel = %{version}

%description -n %{libname}-devel
Generates Python bindings for C++ class libraries from a set of class
specification files.  Also includes a runtime support library needed by all
generated bindings.


%prep
rm -rf $RPM_BUILD_ROOT

%setup -q -n %{name}-x11-gpl-snapshot-%{rel}

%build
mkdir -p %{buildroot}/%{_libdir}/python%{py_ver}/site-packages/sip
%{__python} build.py -q %{_libdir}/qt3 -b %{buildroot}/%{_bindir} \
    -d %{buildroot}/%{_libdir}/python%{py_ver}/site-packages/sip <<EOF
yes
EOF

%make
cd siplib
%make staticlib
cd -

%install
# Make a link for .so's in /usr/lib (in case python
# folder is not in PATH)
mkdir -p $RPM_BUILD_ROOT%{_libdir}
mkdir -p $RPM_BUILD_ROOT%{_includedir}/python%{py_ver}
%makeinstall
cp siplib/sip.h $RPM_BUILD_ROOT%{_includedir}/python%{py_ver}
cp siplib/sipQt.h $RPM_BUILD_ROOT%{_includedir}/python%{py_ver}
	
cd $RPM_BUILD_ROOT%{_libdir}
ln -sf python%{py_ver}/site-packages/sip/libsip.so ./libsip.so
ln -sf python%{py_ver}/site-packages/sip/libsip.so.%{major} ./libsip.so.%{major}
ln -sf python%{py_ver}/site-packages/sip/libsip.so.%{major}.%{minor}.0 ./libsip.so.%{major}.%{minor}.0
cat > python%{py_ver}/site-packages/libsip.pth <<EOF
sip
EOF

%post -n %{libname} -p /sbin/ldconfig

%postun -n %{libname} -p /sbin/ldconfig

%clean
rm -rf $RPM_BUILD_ROOT

%files
%defattr(-, root, root, 755)
%doc NEWS README
%{_bindir}/sip

%files -n %{libname}-devel
%defattr(-, root, root, 755)
%{_includedir}/python%{py_ver}/sip.h
%{_includedir}/python%{py_ver}/sipQt.h
%{_libdir}/libsip.so
%{_libdir}/python%{py_ver}/site-packages/sip/libsip.a

%files -n %{libname}
%defattr(-, root, root, 755)
%{_libdir}/python%{py_ver}/site-packages/sip/*.so*
%{_libdir}/python%{py_ver}/site-packages/libsip.pth
%{_libdir}/*.so.*

%changelog
* Sat Jan 11 2003  <[EMAIL PROTECTED]> 3.6-snapshot
- snapshot 20030105

* Mon Nov 18 2002 Jerome Martin <[EMAIL PROTECTED]> 3.4-1mdk
- version 3.4

* Sat Aug 17 2002 Christian Belisle <[EMAIL PROTECTED]> 3.3.2-2mdk
- fix Provides for libsip9.

* Wed Jul 17 2002 Christian Belisle <[EMAIL PROTECTED]> 3.3.2-1mdk
- 3.3.2
- use the new sip's build script

* Sat Jun 29 2002 Olivier Thauvin <[EMAIL PROTECTED]> 3.2.4-1mdk
- 3.2.4

* Tue May 28 2002 Lenny Cartier <[EMAIL PROTECTED]> 3.2.2-2mdk
- rebuild against new libstdc++

* Mon May 13 2002 Lenny Cartier <[EMAIL PROTECTED]> 3.2.2-1mdk
- 3.2.2

* Tue May 07 2002 Lenny Cartier <[EMAIL PROTECTED]> 3.2.1-1mdk
- 3.2.1

* Mon Apr 08 2002 Christian Belisle <[EMAIL PROTECTED]> 3.1-1mdk
- version 3.1 (lib major 8).
- update URL.

* Fri Jan 11 2002 Lenny Cartier <[EMAIL PROTECTED]> 3.0-3mdk
- merge with  RA <[EMAIL PROTECTED]> mods :
	- added BuildRequires: libpython2.2-devel

* Fri Nov 30 2001 Yves Duret <[EMAIL PROTECTED]> 3.0-1mdk
- version 3.0 (lib major 7)

* Fri Nov 30 2001 Yves Duret <[EMAIL PROTECTED]> 2.5-2mdk
- rebuild against libpng3
- %%makeinstall_std
- std %%build step (macros..)
- added %%dir %%{_includedir}/sip in -devel package

* Mon Sep 03 2001 Lenny Cartier <[EMAIL PROTECTED]> 2.5-1mdk
- 2.5

* Mon May 14 2001 Yves BAILLY <[EMAIL PROTECTED]> 2.4-3mdk
- fixed some errors in spec file (sorry, my first package)

* Mon May 14 2001 Yves BAILLY <[EMAIL PROTECTED]> 2.4-2mdk
- fixed the Python dependency (>= 2.0 instead of = 2.0)

* Mon May 14 2001 Yves BAILLY <[EMAIL PROTECTED]> 2.4-1mdk
- upgrade to version 2.4

* Tue Mar 20 2001 David BAUDENS <[EMAIL PROTECTED]> 2.3-2mdk
- Rebuild against Qt 2.3.0

* Wed Feb 21 2001 Lenny Cartier <[EMAIL PROTECTED]> 2.3-1mdk
- updated to 2.3

* Mon Feb 12 2001 Lenny Cartier <[EMAIL PROTECTED]> 2.2-1mdk
- used srpm from Gerard Vermeulen <[EMAIL PROTECTED]>
        - built on Mandrake-7.2 following Mandrake RPM guidelines


Reply via email to