Browse Source

sip-4.18-1

git-svn-id: http://trac.vinelinux.org/repos/projects/specs@10600 ec354946-7b23-47d6-9f5a-488ba84defc7
tomop 7 years ago
parent
commit
ce84fea9ff
1 changed files with 148 additions and 22 deletions
  1. 148 22
      s/sip/sip-vl.spec

+ 148 - 22
s/sip/sip-vl.spec

@@ -2,20 +2,51 @@
 %{!?python_inc:%global python_inc %(%{__python} -c "from distutils.sysconfig import get_python_inc; print get_python_inc(1)")}
 %define py_ver %(python -c 'import sys;print(sys.version[0:3])')
 
+%{!?python3:%global __python3 /usr/bin/python3}
+%{!?python3_inc:%global python3_inc %(%{__python3} -c "from distutils.sysconfig import get_python_inc; print(get_python_inc(1))")}
+%{!?python3_sitearch: %global python3_sitearch %(python3 -c "from distutils.sysconfig import get_python_lib; import sys; sys.stdout.write(get_python_lib(1))")}
+%{!?python3_sitelib: %global python3_sitelib %(python3 -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")}
+%{!?python3_version: %global python3_version %(python3 -c "import sys; sys.stdout.write(sys.version[:3])")}
+
+%global rpm_macros_dir %(d=%{_rpmconfigdir}/macros.d; [ -d $d ] || d=%{_sysconfdir}/rpm; echo $d)
+
+# trim changelog included in binary rpms
+%global _changelog_trimtime %(date +%s -d "1 year ago")
+
 Name: 		sip
 Summary: 	Python/C++ Bindings Generator
 Summary(ja): 	Python/C++ インターフェイス生成ツール
-Version: 	4.16.4
-Release: 	2%{?_dist_release}
+Version: 	4.18
+Release: 	1%{?_dist_release}
 
 License:	GPLv2 or GPLv3
 Group:		Development/Tools
 URL:		http://www.riverbankcomputing.co.uk/software/sip/intro
 
-Source0:	http://www.riverbankcomputing.co.uk/static/Downloads/sip4/%{name}-%{version}.tar.gz
-Patch0:		disable-rpaths.diff
+Source0:  http://downloads.sourceforge.net/pyqt/sip-%{version}%{?snap:-snapshot-%{snap}}.tar.gz
+
+## upstream patches
+Patch1: sip-4.18-diamond_inheritance.patch
+Patch2: sip-4.18-shadow_build.patch
+
+## upstreamable patches
+# make install should not strip (by default), kills -debuginfo
+Patch50: sip-4.18-no_strip.patch
+# try not to rpath the world
+Patch51: sip-4.18-no_rpath.patch
+
+# extracted from sip.h, SIP_API_MAJOR_NR SIP_API_MINOR_NR defines
+Source1: macros.sip
+%global _sip_api_major 11
+%global _sip_api_minor 3
+%global _sip_api %{_sip_api_major}.%{_sip_api_minor}
 
 BuildRoot:	%{_tmppath}/%{name}-%{version}-root
+
+Provides: sip-api(%{_sip_api_major}) = %{_sip_api}
+Provides: sip-api(%{_sip_api_major})%{?_isa} = %{_sip_api}
+
+BuildRequires:	python3-devel
 BuildRequires:	python-devel
 BuildRequires:	sed
 
@@ -39,6 +70,7 @@ Summary: 	Files needed to generate Python bindings for any C++ class library
 Summary(ja): 	Python/C++ インタフェース作成に必要なライブラリやヘッダファイル
 Group: 		Development/Libraries
 Requires: 	%{name} = %{version}-%{release}
+Requires:	%{name}-macros = %{version}-%{release}
 Requires: 	python-devel
 Provides: 	libsip-devel = %{version}-%{release}
 
@@ -47,9 +79,58 @@ This package contains files needed to generate Python bindings for any C++
 classes library.
 
 
+%package macros
+Summary: RPM macros for use when working with SIP
+Requires: rpm
+# when arch->noarch happened
+Obsoletes: sip-macros < 4.15.5
+BuildArch: noarch
+
+%description macros
+This package contains RPM macros for use when working with SIP.
+It is used by both the sip-devel (python 2) and python3-sip-devel subpackages.
+
+
+%package -n python3-sip
+Summary: SIP - Python 3/C++ Bindings Generator
+BuildRequires: python3-devel
+Provides: python3-sip-api(%{_sip_api_major}) = %{_sip_api}
+Provides: python3-sip-api(%{_sip_api_major})%{?_isa} = %{_sip_api}
+
+%description -n python3-sip
+This is the Python 3 build of SIP.
+
+SIP is a tool for generating bindings for C++ classes so that they can be
+accessed as normal Python 3 classes. SIP takes many of its ideas from SWIG but,
+because it is specifically designed for C++ and Python, is able to generate
+tighter bindings. SIP is so called because it is a small SWIG.
+
+SIP was originally designed to generate Python bindings for KDE and so has
+explicit support for the signal slot mechanism used by the Qt/KDE class
+libraries. However, SIP can be used to generate Python 3 bindings for any C++
+class library.
+
+
+%package -n python3-sip-devel
+Summary: Files needed to generate Python 3 bindings for any C++ class library
+Requires: %{name}-macros = %{version}-%{release}
+Requires: python3-sip%{?_isa} = %{version}-%{release}
+Requires: python3-devel
+
+%description -n python3-sip-devel
+This package contains files needed to generate Python 3 bindings for any C++
+classes library.
+
+
 %prep
 %setup -q
-%patch0
+
+%patch1 -p1 -b .diamond_inheritance
+%patch2 -p1 -b .shadow_build
+
+%patch50 -p1 -b .no_strip
+%patch51 -p1 -b .no_rpath
+
 
 %build
 %ifarch x86_64 ppc
@@ -58,22 +139,45 @@ OPT_FLAGS="%{optflags} -fPIC"
 OPT_FLAGS="%{optflags}"
 %endif
 
-%{__python} configure.py -k -d %{python_sitearch} \
-	-b %{_bindir} CXXFLAGS="$OPT_FLAGS" CFLAGS="$OPT_FLAGS"
-make %{?_smp_mflags}
+mkdir %{_target_platform}-python3
+pushd %{_target_platform}-python3
+%{__python3} ../configure.py \
+  -d %{python3_sitearch} \
+  --sipdir=%{_datadir}/python3-sip \
+  CXXFLAGS="${OPT_FLAGS}" CFLAGS="${OPT_FLAGS}" LFLAGS="%{?__global_ldflags}"
+
+make %{?_smp_mflags} 
+popd
+
+mkdir %{_target_platform}
+pushd %{_target_platform}
+%{__python} ../configure.py \
+  -d %{python_sitearch} \
+  CFLAGS="${OPT_FLAGS}" CXXFLAGS="${OPT_FLAGS}" LFLAGS="%{?__global_ldflags}"
 
-%{__python} configure.py -d %{python_sitearch} \
-	-b %{_bindir} CXXFLAGS="$OPT_FLAGS" CFLAGS="$OPT_FLAGS"
 make %{?_smp_mflags}
+popd
 
 
 %install
-rm -rf $RPM_BUILD_ROOT
-make install DESTDIR=$RPM_BUILD_ROOT 
+rm -rf %{buildroot}
 
-install sipconfig.pyc $RPM_BUILD_ROOT%{python_sitearch}
-install -m644 siplib/libsip.a -D $RPM_BUILD_ROOT%{_libdir}/libsip.a
-mkdir -p $RPM_BUILD_ROOT%{_datadir}/sip
+# Perform the Python 3 installation first, to avoid stomping over the Python 2
+# /usr/bin/sip:
+make install DESTDIR=%{buildroot} -C %{_target_platform}-python3
+mkdir -p %{buildroot}%{_datadir}/python3-sip
+mv %{buildroot}%{_bindir}/sip %{buildroot}%{_bindir}/python3-sip
+
+## toplevel __pycache__ creation is ... inconsistent
+## rawhide makes one, f23 local builds do not, so let's *make* it consistent
+mkdir -p %{buildroot}%{python3_sitearch}/__pycache__/exclude_rpm_hack
+
+# Python 2 installation:
+make install DESTDIR=%{buildroot} -C %{_target_platform}
+mkdir -p %{buildroot}%{_datadir}/sip
+
+# Macros used by -devel subpackages:
+install -D -p -m644 %{SOURCE1} %{buildroot}%{rpm_macros_dir}/macros.sip
 
 
 %clean
@@ -81,18 +185,40 @@ rm -rf $RPM_BUILD_ROOT
 
 %files
 %defattr(-, root, root, 755)
-%doc LICENSE LICENSE-GPL2 LICENSE-GPL3 NEWS README 
-%doc doc/html
-%{_bindir}/sip
-%{python_sitearch}/*
+%doc NEWS README
+%license LICENSE LICENSE-GPL2 LICENSE-GPL3
+%{python_sitearch}/sip.so
+%{python_sitearch}/sip*.py*
 
 %files devel
 %defattr(-, root, root, 755)
-%{python_inc}/*
-%{_libdir}/libsip.a
-%dir %{_datadir}/sip
+%{_bindir}/sip
+%{_datadir}/sip/
+%{python_inc}/sip.h
+
+%files macros
+%{rpm_macros_dir}/macros.sip
+
+%files -n python3-sip
+%doc NEWS README
+%license LICENSE LICENSE-GPL2 LICENSE-GPL3
+%{python3_sitearch}/sip.so
+%{python3_sitearch}/sip*.py*
+%{python3_sitearch}/__pycache__/*
+%exclude %{python3_sitearch}/__pycache__/exclude_rpm_hack
+
+%files -n python3-sip-devel
+# Note that the "sip" binary is invoked by name in a few places higher up
+# in the KDE-Python stack; these will need changing to "python3-sip":
+%{_bindir}/python3-sip
+%{_datadir}/python3-sip/
+%{python3_inc}/sip.h
+
 
 %changelog
+* Tue Jul 12 2016 Tomohiro "Tomo-p" KATO <tomop@teamgedoh.net> 4.18-1
+- new upstream release.
+
 * Thu Jun 30 2016 Yoji TOYODA <bsyamato@sea.plala.or.jp> 4.16.4-2
 - rebuild with gcc-5.4.0