]> git.pld-linux.org Git - packages/rpm-pld-macros.git/blobdiff - macros.pld
- fix py3_ver macro for python 3.10, bump ver to 2.013
[packages/rpm-pld-macros.git] / macros.pld
index d65137d6f045cd14078046e2d4047dd262183dbb..377d6d504eead2a1936d1706d09a0498da1fb491 100644 (file)
@@ -21,7 +21,9 @@
 #
 %_sharedstatedir       /var/lib
 %_localstatedir                /var
-%_initrddir            %{_sysconfdir}/rc.d/init.d
+%_localedir                    %{_datadir}/locale
+%_lispdir                      %{_datadir}/emacs/site-lisp
+%_initddir                     %{_sysconfdir}/rc.d/init.d
 
 %_defaultdocdir                %{_usr}/share/doc
 
@@ -96,9 +98,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}\
@@ -115,6 +115,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}
 
@@ -167,7 +193,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
@@ -223,7 +249,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
@@ -457,7 +483,7 @@ pakietu oraz przy odpluskwianiu samego pakietu.\
 %{?__cxx:CXX="${CXX:-%{__cxx}}"} \\\
 CPPFLAGS="${CPPFLAGS:-%{rpmcppflags}}" \\\
 %{__cmake} \\\
-       -DCMAKE_VERBOSE_MAKEFILE=BOOL:ON \\\
+       -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON \\\
        -DCMAKE_BUILD_TYPE=%{!?debug:PLD}%{?debug:Debug} \\\
        -DCMAKE_INSTALL_BINDIR:PATH=%{_bindir} \\\
        -DCMAKE_INSTALL_SBINDIR:PATH=%{_sbindir} \\\
@@ -625,6 +651,10 @@ LC_ALL=C.UTF-8 %{__meson} \
 %__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
+%__enabled_disabled() %{expand:%%{?with_%{1}:enabled}%%{!?with_%{1}:disabled}}
+%__enabled_disabled_not() %{expand:%%{?with_%{1}:disabled}%%{!?with_%{1}:enabled}}
+
 # for use with cmake:
 # Usage: cmake_on_off BCOND_NAME [OPTION_NAME]
 # BuildRequires: rpmbuild(macros) >= 1.742
@@ -640,6 +670,8 @@ LC_ALL=C.UTF-8 %{__meson} \
 %%prep\
 %{nil}
 
+%_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
 
@@ -675,6 +707,12 @@ Provides: %{1} = %{?epoch:%{epoch}:}%{?version:%{version}}%{?release:-%{release}
 %_ver_lt()     %(test $(rpmvercmp "%{1}" "%{2}" >/dev/null 2>&1; echo $?) -ne 2; echo $?)
 %_ver_ge()     %(test $(rpmvercmp "%{1}" "%{2}" >/dev/null 2>&1; echo $?) -eq 2; echo $?)
 
+# noarch subpackage helper
+# BuildRequires:       rpmbuild(macros) >= 1.752
+%noarchpackage \
+BuildArch:             noarch \
+%{nil}
+
 %apache_modules_api %{expand:%%global apache_modules_api %(awk '/#define MODULE_MAGIC_NUMBER_MAJOR/ {print $3}' /usr/include/apache/ap_mmn.h 2>/dev/null || echo ERROR)}%apache_modules_api
 
 # sgml macros
@@ -1100,6 +1138,14 @@ fi; \
 };} \
 %{nil}
 
+# BuildRequires:       rpmbuild(macros) >= 1.751
+# Requires(post,postun):       /usr/bin/texhash        # if you want to ensure cache is updated
+%texhash() {{ \
+       umask 022; \
+       /usr/bin/texhash >&2; \
+};} \
+%{nil}
+
 #-----------------------------------------------------------------
 # post %install sequence:
 # - autodeps exceptions
@@ -1113,7 +1159,6 @@ fi; \
 #
 %__noautoreqfiles      %(sed -e s'/#.*//' /etc/rpm/noautoreqfiles)%{?_noautoreqfiles: %{_noautoreqfiles}}
 %__noautoprovfiles     %(sed -e s'/#.*//' /etc/rpm/noautoprovfiles)%{?_noautoprovfiles: %{_noautoprovfiles}}
-%__noautoreqdep                %(sed -e s'/#.*//' /etc/rpm/noautoreqdep)%{?_noautoreqdep: %{_noautoreqdep}}
 %__noautoprov          %(sed -e s'/#.*//' /etc/rpm/noautoprov) \
        %{?_noautoprov: %{_noautoprov}} \
        %{?_noautoprov_java: %{__noauto_regexp_helper -p java %{_noautoprov_java}}} \
@@ -1125,6 +1170,7 @@ fi; \
        %{nil}
 %__noautoreq           %(sed -e s'/#.*//' /etc/rpm/noautoreq) \
        %{?_noautoreq: %{_noautoreq}} \
+       %{?_noautoreqdep: %{_noautoreqdep}} \
        %{?_noautoreq_java: %{__noauto_regexp_helper -p java %{_noautoreq_java}}} \
        %{?_noautoreq_mono: %{__noauto_regexp_helper -p mono %{_noautoreq_mono}}} \
        %{?_noautoreq_pear: %{__noauto_regexp_helper -p pear %{_noautoreq_pear}}} \
@@ -1133,6 +1179,27 @@ fi; \
        %{?_noautoreq_py3egg: %{__noauto_regexp_helper -p python3egg %{_noautoreq_py3egg}}} \
        %{nil}
 
+%__noautodep_helper() %(awk -v x="%*" 'BEGIN {
+       RS = "\n([ \t]+\n)+";
+       FS = " ";
+       split(x, F);
+       if (length(F) > 0) {
+               printf("(");
+               for (i=1; i<=length(F); i++) {
+                       s = F[i];
+                       sub(/#.*/, "z&z", s);
+                       if (s ~ /^$/) { continue; };
+                       printf(s);
+                       if (i != length(F)) { printf("|"); };
+               };
+               printf(")");
+       }
+}')
+%__requires_exclude_from       %{__noautodep_helper %{__noautoreqfiles}}%{nil}
+%__provides_exclude_from       %{__noautodep_helper %{__noautoprovfiles}}%{nil}
+%__requires_exclude                    %{__noautodep_helper %{__noautoreq}}%{nil}
+%__provides_exclude                    %{__noautodep_helper %{__noautoprov}}%{nil}
+
 # helper for wrapping _noautoreq between perl() or pear()
 # Author: Elan Ruusamäe <glen@pld-linux.org>
 # Usage:
This page took 0.115411 seconds and 4 git commands to generate.