]> git.pld-linux.org Git - packages/rpm-pld-macros.git/blobdiff - macros.pld
fix cmake's verbose makefile flag
[packages/rpm-pld-macros.git] / macros.pld
index 01f5f0ffb550dc5303689989d257998c4118cefa..e669a0fc6813e791eae2bc33eff877dcbcc1b1ce 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
 
@@ -126,13 +128,6 @@ pakietu oraz przy odpluskwianiu samego pakietu.\
 %__rc                  %{_bindir}/rc
 %__xar                 %{_bindir}/xar
 
-%_tmppath              %(echo "${TMPDIR:-/var/tmp}")
-%tmpdir                        %{_tmppath}
-
-%_topdir               %(echo $HOME)/rpm
-
-%buildroot             %{_tmppath}/%{name}-%{version}-root-%(id -u -n)
-
 %_source_payload       w9.gzdio
 %_binary_payload       w6.xzdio
 
@@ -277,6 +272,12 @@ pakietu oraz przy odpluskwianiu samego pakietu.\
        fi; \
 )}%_topdir
 
+%_tmppath              %(echo "${TMPDIR:-/var/tmp}")
+%tmpdir                        %{_tmppath}
+
+%_buildrootdir %{_tmppath}
+%buildroot             %{_buildrootdir}/%{name}-%{version}-%{_arch}-root-%(id -u -n)
+
 # if %{_topdir}/SPECS exists, it's old style structure
 %_specdir              %{expand:%%global _specdir %([ ! -d %{_topdir}/SPECS ] && echo %{_topdir}/%{name} || echo %{_topdir}/SPECS)}%_specdir
 %_sourcedir            %{expand:%%global _sourcedir %([ ! -d %{_topdir}/SOURCES ] && echo %{_specdir} || echo %{_topdir}/SOURCES)}%_sourcedir
@@ -458,7 +459,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} \\\
@@ -671,6 +672,17 @@ LC_ALL=C.UTF-8 %{__meson} \
 Obsoletes: %{1} < %{?epoch:%{epoch}:}%{?version:%{version}}%{?release:-%{release}} \
 Provides: %{1} = %{?epoch:%{epoch}:}%{?version:%{version}}%{?release:-%{release}}
 
+# for package versions comparison (incl. cc_version or _rpmversion)
+# BuildRequires:       rpmbuild(macros) >= 1.749
+%_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
@@ -962,9 +974,9 @@ __spec_install_post_check_tmpfiles() { \
 %__spec_install_post_check_shebangs { \
 __spec_install_post_check_shebangs() { \
 %{!?debug:set +x;} \
-       fail=0; \
        echo "Checking script shebangs..."; \
-       for f in $(find $RPM_BUILD_ROOT -type f -perm -500 -print); do \
+       fail=` \
+       find $RPM_BUILD_ROOT -type f -perm -500 -print | { fail=0; while IFS= read -r f; do \
                shebang="$(sed -e'1s/#! *\(.*\)/\1/;t;d;q' "$f")" ; \
                f="${f##$RPM_BUILD_ROOT}"; \
                case "$shebang" in \
@@ -983,6 +995,8 @@ __spec_install_post_check_shebangs() { \
                        *) ;;\
                esac ; \
        done ; \
+       echo "$fail" ; \
+       }`; \
        echo " DONE" ; \
         %{!?no_install_post_check_shebangs:return $fail;} \
 }; __spec_install_post_check_shebangs }}
@@ -1094,6 +1108,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
@@ -1107,7 +1129,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}}} \
@@ -1119,6 +1140,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}}} \
@@ -1127,6 +1149,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:
@@ -1390,10 +1433,10 @@ fi;
        start=$(expr $base + %1);
        end=$(expr $base + %{?2}%{!?2:%{1}});
        # we need to call seq twice as it doesn't allow two formats
-       seq -f 'Patch%g:' $start $end > %{tmpdir}/__ps1;
-       seq -f '%{-f*}' %1 %{?2}%{!?2:%{1}} > %{tmpdir}/__ps2;
-       paste %{tmpdir}/__ps{1,2};
-       rm -f %{tmpdir}/__ps{1,2};
+       seq -f 'Patch%g:' $start $end > %{_tmppath}/__ps1;
+       seq -f '%{-f*}' %1 %{?2}%{!?2:%{1}} > %{_tmppath}/__ps2;
+       paste %{_tmppath}/__ps{1,2};
+       rm -f %{_tmppath}/__ps{1,2};
 }
 ) \
 %{nil}
This page took 0.101242 seconds and 4 git commands to generate.