# vim: syntax=spec %if 0%{?fedora} || 0%{?rhel} > 7 %global python_pkg python3 %global python /usr/bin/python3 %else %global python_pkg python2 %global python /usr/bin/python2 %endif Name: preproc Version: 0.5.git.57.3f4188b Release: 1%{?dist} Summary: Simple text preprocessor License: GPLv2+ URL: https://pagure.io/rpkg-util.git %if 0%{?fedora} || 0%{?rhel} > 6 VCS: git+https://pagure.io/rpkg-util#3f4188b4aa25c9e0a6ca68425531c4200e669a6e:preproc/ %endif # Source is created by: # git clone https://pagure.io/rpkg-util.git # cd rpkg-util/preproc # git checkout --1 # ./rpkg spec --sources Source0: preproc-0.5.git.57.3f4188b.tar.gz BuildArch: noarch BuildRequires: %{python_pkg} Requires: %{python_pkg} %if 0%{?rhel} == 6 BuildRequires: python-argparse Requires: python-argparse %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 -n preproc-0.5.git.57.3f4188b %check sed -i '1 s|#.*|#!%{python}|' preproc ./test %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 * Sat Jan 16 2021 clime 0.5-1 - we need to sed python version also in %%check section of spec -----BEGIN PGP SIGNATURE----- iQFMBAABCAA2FiEEJTxZNkmLw1z8vuZrGHXOEhhBQo8FAmADBK8YHGNsaW1lQGZl ZG9yYXByb2plY3Qub3JnAAoJEBh1zhIYQUKPeZ0IAMWS9Pt3ztnGr3GWzDpdu4pX D0+I6sVbgF9EAsxn14+Dw3TavI4GQRmhMLHK1no57T8NoEmpcBv8+vAdG9IfEjnl 1o7DMFMwqOs2Km/LFGxgGgJdNKp3fXd0JO+HRjpz06JdZTmsn9TB7TotZVrbnzXz QePNOqkUvSNXMM/JAxjBM793aWHiToNNeuXnGaUALhnZ71QPjdDr2M6weXaOCN+c YZydY6FjIV45V8K/De0FrfRAvvJs1hyYuUs2zEOOygOCv3jITFRm/gFdLvGPVPgu nVJzMET0Ea2Q8gGnjkCgQUU19rfPkmN+rujW4nzOdwZmFc2fX9fBHZ8nu2hSZzg= =bPxu -----END PGP SIGNATURE----- * Sat Jan 16 2021 clime 0.4-1 - fix tests, add correct requires and buildrequires -----BEGIN PGP SIGNATURE----- iQFMBAABCAA2FiEEJTxZNkmLw1z8vuZrGHXOEhhBQo8FAmAC92IYHGNsaW1lQGZl ZG9yYXByb2plY3Qub3JnAAoJEBh1zhIYQUKPWGYH/1oPH8b/9+rdzgqO3MeK5qpk 2RdgIBc1SAxAtbuAz9r3BiyZvLHJP+FJe20eXACuPj3iEYFIXtmv2AsLt1PMeoh5 3avNk2OxOlNJ3CiBm3bYhQmSiAICN8TYkTlcjLd3nviPDqRc2gxhSwFbuuhRV8uu oSmCw/xqzn6+bMez2jpCqoJK/Sln+odTwhq12IQvGC/GisQZOrzo3tTPwqFFu5v/ mSamgYCSEy0HYp7o9d8li+pgTJHX3EaJYo3P7c5/sCCHxtDVhYyJq2aO7363t3m1 +G1g0jP4j24CKLWAJYD4z+nkCWOngu78nu/c4PSeBz/5WxXnuN13oAf9Ef8b5P0= =6140 -----END PGP SIGNATURE----- * Sun Jan 03 2021 clime 0.3-1 - test preproc when building -----BEGIN PGP SIGNATURE----- iQFMBAABCAA2FiEEJTxZNkmLw1z8vuZrGHXOEhhBQo8FAl/xsRsYHGNsaW1lQGZl ZG9yYXByb2plY3Qub3JnAAoJEBh1zhIYQUKP6rQH/joL7lXLZv8I9k0cM/g0NtQl fbzh8yMETVXU/0VKV9T0yS5nj9S2LrBpO22AlpCmSor0EynpZUxmlzM33SFOkhL6 yoKJj+EZ3aoWDDijI0XQNUBDHTCByKXFrIG11wdKeBe/5/RE+aEGotk70p41m1yO Pc2xde6VL4OhQ4YHjbXReERfZKAPFLcSGnrcthTLsfipxPS0v4C9mugks9iCQBzg lDC+58tmjKgkGkFg+zliI5XV3tjYxOTL/2dMHwK5AiDMqwt1udb1jAtkJY0G+DnA fuxxEjvwHltCy8AKMR3NAwlv4MUOW2Jkk7FOTEpuvAVjONO/g8vY2NiK3kYTtpg= =HnDC -----END PGP SIGNATURE----- * Tue Mar 10 2020 clime 0.2-1 - encoding fixes - make regular-expression only implementation - add NOTE into help/man about usage of preproc on uknown files * Tue Mar 03 2020 clime 0.1-1 - use cmd_repr helper to properly render the executed command - strip starting and ending whitespaces if any - change to working email - pass now required path to git_vcs macro in spec file - source env before sourcing anything else - fix spec files after CACHE to OUTPUT rename - fix rpkg-util spec files - build fix for rhel6 - provide man pages statically and add regen.sh - add some explanation for tags matching - allow multiple lines inside {{{}}}, fix expression for quoted strings so that the closest quote is matched - add missing BRs - move preproc and rpkg macro defs into separate packages