Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # git clone https://github.com/f1u77y/headphones-plug-detector.git && cd headphones-plug-detector
- # tar cf - * | xz -zf - > ~/rpmbuild/SOURCES/headphones-plug-detector.tar.xz
- Name: headphones-plug-detector
- Version: 0.1.0
- Release: 1%{?dist}
- Summary: Headphones plug detector with playback control
- License: MIT
- URL: https://github.com/f1u77y/headphones-plug-detector
- Source0: headphones-plug-detector.tar.xz
- BuildRequires: cmake
- %{?systemd_requires}
- BuildRequires: systemd
- Requires: pulseaudio
- %description
- 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.
- %prep
- %autosetup -c
- %build
- %cmake .
- make %{?_smp_mflags}
- %install
- rm -rf $RPM_BUILD_ROOT
- %make_install
- mkdir -p %{buildroot}/%{_userunitdir}
- mv %{name}.service %{buildroot}/%{_userunitdir}/
- sed -i "s|.*ExecStart=.*|ExecStart=%{_bindir}/%{name}|" %{buildroot}/%{_userunitdir}/%{name}.service
- sed -i "s|.*After=pulseaudio.service.*|After=dbus.socket|" %{buildroot}/%{_userunitdir}/%{name}.service
- sed -i "s|.*Requires=pulseaudio.service.*|Requires=dbus.socket|" %{buildroot}/%{_userunitdir}/%{name}.service
- %post
- %systemd_post %{name}.service
- %preun
- %systemd_preun %{name}.service
- %postun
- %systemd_postun_with_restart %{name}.service
- %files
- %license LICENSE
- %doc README.md
- %{_bindir}/%{name}
- %{_userunitdir}/%{name}.service
- %changelog
- * Wed Nov 29 2017 initial spec
- -
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement