Created
December 9, 2013 13:25
-
-
Save bkabrda/7872190 to your computer and use it in GitHub Desktop.
Proposal for generating scl-specific macros automatically
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# To try, install python27-macros and rpmbuild -bp this spec | |
# Then see what it prints | |
# Uncomment this to get unversioned %%python_datadir macro | |
# %%python27_make_default_macros | |
Name: a | |
Version: 1 | |
Release: 1%{?dist} | |
Summary: a | |
License: MIT | |
URL: http://a | |
%description | |
a. | |
%prep | |
echo %python27_datadir | |
# echo %%python_datadir | |
%build | |
%install | |
%files | |
%changelog |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# arguments to scl_generate_macros: | |
# %1 - prefix for general macros | |
# %2 - where to save the file | |
%scl_generate_macros() %{expand: | |
cat >> %2/macros.%{scl}-general << EOF | |
%%%{expand:%{scl}_datadir} %_datadir | |
# if %{scl}_make_default_macros is defined, generate default macros | |
# (if RPM doesn't work, just add more percent signs) | |
%%%{scl}_make_default_macros() %%%%{expand: | |
%%%%global %{expand:%{1}_datadir %_datadir} | |
} | |
EOF | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/python27.spec b/python27.spec | |
index 22f496a..9e425f3 100644 | |
--- a/python27.spec | |
+++ b/python27.spec | |
@@ -42,6 +42,12 @@ Requires: scl-utils-build | |
%description build | |
Package shipping essential configuration macros to build %scl Software Collection. | |
+%package macros | |
+Summary: Package shipping macros specific to this collection | |
+ | |
+%description macros | |
+Package shipping macros specific to this collection. | |
+ | |
%prep | |
%setup -T -c | |
@@ -59,6 +65,7 @@ export XDG_DATA_DIRS=%{_datadir}\${XDG_DATA_DIRS:+:\${XDG_DATA_DIRS}} | |
export PKG_CONFIG_PATH=%{_libdir}/pkgconfig\${PKG_CONFIG_PATH:+:\${PKG_CONFIG_PATH}} | |
EOF | |
%scl_install | |
+%scl_generate_macros python %{buildroot}%{_root_sysconfdir}/rpm | |
# Add the aditional macros to macros.%%{scl}-config | |
cat %{SOURCE0} >> %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl}-config | |
@@ -72,6 +79,9 @@ sed -i 's|@scl@|%{scl}|g' %{buildroot}%{_root_sysconfdir}/rpm/macros.%{scl}-conf | |
%files build | |
%{_root_sysconfdir}/rpm/macros.%{scl}-config | |
+%files macros | |
+%{_root_sysconfdir}/rpm/macros.%{scl}-general | |
+ | |
%changelog | |
* Wed Oct 23 2013 Robert Kuska <rkuska@redhat.com> - 1-13 | |
- Remove blank line from macros.additional.python27 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment