Skip to content

Instantly share code, notes, and snippets.

@chkumar246
Last active November 8, 2016 17:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chkumar246/cf75d421c9e6db68e05a710f31160239 to your computer and use it in GitHub Desktop.
Save chkumar246/cf75d421c9e6db68e05a710f31160239 to your computer and use it in GitHub Desktop.
Tempest Plugin entry-point separation macro
%define service manila
# Entry Point Macro
%define py2_entrypoint() \
egg_path=%{buildroot}%{python2_sitelib}/%{service}-*.egg-info \
tempest_egg_path=%{buildroot}%{python2_sitelib}/%{service}_tests.egg-info \
mkdir $tempest_egg_path \
grep "tempest\\|Tempest" %{service}.egg-info/entry_points.txt >$tempest_egg_path/entry_points.txt \
sed -i "/tempest\\|Tempest/d" $egg_path/entry_points.txt \
# echo 'Metadata-Version: 1.1\nName: %{service}-tests\nVersion: %{upstream_version}\nSummary: %{summary} Tempest Plugin\n' >> $tempest_egg_path/PKG-INFO \
%nil
# How to call this macro
%install
%py2_entrypoint
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment