]> TLD Linux GIT Repositories - packages/rpm-tld-macros.git/blobdiff - macros.tld
- merged 2.030 from PLD, re-enabled PHP dependency generators
[packages/rpm-tld-macros.git] / macros.tld
index f3e511961a96bd7a08adda481438b8e578234330..d993c2bc70e0b8805dce3095540a53b271fcad66 100644 (file)
@@ -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
@@ -39,7 +41,7 @@
 
 # Location of pkgconfig files
 %_pkgconfigdir /usr/%{_lib}/pkgconfig
-# noarch pkgconfig files
+# noarch pkgconfig files (since 1.446)
 %_npkgconfigdir        /usr/share/pkgconfig
 
 # Location of desktop files
 # Location of fonts directories
 %_fontsdir     /usr/share/fonts
 
-# Location of Gtk and associated libraries documentation
+# Location of Gtk and associated libraries documentation (since 1.98)
 %_gtkdocdir    %{_defaultdocdir}/gtk-doc/html
 
-# Location of KDE documentation
+# Common subdirectory for gi-docgen generated libraries documentation (since 2.029)
+%_gidocdir     %{_defaultdocdir}/gi-doc
+
+# Location of KDE documentation (since 1.129)
 %_kdedocdir    %{_defaultdocdir}/kde/HTML
 
 # unsermake script
 #      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}\
@@ -118,6 +121,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}
 
@@ -170,7 +199,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
@@ -226,7 +255,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
@@ -258,10 +287,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
@@ -462,6 +491,14 @@ CPPFLAGS="${CPPFLAGS:-%{rpmcppflags}}" \\\
 %{__cmake} \\\
        -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \\\
        -DCMAKE_BUILD_TYPE=%{!?debug:TLD}%{?debug:Debug} \\\
+       -DCMAKE_SYSTEM_NAME=Linux \\\
+       -DCMAKE_SYSTEM_VERSION="%(uname -r)" \\\
+       -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} \\\
@@ -494,6 +531,7 @@ CPPFLAGS="${CPPFLAGS:-%{rpmcppflags}}" \\\
        -DBUILD_SHARED_LIBS:BOOL=ON \\\
 %{nil}
 
+# scons (since 1.385)
 %scons { \
 %{__scons} \
        LDFLAGS="${LDFLAGS:-%rpmldflags}" \
@@ -507,7 +545,7 @@ CPPFLAGS="${CPPFLAGS:-%{rpmcppflags}}" \\\
        prefix=%{_prefix} \
 }
 
-# waf. see waf.spec
+# waf. see waf.spec (since 1.336)
 %waf { \
 CC="%{__cc}" \
 CXX="%{__cxx}" \
@@ -518,7 +556,7 @@ LINKFLAGS="%{rpmldflags}" \
 %{__waf} \
 }
 
-# meson
+# meson (since 1.727)
 %meson { \
 %{?__cc:CC="${CC:-%{__cc}}"} \
 %{?__cxx:CXX="${CXX:-%{__cxx}}"} \
@@ -526,6 +564,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} \
@@ -550,7 +590,7 @@ LC_ALL=C.UTF-8 %{__meson} \
 %meson_install %___meson_deprecate meson_install ninja_install
 %meson_test %___meson_deprecate meson_test ninja_test
 
-# ninja
+# ninja (since 1.736)
 %ninja_build LC_ALL=C.UTF-8 %{__ninja} %{__ninja_common_opts}
 %ninja_install LC_ALL=C.UTF-8 DESTDIR=%{buildroot} %{__ninja} install %{__ninja_common_opts}
 %ninja_test LC_ALL=C.UTF-8 %{__ninja} test %{__ninja_common_opts}
@@ -624,11 +664,11 @@ LC_ALL=C.UTF-8 %{__meson} \
 %__without_if() %{expand:%%{?with_%{1}:--without-%{?2}%{!?2:%{1}}}}
 %__with_without_not() %{expand:%%{!?with_%{1}:--with-%{?2}%{!?2:%{1}}%{?3:=%{3}}}%%{?with_%{1}:--without-%{?2}%{!?2:%{1}}}}
 
-# expands to true or false based on bcond; for use with meson or cmake
+# expands to true or false based on bcond; for use with meson or cmake (since 1.729)
 %__true_false() %{expand:%%{?with_%{1}:true}%%{!?with_%{1}:false}}
 %__true_false_not() %{expand:%%{?with_%{1}:false}%%{!?with_%{1}:true}}
 
-# expands to enabled or disabled based on bcond; for use with meson or cmake
+# expands to enabled or disabled based on bcond; for use with meson or cmake (since 2.000)
 %__enabled_disabled() %{expand:%%{?with_%{1}:enabled}%%{!?with_%{1}:disabled}}
 %__enabled_disabled_not() %{expand:%%{?with_%{1}:disabled}%%{!?with_%{1}:enabled}}
 
@@ -666,12 +706,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
@@ -800,7 +840,7 @@ if [ -d "$RPM_BUILD_ROOT" ]; then \
                        echo "DONE"; \
                fi; \
        fi; \
