%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")} Name: PyPE Version: 2.9.4 Release: 1%{?dist} Summary: Lightweight but powerful graphical editor for developers Group: Development/Languages License: GPLv2 URL: http://pype.sourceforge.net/ Source0: http://downloads.sourceforge.net/project/pype/pype/%{name} %{version}/%{name}-%{version}-src.zip Source1: PyPE.desktop BuildArch: noarch Requires: wxPython BuildRequires: python2-devel BuildRequires: wxPython-devel BuildRequires: desktop-file-utils %description PyPE (Python Programmers' Editor) was written in order to offer a lightweight but powerful editor for those of you who think Emacs is too much and idle is too little. Syntax highlighting is included out of the box, as is multiple open documents via tabs. %prep %setup -q # We don't need these pre-compiled files (if any) find \( -name "*.pyc" -or -name "*.pyw" \) -exec rm -f {} \; # Convert file to UTF-8 for file in sample_dictionary.txt plugins/parsers.py; do iconv -f ISO-8859-1 -t UTF-8 -o $file.new $file && \ touch -r $file $file.new && \ mv $file.new $file done # CRLF -> LF for file in changelog.txt readme.txt gpl.txt lgpl.txt wxwindows.txt sample_alphabet.txt sample_dictionary.txt plugins/parsers.py pype.py; do sed "s|\r||g" $file > $file.new && \ touch -r $file $file.new && \ mv $file.new $file done # Remove unnecessary shebang sed -i -e '/^#!\//, 1d' plugins/parsers.py # Directly call python (there's nonprintable chars in front of the shebang, therefore we search for ^.*# and not ^#) sed -i -e 's|^.*#!/usr/bin/env python|#!/usr/bin/python|' pype.py # Make the main script executable chmod 755 pype.py %build %{__python} setup.py build %install # Delete this script before it gets copied below rm -f setup.py mkdir -p $RPM_BUILD_ROOT%{python_sitelib}/%{name} cp -p *.py stc-styles.rc.cfg MANIFEST.in PKG-INFO readme.{txt,html} $RPM_BUILD_ROOT%{python_sitelib}/%{name} cp -pR icons macros plugins $RPM_BUILD_ROOT%{python_sitelib}/%{name} mkdir -p $RPM_BUILD_ROOT%{_bindir} ln -s %{python_sitelib}/%{name}/pype.py $RPM_BUILD_ROOT%{_bindir}/pype sed -e "s;PYTHONPATH;%{python_sitelib};g" %{SOURCE1} > %{name}.desktop desktop-file-install --dir=$RPM_BUILD_ROOT%{_datadir}/applications \ %if 0%{?fedora} >= 10 --remove-key=Encoding \ %endif %{name}.desktop %files %defattr(-,root,root,-) %doc changelog.txt readme.txt readme.html gpl.txt sample_* %{_bindir}/pype %{python_sitelib}/%{name} %{_datadir}/applications/%{name}.desktop %changelog * Mon Mar 11 2013 Sérgio Basto <sergio@serjux.com> - 2.9.4-1 - Update to 2.9.4 . - A little review with fedora-review: Remove %clean, rm -rf $RPM_BUILD_ROOT and BuildRoot, BR python2-devel, fix URL * Wed Feb 13 2013 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.9.1-8 - Rebuilt for https://fedoraproject.org/wiki/Fedora_19_Mass_Rebuild * Wed Jul 18 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.9.1-7 - Rebuilt for https://fedoraproject.org/wiki/Fedora_18_Mass_Rebuild * Thu Jan 12 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.9.1-6 - Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild * Mon Feb 07 2011 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 2.9.1-5 - Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild * Wed Jul 21 2010 David Malcolm <dmalcolm@redhat.com> - 2.9.1-4 - Rebuilt for https://fedoraproject.org/wiki/Features/Python_2.7/MassRebuild * Sat Apr 17 2010 Sandro Mathys <red at fedoraproject.org> - 2.9.1-3 - final review fix, Emacs should be written with a capital E * Wed Mar 03 2010 Sandro Mathys <red at fedoraproject.org> - 2.9.1-2 - fixed the interpreter directive * Mon Dec 28 2009 Sandro Mathys <red at fedoraproject.org> - 2.9.1-1 - new version - now GPLv2 only due to relicensing of LGPLv2 and wxWindows licensed parts by upstream * Sun Dec 27 2009 Sandro Mathys <red at fedoraproject.org> - 2.9-2 - no longer includes *.pyc and *.pyw - fixes kinda wrong path in the desktop file - small cleanup fixes to spec file * Sat Dec 26 2009 Sandro Mathys <red at fedoraproject.org> - 2.9-1 - new version * Wed Dec 09 2009 Sandro Mathys <red at fedoraproject.org> - 2.8.8-3 - fixed icons path and desktop file as part of the review process * Tue Sep 22 2009 Sandro Mathys <red at fedoraproject.org> - 2.8.8-2 - fixed issues raised in the review process * Sun Aug 16 2009 Sandro Mathys <red at fedoraproject.org> - 2.8.8-1 - initial build