# vim: syntax=spec %if 0%{?fedora} || 0%{?rhel} > 7 %global python /usr/bin/python3 %else %global python /usr/bin/python2 %endif Name: preproc Version: 0.0.git.318.6b9f034 Release: 1%{?dist} Summary: Simple text preprocessor License: GPLv2+ URL: https://pagure.io/rpkg-util.git %if 0%{?fedora} || 0%{?rhel} > 6 VCS: git+ssh://git@pagure.io/rpkg-util.git#6b9f0344f10bdda67536479c8d4632e874f321b0: %endif # Source is created by: # git clone https://pagure.io/rpkg-util.git # cd rpkg-util/preproc # git checkout preproc-0.0.git.318.6b9f034-1 # ./rpkg spec --sources Source0: preproc-0.0.git.318.6b9f034.tar.gz BuildArch: noarch %if 0%{?rhel} == 6 BuildRequires: python-argparse Requires: python-argparse %endif %if 0%{?fedora} || 0%{?rhel} > 7 Requires: python3-pyparsing %else Requires: pyparsing %endif %description Simple text preprocessor implementing a very basic templating language. You can use bash code enclosed in triple braces in a text file and then pipe content of that file to preproc. preproc will replace each of the tags with stdout of the executed code and print the final renderred result to its own stdout. %prep %setup -q %install install -d %{buildroot}%{_bindir} install -p -m 0755 preproc %{buildroot}%{_bindir} sed -i '1 s|#.*|#!%{python}|' %{buildroot}%{_bindir}/preproc install -d %{buildroot}%{_mandir}/man1 install -p -m 0644 man/preproc.1 %{buildroot}%{_mandir}/man1 %files %{!?_licensedir:%global license %doc} %license LICENSE %{_bindir}/preproc %{_mandir}/man1/preproc.1* %changelog