Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Name: install-brother-printer
- Version: 0.1
- Release: %mkrel 1
- Summary: Tool to install Brother Printer drivers
- Group: System/Printing
- License: GPLv2
- URL: https://github.com/ozancaglayan/install-brother-printer-driver
- # wget https://github.com/ozancaglayan/%%{name}-driver/archive/%%{version}.tar.gz -O %%{name}-%%{version}.tar.gz
- Source0: %{name}-%{version}.tar.gz
- Source1: brother.png
- BuildArch: noarch
- BuildRequires: pkgconfig(python)
- BuildRequires: python-setuptools
- # The imagemagick is needed only for the 'convert' commande in the section 'install'
- BuildRequires: imagemagick
- Requires: kdialog
- Requires: python-beautifulsoup
- Requires: python-dbus
- Requires: tcsh
- %description
- This simple script dynamically renders a list of Brother printer models
- and installs the selected one from i386 binary RPM's onto your system.
- It's basically designed for use with Pardus (http://www.pardus.org.tr/eng)
- but it also checks for the existence of RPM utility and uses that for
- installation.
- %prep
- %setup -q -n %{name}-driver-%{version}
- %build
- python setup.py build
- %install
- python setup.py install --prefix=%{_prefix} --root=%{buildroot}
- mkdir -p %{buildroot}%{_datadir}/applications
- # For icons
- mkdir -p %{buildroot}/{%{_iconsdir},%{_miconsdir},%{_liconsdir}}
- install -D -m644 %{SOURCE1} %{buildroot}%{_iconsdir}/
- convert -geometry 32x32 %{SOURCE1} %{buildroot}%{_liconsdir}/%{name}.png
- convert -geometry 16x16 %{SOURCE1} %{buildroot}%{_miconsdir}/%{name}.png
- # Desktop file entry
- cat > %{buildroot}%{_datadir}/applications/%{name}.desktop << EOF
- [Desktop Entry]
- Name=Install Brother Printer
- GenericName=Install Brother Printer
- Comment=Utility to install Brother Printer drivers
- Icon=brother.png
- Path=%{name}
- Type=Application
- StartupNotify=true
- Categories=System;Settings;Printing;HardwareSettings;
- EOF
- #------------------------------------------------------------------------
- %find_lang %{name}
- %post
- arc=$"lib"
- if [ "$(getconf LONG_BIT)" -eq "64" ]; then
- arc=$"lib64"
- fi
- sed -i -e "4a Exec=/usr/$arc/kde4/libexec/kdesu -c %{name}" \
- %{_datadir}/applications/%{name}.desktop
- %files -f %{name}.lang
- %doc COPYING README
- %{_bindir}/%{name}
- %{_datadir}/brother-driver-installer/
- %{_datadir}/applications/%{name}.desktop
- %{python_sitelib}/install_brother_printer-%{version}-py%pyver.egg-info
- %{_iconsdir}/*.png
- %{_miconsdir}/*.png
- %{_liconsdir}/*.png
Advertisement
Add Comment
Please, Sign In to add comment