-       filelist=$(find $RPM_BUILD_ROOT -type f ! -regex ".*/usr/lib[x0-9]*/debug/.*\.debug" ! -regex ".*/usr/lib[x0-9]*.*/guile/.*\.go" ! -regex ".*/lib/modules/.*" ! -regex ".*%{_docdir}/.*" ! -regex ".*%{_includedir}/.*" %{?_noautostrip:! -regex "%{_noautostrip}"} %{?_autostripall:! -regex "%{_autostripall}"} %{?_autostripunneeded:! -regex "%{_autostripunneeded}"} %{?_autostripdebug:! -regex "%{_autostripdebug}"}); \
+       filelist=$(find $RPM_BUILD_ROOT  ! \( -path "*/usr/src/debug" -prune \) -type f ! -regex ".*/usr/lib[x0-9]*/debug/.*\.debug" ! -regex ".*/usr/lib[x0-9]*.*/guile/.*\.go" ! -regex ".*/lib/modules/.*" ! -regex ".*%{_docdir}/.*" ! -regex ".*%{_includedir}/.*" %{?_noautostrip:! -regex "%{_noautostrip}"} %{?_autostripall:! -regex "%{_autostripall}"} %{?_autostripunneeded:! -regex "%{_autostripunneeded}"} %{?_autostripdebug:! -regex "%{_autostripdebug}"}); \
        if [ -n "$filelist" ]; then \
                filetypes=`echo "$filelist" | xargs -r -d'\\n' file`; \
                elfexelist=`echo "$filetypes" | awk -F: '/ELF.*executable/ {print $1}'`; \
@@ -1000,7 +1040,7 @@ __spec_install_post_check_shebangs() { \
 %_soname_prov() %(echo "%{1}()%{_soname_tag}" | sed -e 's/^\\([^(]*([^)]\\+)\\)()%{_soname_tag}$/\\1%{_soname_tag}/;s/()$//')
 
 #-----------------------------------------------------------------
-# Update GConf2 schemas
+# Update GConf2 schemas (since 1.198)
 #
 # Requires: GConf2
 #
@@ -1019,7 +1059,7 @@ fi; \
 %{nil}
 
 #-----------------------------------------------------------------
-# Update desktop MIME database
+# Update desktop MIME database (since 1.198)
 # requires: desktop-file-utils
 %update_desktop_database() {{ \
        umask 022; \
@@ -1037,7 +1077,7 @@ fi; \
 %{nil}
 
 #-----------------------------------------------------------------
-# Update shared MIME info database
+# Update shared MIME info database (since 1.311)
 # requires: shared-mime-info
 # Note:        https://bugs.freedesktop.org/show_bug.cgi?id=70366#c19
 #      https://bugzilla.redhat.com/show_bug.cgi?id=1052173
@@ -1068,7 +1108,7 @@ fi; \
 %{nil}
 
 #-----------------------------------------------------------------
-# Update scrollkeeper database
+# Update scrollkeeper database (since 1.198)
 # requires: scrollkeeper
 #
 %scrollkeeper_update_post() \
@@ -1082,7 +1122,7 @@ fi; \
 %{nil}
 
 #-----------------------------------------------------------------
-# Compile GSettings schemas
+# Compile GSettings schemas (since 1.592)
 # requires: glib2 >= 1:2.26.0
 #
 %glib_compile_schemas() {{ \
@@ -1132,10 +1172,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++) {
@@ -1174,7 +1216,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}
@@ -1206,7 +1248,7 @@ fi; \
 # BuildRequires:       rpmbuild(macros) >= 1.719
 %zsh_compdir           /usr/share/zsh/site-functions
 
-# depmod macro
+# depmod macro (since 1.184)
 %depmod() { \
 umask 022; \
 if [ -e /boot/System.map-%1 ]; then \
@@ -1220,7 +1262,7 @@ else \
 fi; \
 }
 
-# user/group checking macros
+# user/group checking macros (since 1.202)
 #
 # Usage:
 #      %userremove myuser
@@ -1250,7 +1292,7 @@ fi; \
 %addusertogroup(q)     quiet=%{-q:1} /usr/lib/rpm/user_group.sh user addtogroup %*; \
 %{nil}
 
-# banner support (useful in {pre,post}{,un} and triggers)
+# banner support (useful in {pre,post}{,un} and triggers) (since 1.194)
 #
 # Usage:
 #      %banner name [-a] [-e] [-n] [-tn] [-o] <<EOF
@@ -1264,7 +1306,7 @@ fi; \
 # -e   - send to stderr instead of stdout
 # -n   - don't show banner (overrides -t)
 # -t   - show only, if RPM_SCRIPTVERBOSITY >= n; default n=5
-# -o   - show only once, i.e when package is installed for the first time
+# -o   - show only once, i.e when package is installed for the first time (since 1.595)
 #
 # Tests:
 # (rpm -E '%banner -e banner <<EOF'; echo -e 'hi\nEOF') > m; sh -x m
@@ -1284,7 +1326,7 @@ fi \
 eval $CMD %{?2:%2}%{?3: %3})%{-o:)} \
 %{nil}
 
-# useradd/groupadd macros
+# useradd/groupadd macros (since 1.202)
 # Author: Elan Ruusamäe <glen@pld-linux.org>
 #
 # Usage: