X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=rpm.macros;h=5b816901c6a35700e64b8f41b4da0c131cb9fe0a;hb=1b3501f3984b28ab3ac68f1d4451f3b857ee5dae;hp=5dadd816e1340214b4fd3dd6f95410c2a94e665d;hpb=d1a9e7796319d17d0020699f9b82c730da54f1d6;p=packages%2Frpm-build-macros.git diff --git a/rpm.macros b/rpm.macros index 5dadd81..5b81690 100644 --- a/rpm.macros +++ b/rpm.macros @@ -16,8 +16,8 @@ %kgcc_package gcc # compiler version -%cc_version %{expand:%%global cc_version %(%{__cc} -dumpversion || echo ERROR)}%cc_version -%cxx_version %{expand:%%global cxx_version %(%{__cxx} -dumpversion || echo ERROR)}%cxx_version +%cc_version %{expand:%%global cc_version %(%{__cc} -dumpversion 2>/dev/null || echo 0.0)}%cc_version +%cxx_version %{expand:%%global cxx_version %(%{__cxx} -dumpversion 2>/dev/null || echo 0.0)}%cxx_version %__rm /bin/rm --interactive=never @@ -245,20 +245,21 @@ %{?__cc:CC="%{__cc}"} \\\ %{?__cxx:CXX="%{__cxx}"} \\\ CPPFLAGS="${CPPFLAGS:-%{rpmcppflags}}" \\\ -CFLAGS="${CFLAGS:-%{rpmcflags}}" \\\ -FFLAGS="${FFLAGS:-%{rpmcflags}}" \\\ -FCFLAGS="${FCFLAGS:-%{rpmcflags}}" \\\ -CXXFLAGS="${CXXFLAGS:-%{rpmcxxflags}}" \\\ -LDFLAGS="${LDFLAGS:-%{rpmldflags}}" \\\ %{__cmake} \\\ -DCMAKE_VERBOSE_MAKEFILE=ON \\\ - -DCMAKE_BUILD_TYPE=%{!?debug:Release}%{?debug:Debug} \\\ + -DCMAKE_BUILD_TYPE=%{!?debug:PLD}%{?debug:Debug} \\\ -DCMAKE_INSTALL_LIBDIR:PATH=%{_libdir} \\\ -DCMAKE_INSTALL_PREFIX:PATH=%{_prefix} \\\ -DINCLUDE_INSTALL_DIR:PATH=%{_includedir} \\\ -DLIB_INSTALL_DIR:PATH=%{_libdir} \\\ -DSHARE_INSTALL_PREFIX:PATH=%{_datadir} \\\ -DSYSCONF_INSTALL_DIR:PATH=%{_sysconfdir} \\\ + -DCMAKE_CXX_FLAGS_PLD="${CXXFLAGS:-%{rpmcxxflags} -DNDEBUG}" \\\ + -DCMAKE_C_FLAGS_PLD="${CFLAGS:-%{rpmcflags} -DNDEBUG}" \\\ + -DCMAKE_Fortran_FLAGS_PLD="${CFLAGS:-%{rpmcflags} -DNDEBUG}" \\\ + -DCMAKE_EXE_LINKER_FLAGS_PLD="${LDFLAGS:-%{rpmldflags}}" \\\ + -DCMAKE_SHARED_LINKER_FLAGS_PLD="${LDFLAGS:-%{rpmldflags}}" \\\ + -DCMAKE_MODULE_LINKER_FLAGS_PLD="${LDFLAGS:-%{rpmldflags}}" \\\ %if "%{_lib}" == "lib64" \ -DLIB_SUFFIX=64 \\\ %endif \ @@ -748,9 +749,12 @@ fi; \ # Requires: hicolor-icon-theme # %update_icon_cache() {{ \ - %{!?1:%{error:%{0}: Required icon dir missing}exit 1} \ - umask 022; \ - [ -x /usr/bin/gtk-update-icon-cache ] && /usr/bin/gtk-update-icon-cache -qf %{_datadir}/icons/%1 || :; \ + %{!?1:%{error:%{0}: Required theme name missing}} \ + if [ -x /usr/bin/gtk-update-icon-cache ]; then \ + umask 022; \ + touch --no-create %{_iconsdir}/%1; \ + /usr/bin/gtk-update-icon-cache -qf %{_iconsdir}/%1; \ + fi; \ };} \ %{nil} @@ -1853,7 +1857,7 @@ io.open("/etc/shells", "w"):write(s)\ # # Requirements: # BuildRequires: python -# BuildRequires: rpmbuild(macros) >= 1.469 +# BuildRequires: rpmbuild(macros) >= 1.602 %py_lint() \ __py_lint() { \ @@ -1861,22 +1865,26 @@ find "$@" -type f -name '*.py' | python -c ' \ import sys \ import compiler \ \ -err = 0\ +found = err = 0\ for f in sys.stdin: \ - fd = open(f.strip()) \ + fd = open(f.rstrip()) \ c = fd.read() \ fd.close() \ + found = found + 1 \ try: \ compiler.parse(c) \ except SyntaxError, e: \ - print "py_lint: %s: %s" % (f.strip(), e) \ + print "py_lint: %s: %s" % (f.rstrip(), e) \ err = err + 1\ \ -if err: \ +if not found:\ + print >> sys.stderr, "\\npy_lint: ERROR: No files processed.\\n" \ + sys.exit(1) \ +elif err: \ print >> sys.stderr, "\\npy_lint: ERROR: Syntax errors in %d files.\\n" % err \ sys.exit(1) \ else: \ - print >> sys.stderr, "py_lint: Found no syntax errors." \ + print >> sys.stderr, "py_lint: %d files scanned, found no syntax errors." % found \ ' \ }; __py_lint %* \ %{nil}