david_david

install-brother-printer.spec

Sep 9th, 2013
172
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.48 KB | None | 0 0
  1. Name: install-brother-printer
  2. Version: 0.1
  3. Release: %mkrel 1
  4. Summary: Tool to install Brother Printer drivers
  5. Group: System/Printing
  6. License: GPLv2
  7. URL: https://github.com/ozancaglayan/install-brother-printer-driver
  8. # wget https://github.com/ozancaglayan/%%{name}-driver/archive/%%{version}.tar.gz -O %%{name}-%%{version}.tar.gz
  9. Source0: %{name}-%{version}.tar.gz
  10. Source1: brother.png
  11. BuildArch: noarch
  12.  
  13. BuildRequires: pkgconfig(python)
  14. BuildRequires: python-setuptools
  15. # The imagemagick is needed only for the 'convert' commande in the section 'install'
  16. BuildRequires: imagemagick
  17.  
  18. Requires: kdialog
  19. Requires: python-beautifulsoup
  20. Requires: python-dbus
  21. Requires: tcsh
  22.  
  23.  
  24. %description
  25. This simple script dynamically renders a list of Brother printer models
  26. and installs the selected one from i386 binary RPM's onto your system.
  27.  
  28. It's basically designed for use with Pardus (http://www.pardus.org.tr/eng)
  29. but it also checks for the existence of RPM utility and uses that for
  30. installation.
  31.  
  32. %prep
  33. %setup -q -n %{name}-driver-%{version}
  34.  
  35. %build
  36. python setup.py build
  37.  
  38. %install
  39. python setup.py install --prefix=%{_prefix} --root=%{buildroot}
  40.  
  41. mkdir -p %{buildroot}%{_datadir}/applications
  42. # For icons
  43. mkdir -p %{buildroot}/{%{_iconsdir},%{_miconsdir},%{_liconsdir}}
  44. install -D -m644 %{SOURCE1} %{buildroot}%{_iconsdir}/
  45. convert -geometry 32x32 %{SOURCE1} %{buildroot}%{_liconsdir}/%{name}.png
  46. convert -geometry 16x16 %{SOURCE1} %{buildroot}%{_miconsdir}/%{name}.png
  47.  
  48. # Desktop file entry
  49. cat > %{buildroot}%{_datadir}/applications/%{name}.desktop << EOF
  50. [Desktop Entry]
  51. Name=Install Brother Printer
  52. GenericName=Install Brother Printer
  53. Comment=Utility to install Brother Printer drivers
  54. Icon=brother.png
  55. Path=%{name}
  56. Type=Application
  57. StartupNotify=true
  58. Categories=System;Settings;Printing;HardwareSettings;
  59. EOF
  60. #------------------------------------------------------------------------
  61.  
  62. %find_lang %{name}
  63.  
  64. %post
  65. arc=$"lib"
  66. if [ "$(getconf LONG_BIT)" -eq "64" ]; then
  67. arc=$"lib64"
  68. fi
  69.  
  70. sed -i -e "4a Exec=/usr/$arc/kde4/libexec/kdesu -c %{name}" \
  71. %{_datadir}/applications/%{name}.desktop
  72.  
  73. %files -f %{name}.lang
  74. %doc COPYING README
  75. %{_bindir}/%{name}
  76. %{_datadir}/brother-driver-installer/
  77. %{_datadir}/applications/%{name}.desktop
  78. %{python_sitelib}/install_brother_printer-%{version}-py%pyver.egg-info
  79. %{_iconsdir}/*.png
  80. %{_miconsdir}/*.png
  81. %{_liconsdir}/*.png
Advertisement
Add Comment
Please, Sign In to add comment