File README of Package Printrun
useful links and reminders used in packaging this rpm
it comes up again and again..
this is not optimized, but at least specfile works for following ARCHs:
openSUSE_Factory  x86_64
openSUSE_12.3     x86_64
SLE_11_SP3        x86_64
SLE_11_SP2        x86_64
SLE_11            x86_64
Fedora_19         x86_64
********************
add GROUP in every sub-package
********************
RPM_BUILD_ROOT does not exist in SLES* and 11.1
BuildRoot:      %{_tmppath}/%{name}-%{version}-build
********************
http://en.opensuse.org/openSUSE:Packaging_Python
The possibility to build noarch packages, along with %python_sitelib and %python_sitearch, 
was introduced in 11.2. If you need compatibility with older distributions, you must define the macros you are using. 
%if 0%{?suse_version} && 0%{?suse_version} <= 1110
 %{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
 %else
 BuildArch:      noarch
 %endif
********************
http://en.opensuse.org/openSUSE:Packaging_Conventions_RPM_Macros
The macro %suse_update_desktop_file updates translations, adds categories (needed to sort menus), 
and does some sanity checks in the given .desktop file. 
It requires the package update-desktop-files. 
********************
X11:common:Factory > update-desktop-files > update-desktop-files.changes 
Fri Oct  8 18:33:29 CEST 2010 - vuntz@opensuse.org
- Add a desktop-file-utils Requires: this will make it easy for
  everyone to use the RPM macros defined there, that are useful
  when there is a .desktop file. After some thoughts, it is more
  logical to add the macros in desktop-file-utils and to have a
  Requires here (since all packages with .desktop files already
  have a update-desktop-files BuildRequires), in my opinion.
********************  
http://en.opensuse.org/openSUSE:Specfile_guidelines
You can use %defattr(-,root,root,0755) to fix permission issues with directories.  
******************** 
$ diff './home:rdannert:pr/pr3/printrun.spec' './home:jnweiger:branches:home:kdupke:3d/printrun/printrun.spec'
2,4c2,3
< %global shortcommit 71e5da0
< %global snapshot 20130123git71e5da0
< 
---
> %global shortcommit %(c=%{commit}; echo ${c:0:7})
> %global snapshot 20130123git%{shortcommit}
20a20
> BuildArch:      noarch
23,38d22
< %if 0%{?suse_version}
< BuildRequires:  update-desktop-files
< BuildRequires:  fdupes
< #BuildConflicts: post-build-checks
< BuildRoot:      %{_tmppath}/%{name}-%{version}-build
< %endif
< 
< %if 0%{?suse_version} && 0%{?suse_version} <= 1110
< %{!?python_sitelib: %global python_sitelib %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
< %else
< BuildArch:      noarch
< %endif
< 
< 
< 
< %if 0%{?fedora_version}
40,41d23
< %endif
< 
58d39
< Group:          Productivity/Graphics/Convertors
61d41
< 
70d49
< Group:          Productivity/Graphics/Convertors
83d61
< Group:          Productivity/Graphics/Convertors
96d73
< Group:          Productivity/Graphics/Convertors
130,145d106
< # via home:dbruce > tuxmath_test > tuxmath.spec
< # via openSUSE:12.2 > nagstamon > nagstamon.spec 
< %if 0%{?suse_version}
< mkdir -p "%buildroot/%_docdir/%name"
< mkdir -p %{buildroot}%{_datadir}/applications
< install -Dm644 %{SOURCE1} %{buildroot}/%{_datadir}/applications/pronsole.desktop
< install -Dm644 %{SOURCE2} %{buildroot}/%{_datadir}/applications/pronterface.desktop
< install -Dm644 %{SOURCE3} %{buildroot}/%{_datadir}/applications/plater.desktop
< 
< %suse_update_desktop_file -i %{buildroot}/%{_datadir}/applications/pronsole.desktop
< %suse_update_desktop_file -i %{buildroot}/%{_datadir}/applications/pronterface.desktop
< %suse_update_desktop_file -i %{buildroot}/%{_datadir}/applications/plater.desktop
< #%%fdupes -s %%buildroot
< %endif
< 
< %if 0%{?fedora_version}
149d109
< %endif
166,167c126
< %defattr(-,root,root,0755)
< #%%{python_sitelib}/*
---
> %defattr(-,root,root,755)
171d129
< %defattr(-,root,root,0755)
178d135
< %defattr(-,root,root,0755)
186d142
< %defattr(-,root,root,0755)
194d149
< %defattr(-,root,root,0755)