X-Git-Url: https://git.tld-linux.org/?a=blobdiff_plain;f=macros.tld;h=06111e3b454770828c8a37f72aff3cd5799c0bbe;hb=d7c2caf96bbc6c74864020df9db6d759089a17b1;hp=27995dd5f4e8d41e885ce3e8a67bd17274a42eb5;hpb=208adebc7b42418e7fea34d3a573e0e8b03e36bd;p=packages%2Frpm-tld-macros.git diff --git a/macros.tld b/macros.tld index 27995dd..06111e3 100644 --- a/macros.tld +++ b/macros.tld @@ -27,6 +27,8 @@ %_lispdir %{_datadir}/emacs/site-lisp %_initddir %{_sysconfdir}/rc.d/init.d +%_metainfodir %{_datadir}/metainfo + %_defaultdocdir %{_usr}/share/doc %_fmoddir %{_libdir}/gfortran/modules @@ -82,7 +84,6 @@ %{__spec_install_post_chrpath}\ %{__spec_install_post_compress_modules}\ %{__spec_install_post_check_so}\ -%{__spec_install_post_check_tmpfiles}\ %{__spec_install_post_check_shebangs}\ %{__spec_install_post_compress_docs}\ %{__spec_install_post_py_hardlink}\ @@ -100,9 +101,7 @@ # Template for debug information sub-package. %_enable_debug_packages 1 -%debug_package \ -%ifnarch noarch\ -%global __debug_package 1\ +%_debuginfo_template \ %package debuginfo\ Summary: Debug information for package %{name}\ Summary(pl.UTF-8): Informacje dla debuggera dla pakietu %{name}\ @@ -119,6 +118,32 @@ Informacje te są przydatne przy rozwijaniu aplikacji używających tego\ pakietu oraz przy odpluskwianiu samego pakietu.\ %files debuginfo -f debugfiles.list\ %defattr(-,root,root)\ +%{nil} + +%_debugsource_template \ +%package debugsource\ +Summary: Debug sources for package %{name}\ +Summary(pl.UTF-8): Źródła dla debuggera dla pakietu %{name}\ +Group: Development/Debug\ +AutoReqProv: 0\ +%description debugsource\ +This package provides debug sources for package %{name}.\ +Debug sources are useful when developing applications that use this\ +package or when debugging this package.\ +%description debugsource -l pl.UTF-8\ +Ten pakiet dostarcza źródła dla debuggera dla pakietu %{name}.\ +Źródła te są przydatne przy rozwijaniu aplikacji używających tego\ +pakietu oraz przy odpluskwianiu samego pakietu.\ +%files debugsource -f debugsourcefiles.list\ +%{nil} + +%debug_package \ +%ifnarch noarch\ +%global __debug_package 1\ +%_debuginfo_template\ +%if 0%{?_debugsource_packages}\ +%_debugsource_template\ +%endif\ %endif\ %{nil} @@ -171,7 +196,7 @@ pakietu oraz przy odpluskwianiu samego pakietu.\ %debugcppflags %{nil} %debugldflags %{nil} -%optldflags -Wl,--as-needed -Wl,--no-copy-dt-needed-entries -Wl,-z,relro -Wl,-z,combreloc +%optldflags -Wl,--as-needed -Wl,--no-copy-dt-needed-entries -Wl,-z,relro -Wl,-z,combreloc %{?use_ld:-Wl,-fuse-ld=%{use_ld}} %optcppflags %{nil} # common compilation flags @@ -227,7 +252,7 @@ pakietu oraz przy odpluskwianiu samego pakietu.\ %__make /usr/bin/make %{?_make_opts} %{?_smp_mflags} %__scons /usr/bin/scons %{?_smp_mflags} %__waf /usr/bin/waf %{?_smp_mflags} -%__cmake /usr/bin/cmake -Wno-dev +%__cmake /usr/bin/cmake %__meson /usr/bin/meson %__meson_wrap_mode nodownload %__ninja /usr/bin/ninja @@ -259,10 +284,10 @@ pakietu oraz przy odpluskwianiu samego pakietu.\ elif [ -d $HOME/rpm/SPECS -a -d $HOME/rpm/SOURCES ]; then \ # if old style rpm dir exist, go with it echo $HOME/rpm; \ - elif [ -x ../builder -a ! -d ../builder ]; then + elif [ -x ../builder -a ! -d ../builder ] && [ "$(realpath -s ../builder)" != "/usr/bin/builder" ]; then # relative new style rpmdir: in package dir cd ..; pwd - elif [ -x builder -a ! -d builder ]; then + elif [ -x builder -a ! -d builder ] && [ "$(realpath -s builder)" != "/usr/bin/builder" ]; then # relative new style rpmdir: in packages pwd elif [ -x packages/builder -a ! -d packages/builder ]; then @@ -463,6 +488,13 @@ CPPFLAGS="${CPPFLAGS:-%{rpmcppflags}}" \\\ %{__cmake} \\\ -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \\\ -DCMAKE_BUILD_TYPE=%{!?debug:TLD}%{?debug:Debug} \\\ + -DCMAKE_SYSTEM_NAME=Linux \\\ + -DCMAKE_CROSSCOMPILING:BOOL=FALSE \\\ +%ifarch x32\ + -DCMAKE_SYSTEM_PROCESSOR=x86_64 \\\ +%else\ + -DCMAKE_SYSTEM_PROCESSOR=%{_target_cpu} \\\ +%endif\ -DCMAKE_INSTALL_BINDIR:PATH=%{_bindir} \\\ -DCMAKE_INSTALL_SBINDIR:PATH=%{_sbindir} \\\ -DCMAKE_INSTALL_LIBEXECDIR:PATH=%{_libexecdir} \\\ @@ -527,6 +559,8 @@ CFLAGS="${CFLAGS:-%{rpmcflags}}" \ CPPFLAGS="${CPPFLAGS:-%{rpmcppflags}}" \ CXXFLAGS="${CXXFLAGS:-%{rpmcxxflags}}" \ LDFLAGS="${LDFLAGS:-%{rpmldflags}}" \ +RUSTC="${RUSTC:-%{__rustc}}" \ +RUSTFLAGS="${RUSTFLAGS:-%{rpmrustflags} --target %rust_target}" \ LC_ALL=C.UTF-8 %{__meson} \ --buildtype=plain \ --bindir=%{_bindir} \ @@ -648,7 +682,7 @@ LC_ALL=C.UTF-8 %{__meson} \ %%prep\ %{nil} -%_build_id_links %{expand:%%define __dic_%{?_enable_debug_packages} 1}%{?__dic_1:compat}%{?__dic_0:none}%{expand:%%undefine __dic_%{?_enable_debug_packages}} +%_build_id_links %{expand:%%define __dic_%{?_enable_debug_packages} 1}%{?__dic_1:alldebug}%{?__dic_0:none}%{expand:%%undefine __dic_%{?_enable_debug_packages}} # If non-empty "debug" macro defined, add "dbg" suffix to release number %_rpmfilename %%{NAME}-%%{VERSION}-%%{RELEASE}%{?debug:dbg}.%%{ARCH}.rpm @@ -667,12 +701,12 @@ LC_ALL=C.UTF-8 %{__meson} \ # Requires: name = version %requires_eq() %{!?1:ERROR}%{?2:ERROR}%{?1:%{!?2:%{expand:%%requires_eq_to %1 %1}}} # Requires: name = version (version based on querying package %2) -%requires_eq_to(r) %{!?2:ERROR}%{?3:ERROR}%{?2:%{!?3:%(if ! LC_ALL=C rpm -q --qf 'Requires: %1 = %|E?{%{E}:}|%{V}%{?-r:-%{R}}\\n' %2 | grep '^Requires:'; then echo "BuildRequires: %2"; fi)}} +%requires_eq_to(r) %{!?2:ERROR}%{?3:ERROR}%{?2:%{!?3:%(if ! LC_ALL=C rpm -q --whatprovides --qf 'Requires: %1 = %|E?{%{E}:}|%{V}%{?-r:-%{R}}\\n' %2 | grep '^Requires:'; then echo "BuildRequires: %2"; fi)}} # Requires: name >= version %requires_ge() %{!?1:ERROR}%{?2:ERROR}%{?1:%{!?2:%{expand:%%requires_ge_to %1 %1}}} # Requires: name >= version (version based on querying package %2) -%requires_ge_to(r) %{!?2:ERROR}%{?3:ERROR}%{?2:%{!?3:%(if ! LC_ALL=C rpm -q --qf 'Requires: %1 >= %|E?{%{E}:}|%{V}%{?-r:-%{R}}\\n' %2 | grep '^Requires:'; then echo "BuildRequires: %2"; fi)}} +%requires_ge_to(r) %{!?2:ERROR}%{?3:ERROR}%{?2:%{!?3:%(if ! LC_ALL=C rpm -q --whatprovides --qf 'Requires: %1 >= %|E?{%{E}:}|%{V}%{?-r:-%{R}}\\n' %2 | grep '^Requires:'; then echo "BuildRequires: %2"; fi)}} # helper for renaming packages # %rename old-package @@ -949,14 +983,6 @@ __spec_install_post_check_execstack() { \ %{!?no_install_post_check_execstack:return $fail;} \ }; __spec_install_post_check_execstack }} -#----------------------------------------------------------------- -# Do not verify if each directory under /var/run contains -# tmpfiles.d configuration. TLD Linux doesn't use tmpfiles.d. -# -%no_install_post_check_tmpfiles 1 -# -%__spec_install_post_check_tmpfiles %{nil} - #----------------------------------------------------------------- # Verify that scripts have reasonable shebangs # Test spec: see "test/spec_install_post_check_shebangs" branch on packages/test.spec @@ -1141,10 +1167,12 @@ fi; \ %{?_noautoreq_py3egg: %{__noauto_regexp_helper -p python3egg %{_noautoreq_py3egg}}} \ %{nil} -%__noautodep_helper() %(awk -v x="%*" 'BEGIN { +%__noautodep_helper() %(echo '%*' | awk 'BEGIN { RS = "\n([ \t]+\n)+"; FS = " "; - split(x, F); +} +{ + split($0, F); if (length(F) > 0) { printf("("); for (i=1; i<=length(F); i++) { @@ -1183,7 +1211,7 @@ fi; \ # %define _noautoprov_pyegg excluded # %define _noautoprov_py3egg excluded3 # -%__noauto_regexp_helper(p:) %(echo "%*" | awk 'BEGIN{RS=" "}{printf("%{-p*}%{__qchar}(%%s%{__qchar}) ", $1)}') +%__noauto_regexp_helper(p:) %(echo '%*' | awk 'BEGIN{RS=" "}{printf("%{-p*}%{__qchar}(%%s%{__qchar}) ", $1)}') # detect quote character runtime %__qchar_4 \\\\%{nil} %__qchar_5 \\\\\\%{nil}