Blob Blame History Raw

# Fedora review
# http://bugzilla.redhat.com/186919

Name:	 eric
Summary: Python IDE
Version: 3.9.1
Release: 2%{?dist}

License: GPL
Group:	 Development/Tools
URL: 	 http://www.die-offenbachs.de/detlev/eric3.html
Source:	 http://dl.sourceforge.net/sourceforge/eric-ide/eric-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch

Source1: http://www.die-offenbachs.de/detlev/contributions/gen_python_api_20050605.tar.gz
#Source2: http://www.die-offenbachs.de/detlev/contributions/gen_sip_api_20060123.tar.gz
Source2: http://www.die-offenbachs.de/detlev/contributions/gen_sip_api_20060711.tar.gz

Source10: eric3.desktop

Patch1: eric-3.9.0-prefs.patch
Patch2: gen_python_api-env.patch
Patch3: gen_sip_api-PyQt4.patch

BuildRequires: desktop-file-utils
BuildRequires: PyQt-qscintilla
# PyQt api's
BuildRequires: PyQt-devel
%global pyqt_ver %(pyuic -version 2>&1  | cut -d' ' -f5)
%if "%{?pyqt_ver}" > "2"
Requires: PyQt = %{pyqt_ver}
%endif

Requires: PyQt-qscintilla

%global python_ver %(%{__python} -c "import sys ; print sys.version[:3]")
%global python_sitedir %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
Requires: python-abi = %{python_ver}

%description
eric3 is a full featured Python IDE that is written in PyQt using
the QScintilla editor widget. 


%prep
%setup -q -a 1 -a 2

%patch1 -p1 -b .prefs
sed -i -e "s|@APIDIR@|%{_datadir}/eric|" eric/Preferences/__init__.py
%patch2 -p0 -b .env
%patch3 -p0 -b .PyQt4


%build


%install
rm -rf %{buildroot}
mkdir -p %{buildroot}/

# Either set PYTHONOPTIMIZE here or 
# call /usr/lib/rpm/brp-python-bytecompile later (but before generating .pyo file list) 
PYTHONOPTIMIZE=1; export PYTHONOPTIMIZE

%{__python} install.py \
  -i %{buildroot}/ \
  -b %{_bindir} \
  -d %{python_sitedir}

desktop-file-install \
  --dir %{buildroot}/%{_datadir}/applications/ \
  --add-category="X-Fedora" --vendor="" \
  %{SOURCE10}

install -m644 -p -D \
  %{buildroot}%{python_sitedir}/eric3/icons/default/eric.png \
  %{buildroot}%{_datadir}/icons/hicolor/32x32/apps/eric3.png

# install gen_*_api.py tools
install -m755 -p gen_*_api.py %{buildroot}%{_bindir}/

## generate api files
mkdir -p %{buildroot}%{_datadir}/eric/
%{__python} gen_python_api.py   %{buildroot}%{_datadir}/eric/ 
%{__python} gen_sip_api.py --qt %{buildroot}%{_datadir}/eric/ 

# %ghost'd api files (package separately?) -- Rex
PyQt4_apis="QtAssistant.api QtCore.api QtGui.api QtNetwork.api QtOpenGL.api QtSql.api QtSvg.api QtXml.api"
PyKDE_apis="dcop.api kdecore.api kdefx.api kdeprint.api kdeui.api kfile.api khtml.api kmdi.api kparts.api kspell.api kutils.api"
for api in $PyQt4_apis $PyKDE_apis ; do
  touch %{buildroot}%{_datadir}/eric/$api
  echo "%ghost %{_datadir}/eric/$api" >> %{name}-files.list
done

# rpm will autogenerate these (on some Fedora releases)
# create them here so they can be excluded later
touch %{buildroot}%{_bindir}/gen_sip_api.py{c,o}
touch %{buildroot}%{_bindir}/gen_python_api.py{c,o}

# Having to ghost the .pyo files sucks; this makes it tolerable.
find %{buildroot}%{python_sitedir} -type d | \
  sed 's:%{buildroot}\(.*\):%dir \1:' >> %{name}-files.list
find %{buildroot}%{python_sitedir} -not -type d -not -name '*.pyo' | \
  sed 's:%{buildroot}\(.*\):\1:' >> %{name}-files.list
find %{buildroot}%{python_sitedir} -not -type d -name '*.pyo' | \
  sed 's:%{buildroot}\(.*\):%ghost \1:' >> %{name}-files.list

%if "%{?fedora}" > "4"
# These two files are created by RPM
echo "%ghost %{python_sitedir}/eric3config.pyo" >> %{name}-files.list
echo "%ghost %{python_sitedir}/sitecustomize.pyo" >> %{name}-files.list
%endif

# mostly to make rpmlint happier, non-executable-scripts
chmod a+x %{buildroot}%{python_sitedir}/eric3/ThirdParty/brm/bike/parsing/fastparser.py ||:


