# scl-utils RPM macros # # Copyright (C) 2012 Red Hat, Inc. # Written by Jindrich Novy . %define scl_debug() %{expand: %define old_debug %{lua:print(rpm.expand("%{debug_package}"):len())} %undefine _debugsource_packages %global debug_package %{expand: %if "%{?old_debug}" == "0" %{expand: %{nil}} %else %if "%{?scl}%{!?scl:0}" == "%{pkg_name}" %{expand: %{nil}} %else %ifnarch noarch %package debuginfo Summary: Debug information for package %{name} Group: Development/Debug AutoReqProv: 0 %{lua: debuginfo=tonumber(rpm.expand("%{old_debug}")) if debuginfo > 0 then rpm.define("__debug_package 1") end } %description debuginfo This package provides debug information for package %{name}. Debug information is useful when developing applications that use this package or when debugging this package. %files debuginfo -f debugfiles.list %defattr(-,root,root) %endif %endif %endif %{nil}}} %define scl_prefix() %{?scl:%(if [ "%1" = "%%1" ]; then echo "%{scl}-"; else echo "%1-"; fi)}%{!?scl:%{nil}} %define scl_package() %{expand:%{!?_root_prefix: %global pkg_name %1 %global scl_name %{scl} %global scl_runtime %{scl}-runtime %global scl_basedir /opt %{!?scl_vendor: %global scl_vendor rh} %{!?_scl_prefix: %global _scl_prefix %{scl_basedir}/%{scl_vendor}} %global _scl_scripts %{_scl_prefix}/%{scl} %global _scl_root %{_scl_prefix}/%{scl}/root %global _root_prefix %{_prefix} %global _root_exec_prefix %{_root_prefix} %global _root_bindir %{_exec_prefix}/bin %global _root_sbindir %{_exec_prefix}/sbin %global _root_libexecdir %{_exec_prefix}/libexec %global _root_datadir %{_prefix}/share %global _root_sysconfdir %{_sysconfdir} %global _root_sharedstatedir %{_sharedstatedir} %global _root_localstatedir %{_localstatedir} %global _root_libdir %{_exec_prefix}/%{_lib} %global _root_includedir %{_prefix}/include %global _root_infodir %{_datadir}/info %global _root_mandir %{_datadir}/man %global _root_initddir %{_sysconfdir}/rc.d/init.d %global _prefix %{_scl_root}/usr %global _exec_prefix %{_prefix} %global _bindir %{_exec_prefix}/bin %global _sbindir %{_exec_prefix}/sbin %global _libexecdir %{_exec_prefix}/libexec %global _datadir %{_prefix}/share %global _sysconfdir %{_scl_root}/etc %{?nfsmountable: %global _sysconfdir %{_root_sysconfdir}%{_scl_prefix}/scls/%{scl}} %{?rh_layout: %global _sysconfdir %{_root_sysconfdir}%{_scl_prefix}/%{scl}} %global _sharedstatedir %{_scl_root}/var/lib %{?nfsmountable: %global _sharedstatedir %{_root_localstatedir}%{_scl_prefix}/scls/%{scl}/lib} %{?rh_layout: %global _sharedstatedir %{_root_localstatedir}%{_scl_prefix}/%{scl}/lib} %global _localstatedir %{_scl_root}/var %{?nfsmountable: %global _localstatedir %{_root_localstatedir}%{_scl_prefix}/scls/%{scl}} %{?rh_layout: %global _localstatedir %{_root_localstatedir}%{_scl_prefix}/%{scl}} %global _libdir %{_exec_prefix}/%{_lib} %global _includedir %{_prefix}/include %global _infodir %{_datadir}/info %global _mandir %{_datadir}/man %global _docdir %{_datadir}/doc %global _defaultdocdir %{_docdir} } %{?scl_dependency_generators:%scl_dependency_generators} %global scl_pkg_name %{scl}-%{pkg_name} %scl_debug %global __os_install_post %{expand: /usr/lib/rpm/brp-compress %{_scl_root}/usr %{!?__debug_package:/usr/lib/rpm/brp-strip %{__strip} /usr/lib/rpm/brp-strip-comment-note %{__strip} %{__objdump} } /usr/lib/rpm/brp-strip-static-archive %{__strip} [ -f /usr/lib/rpm/redhat/brp-python-hardlink ] && /usr/lib/rpm/redhat/brp-python-hardlink || /usr/lib/rpm/brp-python-hardlink %{nil}} %if "%{?scl}%{!?scl:0}" == "%{pkg_name}" %endif %{?scl_package_override:%scl_package_override} } %define scl_require() %{_scl_prefix}/%1/enable, %1 %define scl_require_package() %1-%2 %define scl_enable_script() %{expand: cat >> %{buildroot}%{_scl_scripts}/enable << 'EOF' eval `/usr/bin/modulecmd bash load %{scl}` EOF }