Skip to content

macro for solve brp-python-hardlink problem on rhel #39

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions spec2scl/templates/metapackage.spec
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,24 @@
%global scl_name_version {{data.meta_version}}
%global scl %{scl_name_base}%{scl_name_version}

%if 0%{?fedora} || 0%{?rhel} >= 7
%global brp_python_hardlink /usr/lib/rpm/brp-python-hardlink
%else
%global brp_python_hardlink /usr/lib/rpm/redhat/brp-python-hardlink
%endif
%if 0%{?rhel} == 6
%global __os_install_post /usr/lib/rpm/brp-compress \
%{!?__debug_package:/usr/lib/rpm/brp-strip %{__strip}} \
/usr/lib/rpm/brp-strip-static-archive %{__strip} \
/usr/lib/rpm/brp-strip-comment-note %{__strip} %{__objdump}
%else
%global __os_install_post /usr/lib/rpm/brp-compress \
%{!?__debug_package:/usr/lib/rpm/brp-strip %{__strip}} \
/usr/lib/rpm/brp-strip-static-archive %{__strip} \
/usr/lib/rpm/brp-strip-comment-note %{__strip} %{__objdump} \
%{brp_python_hardlink}
%endif

%scl_package %scl

%global install_scl 1
Expand Down
2 changes: 1 addition & 1 deletion spec2scl/transformers/generic.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def __init__(self, options={}):

@matches(r'^', one_line=False, sections=['%header'])
def insert_scl_init(self, original_spec, pattern, text):
scl_init = '%{{?scl:%scl_package {0}}}\n%{{!?scl:%global pkg_name %{{name}}}}'.format(self.get_original_name(original_spec))
scl_init = '%{{?scl:%scl_package {0}}}\n%{{!?scl:%global pkg_name %{{name}}}}\n%if 0%{?fedora} || 0%{?rhel} >= 7\n%global brp_python_hardlink /usr/lib/rpm/brp-python-hardlink\n%else\n%global brp_python_hardlink /usr/lib/rpm/redhat/brp-python-hardlink\n%endif\n%if 0%{?rhel} == 6\n%global __os_install_post /usr/lib/rpm/brp-compress %{!?__debug_package:/usr/lib/rpm/brp-strip %{__strip}} /usr/lib/rpm/brp-strip-static-archive %{__strip} /usr/lib/rpm/brp-strip-comment-note %{__strip} %{__objdump}\n%else\n%global __os_install_post /usr/lib/rpm/brp-compress %{!?__debug_package:/usr/lib/rpm/brp-strip %{__strip}} /usr/lib/rpm/brp-strip-static-archive %{__strip} /usr/lib/rpm/brp-strip-comment-note %{__strip} %{__objdump} %{brp_python_hardlink}\n%endif'.format(self.get_original_name(original_spec))
return '{0}\n\n{1}'.format(scl_init, text)

@matches(r'(?<!d)(Conflicts:\s*)([^\s]+)', sections=settings.METAINFO_SECTIONS) # avoid BuildConflicts
Expand Down