%post
touch --no-create %{_datadir}/icons/hicolor ||:
gtk-update-icon-cache -q %{_datadir}/icons/hicolor 2> /dev/null ||:

%postun
touch --no-create %{_datadir}/icons/hicolor ||:
gtk-update-icon-cache -q %{_datadir}/icons/hicolor 2> /dev/null ||:

%triggerin -- PyQt4-devel
%{__python} %{_bindir}/gen_sip_api.py --qt4 %{_datadir}/eric/ >& /dev/null ||:

# Not sure about this one, it takes awhile (1+ minutes) to finish.  -- Rex
%triggerin -- PyKDE-devel
%{__python} %{_bindir}/gen_sip_api.py --kde %{_datadir}/eric/ >& /dev/null ||:



%clean
rm -rf %{buildroot}


%files -f %{name}-files.list
%defattr(-,root,root,-)
%doc eric/README* THANKS HISTORY LICENSE.GPL
%{_bindir}/eric3*
%{_bindir}/gen_*_api.py*
%exclude %{_bindir}/*.pyc
%exclude %{_bindir}/*.pyo

%dir %{_datadir}/eric/
%{_datadir}/eric/python.api
%{_datadir}/eric/qt*.api
%{_datadir}/applications/*eric3.desktop
%{_datadir}/icons/hicolor/*/*/*


%changelog
* Thu Jul 27 2006 Rex Dieter <rexdieter[AT]users.sf.net> 3.9.1-2
- (re)enable PYTHONOPTIMIZE

* Thu Jul 27 2006 Rex Dieter <rexdieter[AT]users.sf.net> 3.9.1-1
- 3.9.1
- gen_sip_api_20060711.tar.gz

* Thu Jul 27 2006 Rex Dieter <rexdieter[AT]users.sf.net> 3.9.0-6
- (re)comment PYTHONOPTIMIZE

* Wed Jul 26 2006 Rex Dieter <rexdieter[AT]users.sf.net> 3.9.0-5
- make fastparser.py eXecutable
- s/$RPM_BUILD_ROOT/%%buildroot/

* Wed Jul 19 2006 Rex Dieter <rexdieter[AT]users.sf.net> 3.9.0-4
- fix fedora > 4 %%ghost'ing case.

* Wed Jul 12 2006 Rex Dieter <rexdieter[AT]users.sf.net> 3.9.0-3
- %%ghost .pyo files

* Thu May 11 2006 Rex Dieter <rexdieter[AT]users.sf.net> 3.9.0-2
- merge -fonts,-api patches into -prefs patch, make it work on
  fc5/python24 too

* Mon May 1 2006 Rex Dieter <rexdieter[AT]users.sf.net> 3.9.0-1
- 3.9.0
- create/own %%{_datadir}/eric, for .api files
- generate .api files for python, PyQt
- %%triggerin PyQt4/PyKDE to (auto)generate .api files

* Wed Apr 19 2006 Rex Dieter <rexdieter[AT]users.sf.net> 3.8.2-3
- --vendor=""

* Mon Apr 10 2006 Rex Dieter <rexdieter[AT]users.sf.net> 3.8.2-2
- cleanup/drop unused bits 
- note PyQt-qscintilla submission (#188496)

* Mon Mar 27 2006 Rex Dieter <rexdieter[AT]users.sf.net> 3.8.2-1
- 3.8.2

* Mon Dec 19 2005 Rex Dieter <rexdieter[AT]users.sf.net> 3.8.1-1
- 3.8.1
- include gen_python_api, gen_sip_api

* Sun Sep 18 2005 Rex Dieter 3.7.2-0.1.kde
- 3.7.2

* Wed Sep 14 2005 Rex Dieter 3.7.1-0.1.kde
- 3.7.1

* Mon Jun 13 2005 Rex Dieter 0:3.6.1-0.1.kde
- cleanup

* Sat Jan 29 2005 Rex Dieter <rexdieter[AT]users.sf.net> 0:3.6.1-0.fdr.1
- 3.6.1
- TODO: package .api files as (one or more) separate .noarch.rpms

* Mon Nov 29 2004 Rex Dieter <rexdieter[AT]users.sf.net> 0:3.5.1-0.fdr.2
- get icons right

* Mon Nov 29 2004 Rex Dieter <rexdieter[AT]users.sf.net> 0:3.5.1-0.fdr.1
- 3.5.1

* Fri Oct 08 2004 Rex Dieter <rexdieter at sf.net> 0:3.5.0-0.fdr.1
- 3.5.0

* Thu Sep 16 2004 Rex Dieter <rexdieter at sf.net> 0:3.4.2-0.fdr.2
- remove Provides: eric3, (redundant) Provides: eric
- allow build going back as far as rh73.

* Sun May 30 2004 Aurelien Bompard <gauret[AT]free.fr> 0:3.4.2-0.fdr.1
- Initial RPM package