#
%_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
%__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
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
%{?__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} \\\
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
%__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 \
*) ;;\
esac ; \
done ; \
+ echo "$fail" ; \
+ }`; \
echo " DONE" ; \
%{!?no_install_post_check_shebangs:return $fail;} \
}; __spec_install_post_check_shebangs }}
};} \
%{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
#
%__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}}} \
%{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}}} \
%{?_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:
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}