%global commit0 3a7a278e78126ad58d4f82ead2330ffe9327e054 %global cdate 20170206 %global scommit %(c='%{commit0}'; echo ${c:0:7} ) Summary: Enable compressed swap in memory Name: zram Version: 0 Release: 0.1.%{cdate}git%{scommit}%{?dist} License: MIT URL: https://github.com/Jiab77/systemd-zram Source0: %{url}/archive/%{commit0}.tar.gz#/%{name}-%{scommit}.tar.gz BuildArch: noarch BuildRequires: systemd-units Requires(post): systemd-sysv Requires(post): systemd-units Requires(preun): systemd-units Requires(postun): systemd-units Requires: systemd Requires: filesystem >= 2.0.1 Requires: initscripts Requires: bc > 1.0 # need Linux kernel version 2.6.37.1 or better to use zram Requires: kernel >= 2.6.37.1 %description zram compresses swap partitions into RAM for performance. %prep %setup -qnsystemd-zram-%{commit0} %build # nothing %install install -d %{buildroot}%{_sbindir} install -pm 0755 zramstart %{buildroot}%{_sbindir} install -pm 0755 zramstop %{buildroot}%{_sbindir} install -pm 0755 zramstat %{buildroot}%{_sbindir} install -d %{buildroot}%{_unitdir}/mkzram.service install -pm 0644 mkzram.service %{buildroot}%{_unitdir}/mkzram.service install -d %{buildroot}%{_sysconfdir}/systemd install -pm 0644 zram.conf %{buildroot}%{_sysconfdir}/systemd %post %systemd_post mkzram.service %preun %systemd_preun mkzram.service %postun %systemd_postun_with_restart mkzram.service %files %license LICENSE %doc README.md %config(noreplace) %{_sysconfdir}/systemd/%{name}.conf %{_unitdir}/mkzram.service %{_sbindir}/zramstart %{_sbindir}/zramstop %{_sbindir}/zramstat %changelog * Tue Jul 11 2017 Raphael Groner - 0-0.1.20170206git3a7a278 - initial