Eliminate our script language helper macros and associated scripts

Having these kind of macros has increasingly forced us to ponder questions
like "what is the system default python", which have absolutely nothing
to do with rpm. And to that issue the only possible solution is eliminating
such content from rpm.

And yes this will break existing packages and force distros to deal
with the fallout, but we believe its for the best:
these macros are also best maintained by people closer to the languages
in question, as has been done with all the newer languages predating
perl and python. rpm-extras exists as the place for maintaining and
collaborating on such material.
This commit is contained in:
Panu Matilainen 2019-02-22 12:24:40 +02:00
parent 6d4c68ba10
commit ba85c95963
6 changed files with 2 additions and 103 deletions

View File

@ -49,8 +49,6 @@
%__mkdir_p @__MKDIR_P@
%__mv @__MV@
%__patch @__PATCH@
%__perl @__PERL@
%__python @__PYTHON@
%__restorecon @__RESTORECON@
%__rm @__RM@
%__rsh @__RSH@
@ -1076,43 +1074,6 @@ package or when debugging this package.\
%patches %{lua: for i, p in ipairs(patches) do print(p.." ") end}
%sources %{lua: for i, s in ipairs(sources) do print(s.." ") end}
#------------------------------------------------------------------------------
# Useful perl macros (from Artur Frysiak <wiget@t17.ds.pwr.wroc.pl>)
#
# For example, these can be used as (from ImageMagick.spec from PLD site)
# [...]
# BuildPrereq: perl
# [...]
# %package perl
# Summary: libraries and modules for access to ImageMagick from perl
# Group: Development/Languages/Perl
# Requires: %{name} = %{version}
# %requires_eq perl
# [...]
# %install
# rm -fr $RPM_BUILD_ROOT
# install -d $RPM_BUILD_ROOT/%{perl_sitearch}
# [...]
# %files perl
# %defattr(644,root,root,755)
# %{perl_sitearch}/Image
# %dir %{perl_sitearch}/auto/Image
#
%requires_eq() %(echo '%*' | LC_ALL="C" xargs -r rpm -q --qf 'Requires: %%{name} = %%{epoch}:%%{version}\\n' | sed -e 's/ (none):/ /' -e 's/ 0:/ /' | grep -v "is not")
%perl_sitearch %(eval "`%{__perl} -V:installsitearch`"; echo $installsitearch)
%perl_sitelib %(eval "`%{__perl} -V:installsitelib`"; echo $installsitelib)
%perl_vendorarch %(eval "`%{__perl} -V:installvendorarch`"; echo $installvendorarch)
%perl_vendorlib %(eval "`%{__perl} -V:installvendorlib`"; echo $installvendorlib)
%perl_archlib %(eval "`%{__perl} -V:installarchlib`"; echo $installarchlib)
%perl_privlib %(eval "`%{__perl} -V:installprivlib`"; echo $installprivlib)
#------------------------------------------------------------------------------
# Useful python macros for determining python version and paths
#
%python_sitelib %(%{__python} -Es %{_rpmconfigdir}/python-macro-helper sitelib)
%python_sitearch %(%{__python} -Es %{_rpmconfigdir}/python-macro-helper sitearch)
%python_version %(%{__python} -Es %{_rpmconfigdir}/python-macro-helper version)
#------------------------------------------------------------------------------
# arch macro for all Intel i?86 compatible processors
# (Note: This macro (and it's analogues) will probably be obsoleted when

View File

@ -14,7 +14,6 @@ EXTRA_DIST = \
debuginfo.prov \
find-debuginfo.sh find-lang.sh \
perl.prov perl.req pythondeps.sh pythondistdeps.py \
python-macro-helper \
rpmdb_loadcvt rpm.daily rpm.log rpm.supp rpm2cpio.sh \
tgpg vpkg-provides.sh \
find-requires find-provides \
@ -22,8 +21,7 @@ EXTRA_DIST = \
mono-find-requires mono-find-provides \
ocaml-find-requires.sh ocaml-find-provides.sh \
pkgconfigdeps.sh libtooldeps.sh metainfo.prov \
fontconfig.prov desktop-file.prov script.req \
macros.perl macros.php macros.python
fontconfig.prov desktop-file.prov script.req
rpmconfig_SCRIPTS = \
brp-compress brp-python-bytecompile brp-java-gcjcompile \
@ -34,7 +32,6 @@ rpmconfig_SCRIPTS = \
debuginfo.prov \
find-lang.sh find-requires find-provides \
perl.prov perl.req pythondeps.sh pythondistdeps.py \
python-macro-helper \
metainfo.prov \
mono-find-requires mono-find-provides \
pkgconfigdeps.sh libtooldeps.sh \
@ -43,6 +40,5 @@ rpmconfig_SCRIPTS = \
rpmdb_loadcvt rpm2cpio.sh tgpg
rpmconfig_DATA = \
rpm.daily rpm.log rpm.supp \
macros.perl macros.php macros.python
rpm.daily rpm.log rpm.supp

View File

@ -1,9 +0,0 @@
# Perl specific macro definitions.
# To make use of these macros insert the following line into your spec file:
# %include %{_rpmconfigdir}/macros.perl
%define perl_sitelib %(eval "`perl -V:installsitelib`"; echo $installsitelib)
%define perl_sitearch %(eval "`perl -V:installsitearch`"; echo $installsitearch)
%define perl_archlib %(eval "`perl -V:installarchlib`"; echo $installarchlib)
%define perl_privlib %(eval "`perl -V:installprivlib`"; echo $installprivlib)

View File

@ -1,6 +0,0 @@
# Perl specific macro definitions.
# To make use of these macros insert the following line into your spec file:
# %include %{_rpmconfigdir}/macros.php
%define php_pear_dir %{_datadir}/pear

View File

@ -1,18 +0,0 @@
# Python specific macro definitions.
# To make use of these macros insert the following line into your spec file:
# %include %{_rpmconfigdir}/macros.python
# python main version
%define py_ver %(echo `python -c "import sys; sys.stdout.write(sys.version[:3])"`)
# directories
%define py_prefix %(echo `python -c "import sys; sys.stdout.write(sys.prefix)"`)
%define py_libdir %{py_prefix}/lib/python%{py_ver}
%define py_incdir /usr/include/python%{py_ver}
%define py_sitedir %{py_libdir}/site-packages
%define py_dyndir %{py_libdir}/lib-dynload
# pure python modules compilation
%define py_comp python -c "import compileall; import sys; compileall.compile_dir(sys.argv[1], ddir=sys.argv[1][len('$RPM_BUILD_ROOT'):])"
%define py_ocomp python -O -c "import compileall; import sys; compileall.compile_dir(sys.argv[1], ddir=sys.argv[1][len('$RPM_BUILD_ROOT'):])"

View File

@ -1,25 +0,0 @@
from distutils.sysconfig import get_python_lib
from platform import python_version_tuple
import sys
if __name__ == "__main__":
if len(sys.argv) < 2:
sys.stderr.write("Usage: %s <command>\n" % sys.argv[0])
sys.exit(1)
if sys.argv[1] == "version":
sys.stdout.write(".".join(python_version_tuple()[:2]))
sys.exit(0)
if sys.argv[1] == "sitelib":
sys.stdout.write(get_python_lib())
sys.exit(0)
if sys.argv[1] == "sitearch":
sys.stdout.write(get_python_lib(1))
sys.exit(0)
sys.stderr.write("Unknown command: %s\n" % sys.argv[1])
sys.exit(1)