%if 0%{?rhel} >= 7 || 0%{?fedora} >= 18 %bcond_without systemd %else %bcond_with systemd %endif Name: cpuminer Version: 2.5.0 Release: 1%{?dist} Summary: A multi-threaded CPU miner for Litecoin and Bitcoin License: GPLv2 URL: https://github.com/pooler/cpuminer Source0: https://github.com/pooler/%{name}/archive/v%{version}/%{name}-%{version}.tar.gz Source1: minerd.init Source2: minerd.sysconfig Source3: minerd.service Patch0: %{name}-2.5.0_sbin_minerd.patch BuildRequires: libcurl-devel jansson-devel BuildRequires: autoconf automake %if %{with systemd} %{systemd_requires} BuildRequires: systemd %else Requires(post): chkconfig Requires(preun): chkconfig # This is for /sbin/service Requires(preun): initscripts %endif %description This is a multi-threaded CPU miner for Litecoin and Bitcoin, fork of Jeff Garzik's reference cpuminer. %prep %autosetup %build ./autogen.sh %configure %make_build %install %make_install %if %{with systemd} : > %{SOURCE2} %{__install} -d -m 755 %{buildroot}/%{_unitdir} %{__install} -m 644 -t %{buildroot}/%{_unitdir} %{SOURCE3} %else %{__install} -D -m 755 %{SOURCE1} %{buildroot}/%{_initddir}/minerd %endif %{__install} -D -m 644 %{SOURCE2} %{buildroot}/%{_sysconfdir}/sysconfig/minerd %if %{with systemd} %post %systemd_post minerd.service %preun %systemd_preun minerd.service %postun %systemd_postun minerd.service %else %post # This adds the proper /etc/rc*.d links for the script /sbin/chkconfig --add minerd %preun if [ $1 -eq 0 ] ; then /sbin/service minerd stop >/dev/null 2>&1 /sbin/chkconfig --del minerd fi %endif %files %doc AUTHORS COPYING ChangeLog LICENSE NEWS README example-cfg.json %{_sbindir}/minerd %{_mandir}/man1/minerd.1.gz %{?with_systemd:%{_unitdir}/minerd.service} %{!?with_systemd:%{_initddir}/minerd} %config(noreplace) %{_sysconfdir}/sysconfig/minerd %changelog * Sat Sep 08 2018 Vadim Raskhozhev - 2.5.0-1 - Added systemd .service file - Slightly modernized the spec - Rebased patch0 - New version * Fri Oct 16 2015 Vadim Raskhozhev - 2.4.2-1 - Initial RPM build