Tidy up %prep

- “Cythonize” in %build, not %prep
- Since we remove unwanted shebangs, don’t adjust them in %install
epel8
Benjamin A. Beasley 3 months ago
parent e788fb7a6b
commit 87412e9442

@ -9,7 +9,6 @@ Source0: %{pypi_source pyzmq}
BuildRequires: gcc BuildRequires: gcc
BuildRequires: chrpath BuildRequires: chrpath
BuildRequires: %{_bindir}/pathfix.py
BuildRequires: zeromq-devel BuildRequires: zeromq-devel
@ -59,38 +58,31 @@ This package contains the test suite for the Python bindings.
%prep %prep
%setup -q -n pyzmq-%{version} %autosetup -n pyzmq-%{version}
# remove bundled libraries # remove bundled libraries
rm -rf bundled rm -rv bundled
# forcibly regenerate the Cython-generated .c files: # forcibly regenerate the Cython-generated .c files:
find zmq -name "*.c" -delete find zmq -name '*.c' -delete
%{__python3} setup.py cython
# remove shebangs # Remove useless shebangs in files that will be installed without executable
for lib in zmq/eventloop/*.py; do # permission. The pattern of selecting files before modifying them with sed
sed '/\/usr\/bin\/env/d' $lib > $lib.new && # keeps us from unnecessarily discarding the original mtimes on unmodified
touch -r $lib $lib.new && # files.
mv $lib.new $lib find zmq -type f -name '*.py' \
done -exec gawk '/^#!/ { print FILENAME }; { nextfile }' '{}' '+' |
xargs -r sed -r -i '1{/^#!/d}'
# remove excecutable bits
chmod -x examples/pubsub/topics_pub.py
chmod -x examples/pubsub/topics_sub.py
# delete hidden files
#find examples -name '.*' | xargs rm -v
%build %build
%{python3} setup.py cython
%py3_build %py3_build
%install %install
%global RPATH /zmq/{backend/cython,devices} %global RPATH /zmq/{backend/cython,devices}
%py3_install %py3_install
pathfix.py -pn -i %{__python3} %{buildroot}%{python3_sitearch}
%check %check

Loading…
Cancel
Save