%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print(get_python_lib())")} Name: pycam Version: 0.3 Release: 3%{?dist} Summary: Open Source CAM - Toolpath Generation for 3-Axis CNC machining Group: Applications/Engineering License: GPLv3+ URL: http://sourceforge.net/projects/%{name}/ Source0: http://downloads.sourceforge.net/project/%{name}/%{name}/%{version}/%{name}-%{version}.tar.gz Source1: %{name}.desktop BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildArch: noarch BuildRequires: python-devel BuildRequires: ccache BuildRequires: desktop-file-utils Requires: PyOpenGL Requires: pygtk2 Requires: pygtkglext %description Open Source CAM - Toolpath Generation for 3-Axis CNC machining. %prep %setup -q for f in ./*.{txt,TXT} ./Changelog ./PKG-INFO do iconv -f iso-8859-1 -t utf-8 $f |sed 's|\r||g' > $f.utf8 touch -c -r $f $f.utf8 mv $f.utf8 $f done %build %{__python} setup.py build %install rm -rf $RPM_BUILD_ROOT %{__python} setup.py install -O1 --skip-build --root $RPM_BUILD_ROOT cd $RPM_BUILD_ROOT%{python_sitelib}/%{name}/ for lib in `find . -path "*.py"`; do echo $lib sed '/\/usr\/bin\/env/d' $lib > $lib.new && touch -r $lib $lib.new && mv $lib.new $lib done desktop-file-install --dir=${RPM_BUILD_ROOT}%{_datadir}/applications %{SOURCE1} %clean rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root,-) %exclude %{_bindir}/pycam_win32_postinstall.py %{_datadir}/%{name}/ %{_bindir}/%{name} %doc *.TXT Changelog PKG-INFO *.txt %{_datadir}/applications/pycam.desktop %{python_sitelib}/* %changelog * Fri Aug 20 2010 Fabian Kanngießer - 0.3-3 - added a pygtk2 as said in the install textfile as dependency * Fri Aug 20 2010 Fabian Kanngießer - 0.3-2 - updated license to version given in the license textfile * Thu Aug 19 2010 Fabian Kanngießer - 0.3-1 . removed unneeded files, comments and added dependencies so that the application works correctly, added desktop file * Wed Aug 18 2010 Fabian Kanngießer - 0.3-0 - initial packaging