Advertisement
Guest User

headphones-plug-detector.spec

a guest
Nov 29th, 2017
129
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.56 KB | None | 0 0
  1.  
  2. # git clone https://github.com/f1u77y/headphones-plug-detector.git && cd headphones-plug-detector
  3. # tar cf - * | xz -zf - > ~/rpmbuild/SOURCES/headphones-plug-detector.tar.xz
  4.  
  5.  
  6. Name:           headphones-plug-detector
  7. Version:        0.1.0
  8. Release:        1%{?dist}
  9. Summary:        Headphones plug detector with playback control
  10.  
  11. License:        MIT      
  12. URL:            https://github.com/f1u77y/headphones-plug-detector
  13. Source0:        headphones-plug-detector.tar.xz
  14.  
  15. BuildRequires:  cmake
  16. %{?systemd_requires}
  17. BuildRequires:  systemd
  18.  
  19. Requires:       pulseaudio
  20.  
  21. %description
  22. This program detects when you plug out your headphones and pauses music for you. When you plug them in again, it resumes all the players that were paused by this program.
  23.  
  24. %prep
  25. %autosetup -c
  26.  
  27.  
  28. %build
  29. %cmake .
  30. make %{?_smp_mflags}
  31.  
  32. %install
  33. rm -rf $RPM_BUILD_ROOT
  34. %make_install
  35.  
  36. mkdir -p %{buildroot}/%{_userunitdir}
  37. mv %{name}.service %{buildroot}/%{_userunitdir}/
  38. sed -i "s|.*ExecStart=.*|ExecStart=%{_bindir}/%{name}|" %{buildroot}/%{_userunitdir}/%{name}.service
  39. sed -i "s|.*After=pulseaudio.service.*|After=dbus.socket|" %{buildroot}/%{_userunitdir}/%{name}.service
  40. sed -i "s|.*Requires=pulseaudio.service.*|Requires=dbus.socket|" %{buildroot}/%{_userunitdir}/%{name}.service
  41.  
  42. %post
  43. %systemd_post %{name}.service
  44.  
  45. %preun
  46. %systemd_preun %{name}.service
  47.  
  48. %postun
  49. %systemd_postun_with_restart %{name}.service
  50.  
  51. %files
  52. %license LICENSE
  53. %doc README.md
  54. %{_bindir}/%{name}
  55. %{_userunitdir}/%{name}.service
  56.  
  57.  
  58.  
  59.  
  60. %changelog
  61. * Wed Nov 29 2017 initial spec
  62. -
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement