Blob Blame History Raw

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

Name:    eric
Summary: Python IDE
Version: 4.0.4
Release: 4%{?dist}

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

Source1: http://dl.sourceforge.net/sourceforge/eric-ide/%{name}4-i18n-fr-%{version}.tar.gz
Source2: http://dl.sourceforge.net/sourceforge/eric-ide/%{name}4-i18n-de-%{version}.tar.gz
Source3: http://dl.sourceforge.net/sourceforge/eric-ide/%{name}4-i18n-ru-%{version}.tar.gz
Source4: http://dl.sourceforge.net/sourceforge/eric-ide/%{name}4-i18n-cs_CZ-%{version}.tar.gz
Source10: eric4.desktop

Patch1: eric-3.9.5-shebang.patch
Patch2: eric4-4.0.4-preferences.patch

Provides: eric4 = %{version}-%{release}

BuildRequires: desktop-file-utils
BuildRequires: qscintilla-python
# PyQt api's
BuildRequires: PyQt4-devel

# This can be left unversioned
Requires: PyQt
Requires: qscintilla-python


# Need this for the documentation
Requires: python-docs
Requires: qt4-designer
Requires: qt4-doc

%global python_ver %(%{__python} -c "import sys ; print sys.version[:3]")
%global full_python_ver %(%{__python} -c "import sys ; print sys.version[:5]")
%global python_sitedir %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")
%global pyqt_ver %(%{__python} -c "from PyQt4 import QtCore; print QtCore.PYQT_VERSION_STR")
%global qt_ver %(%{__python} -c "from PyQt4 import QtCore; print QtCore.QT_VERSION_STR")


%description
eric4 is a full featured Python IDE.


%prep
%setup -q -a 1 -a 2 -a 3 -a 4 -n %{name}4-%{version}

%patch1 -p1
%patch2 -p1
sed -i -e "s|@APIDIR@|%{_datadir}/eric|" eric/Preferences/__init__.py

# copy language files
mv eric4-%{version}/%{name}/i18n/*.qm %{name}/i18n/
mv eric4-%{version}/%{name}/i18n/*.ts %{name}/i18n/
rm -rf %{name}-%{version}

%build


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

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

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

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


## generate api files
mkdir -p %{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

# mostly to make rpmlint happier, non-executable-scripts
chmod a+x %{buildroot}%{python_sitedir}/eric4/ThirdParty/brm/bike/parsing/fastparser.py ||:
chmod a+x %{buildroot}%{python_sitedir}/eric4/*.py ||:
chmod a+x %{buildroot}%{python_sitedir}/eric4/ThirdParty/brm/bike/logging.py
chmod a+x %{buildroot}%{python_sitedir}/eric4/uninstall.py
chmod a+x %{buildroot}%{python_sitedir}/eric4/Examples/hallo.py
chmod a+x %{buildroot}%{python_sitedir}/eric4/DebugClients/Python/PyCoverage.py
chmod a+x %{buildroot}%{python_sitedir}/eric4/Examples/rhallo.py
chmod a-x %{buildroot}%{python_sitedir}/eric4/patch_pyxml.py

# add envrionment variables for qt, qt4 and python documentations
sed -i -e 's|exec|QT4DIR=%{_libdir}/qt4\nPYTHONDOCDIR=%{_docdir}/python-docs-%{?full_python_ver}/html\nQTDOCDIR=%{_docdir}/qt-devel-%{?qt_ver}/html\nQT4DOCDIR=%{_docdir}/qt4/html\nPYQT4DOCDIR=%{_docdir}/PyQt4-devel-%{?pyqt_ver}/html\nexport QT4DIR PYTHONDOCDIR QTDOCDIR QT4DOCDIR PYQT4DOCDIR\n&|' %{buildroot}%{_bindir}/eric4


%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 ||:


%clean
rm -rf %{buildroot}


%files -f %{name}-files.list
%defattr(-,root,root,-)
%doc eric/README* THANKS LICENSE.GPL
%{_bindir}/eric4*
%{python_sitedir}/eric4config.py*
%{python_sitedir}/sitecustomize.py*
%{python_sitedir}/eric4/

%dir %{_datadir}/eric/
%{_datadir}/applications/*eric4.desktop
%{_datadir}/icons/hicolor/*/*/*


%changelog
* Tue Jan 29 2008 Johan Cwiklinski <johan AT x-tnd DOT be> 4.0.4-4
- define qt_ver and pyqt_ver
- use environment variables to set documentation path
- init preferences to have relevant qt commands suffix
- add PyQt4 as Requires

* Tue Jan 29 2008 Johan Cwiklinski <johan AT x-tnd DOT be> 4.0.4-3
- requires qt4-designer not qt-designer
- BR : qt-devel already required by PyQt-devel
- seems no longer necessary to define qt_ver
- language files were sourced, not installed
- error on language files path

* Wed Jan 28 2008 Dennis Gilmore <dennis@ausil.us> 4.0.4-2
- fix incorrect BuildRequires/Requires  qscintilla-python 

* Wed Jan 28 2008 Dennis Gilmore <dennis@ausil.us> 4.0.4-1
- update to eric4

* Thu Jan 17 2008 Johan Cwiklinski <johan AT x-tnd DOT be> 3.9.5-2
- Add environment variable to set python, qt4 and qt docs path (bug #200856)
- Requires python-doc, qt-designer, qt4-devel and qt4-doc
- BR: PyQt-devel is already needeed by PyQt-qscintilla-devel

* Fri Jan 11 2008 Johan Cwiklinski <johan AT x-tnd DOT be> 3.9.5-1
- Rebuild for last version
- Include the translation files

* Mon Aug 27 2007 Rex Dieter <rdieter[AT]fedoraproject.org> 3.9.2-3
- License: GPL+
- don't set PYTHONOPTIMIZE, let brp-python-bytecompile do it's job,
  addresses selinux issues (#243163, #254421)

* Wed Nov 22 2006 Rex Dieter <rexdieter[AT]users.sf.net> 3.9.2-2
- Provides: eric3 (get ready for PyQt4-based eric4)
- fix biffed %%version's in %%changelog
- simplify %%description

* Mon Nov 13 2006 Rex Dieter <rexdieter[AT]users.sf.net> 3.9.2-1
- 3.9.2 

* Mon Nov 06 2006 Rex Dieter <rexdieter[AT]users.sf.net> 3.9.1-4
- BR: PyQt-qscintilla-devel
- (unversioned) Requires: PyQt-qscintilla

* Thu Sep 07 2006 Rex Dieter <rexdieter[AT]users.sf.net> 3.9.1-3
- include .py[c,o] files again (with no %%ghost'ing)

* 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