#%no_install_post_compress_docs 1
%__spec_install_post_compress_docs { \
%{!?no_install_post_compress_docs:__spec_install_post_compress_docs() { \
- %{!?debug:set +x}; \
+ %{!?debug:set +x;} \
for i in /usr/share/man /usr/X11R6/man; do \
if [ -d "$RPM_BUILD_ROOT$i" ]; then \
echo "Compress man pages: $i"; \
#
%__spec_install_post_strip {%{!?debug: \
%{!?no_install_post_strip:__spec_install_post_strip() { \
-%{!?debug:set +x}; \
+%{!?debug:set +x;} \
if [ -d "$RPM_BUILD_ROOT" ]; then \
if [ -d $RPM_BUILD_ROOT/lib/modules ]; then \
modulelist=$(find $RPM_BUILD_ROOT/lib/modules -name '*o' -type f -print); \
modulecount=$(echo "$modulelist" | wc -l); \
printf "Stripping %d kernel modules..." $modulecount; \
echo "$modulelist" | xargs -l512 chmod u+w; \
- echo "$modulelist" | xargs -l512 %{__strip} --strip-unneeded --remove-section=.comment --remove-section=.note.GNU-stack; \
+ echo "$modulelist" | xargs -l512 %{__strip} -g --remove-section=.comment --remove-section=.note.GNU-stack; \
echo "DONE"; \
fi; \
fi; \
#
%__spec_install_post_chrpath {%{!?debug: \
%{!?no_install_post_chrpath: __spec_install_post_chrpath() { \
-%{!?debug:set +x}; \
+%{!?debug:set +x;} \
if [ -d "$RPM_BUILD_ROOT" ]; then \
files=`find $RPM_BUILD_ROOT -type f ! -regex ".*ld-[0-9.]*so.*" ! -regex ".*/usr/lib[0-9]*/debug/.*" ! -regex ".*/lib/modules/.*" ! -regex ".*%{_docdir}/.*" ! -regex ".*%{_includedir}/.*" %{?_noautochrpath:! -regex "%{_noautochrpath}"}`; \
if [ -n "$files" ]; then \
#
%__spec_install_post_check_so { \
__spec_install_post_check_so() { \
-%{!?debug:set +x}; \
+%{!?debug:set +x;} \
fail=0; \
printf "Searching for shared objects with unresolved symbols..."; \
for f in $(find $RPM_BUILD_ROOT -type f -name '*.so.*' -print); do \
#%no_install_post_compress_modules 1
%__spec_install_post_compress_modules { \
%{!?no_install_post_compress_modules: __spec_install_post_compress_modules() { \
-%{!?debug:set +x}; \
+%{!?debug:set +x;} \
if [ -d $RPM_BUILD_ROOT/lib/modules ]; then \
q=$(find $RPM_BUILD_ROOT/lib/modules -name '*o' -type f -print); \
if [ "$q" ]; then \
# Hardlink binary identical .pyc and .pyo files
%__spec_install_post_py_hardlink {\
%{!?no_install_post_py_hardlink: __spec_install_post_py_hardlink() { \
-%{!?debug:set +x}; \
+%{!?debug:set +x;} \
local a b c=0 t=0; \
if [ -d "$RPM_BUILD_ROOT" ]; then \
find "$RPM_BUILD_ROOT" -name '*.pyc' > __rpm_pyc; \
%endif \
\
%{!?-c:%{__make} -C %{_kernelsrcdir} clean \\\
- RCS_FIND_IGNORE="-name '*.ko' -o" \\\
+ RCS_FIND_IGNORE="-name '*.[ks]o' -o" \\\
${1+"$@"} \\\
M=$PWD %{MakeOpts}} \
\
%{__make} -C %{_kernelsrcdir} modules \\\
${1+"$@"} \\\
- M=$PWD %{MakeOpts} \
+ M=$PWD CONSTIFY_PLUGIN="" %{MakeOpts} \
\
for MODULE in {%{-m*},}; do \
[ -z "${MODULE}" ] || mv ${MODULE}{,-$cfg}.ko \
%define ModprobeD $RPM_BUILD_ROOT%{_sysconfdir}/modprobe.d/%{_kernel_ver} \
\
__install_kernel_modules() { \
-%{!?debug:set +x}; \
+%{!?debug:set +x;} \
local cfgs='%{?with_dist_kernel:%{?with_smp: smp}%{?with_up: up}}%{!?with_dist_kernel: nondist}' \
\
for MODULE in {%{-m*},}; do \
%py_lint() \
__py_lint() { \
-%{!?debug:set +x}; \
+%{!?debug:set +x;} \
find "$@" -type f -name '*.py' | python -c ' \
import sys \
import compiler \
};} \
%{nil}
+
+# pre/post script for -systemd subpackages
+#
+# Author: Bartlomiej Zimon <uzi18@o2.pl>
+#
+# Usage:
+# %systemd_reload
+# %systemd_post service_name1.service service_name2.service
+# %systemd_preun service_name1.service service_name2.service
+#
+# Sample:
+# %post systemd
+# %systemd_reload
+# or if service must be enabled by default:
+# %post systemd
+# %systemd_post %{name}.service
+#
+# %preun systemd
+# %systemd_preun %{name}.service
+#
+# %postun systemd
+# %systemd_reload
+#
+# Requirements:
+# BuildRequires: rpmbuild(macros) >= 1.627
+# Requires: systemd-units >= 37-0.10
+
+%systemd_reload /bin/systemd_booted && SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog /bin/systemctl --quiet daemon-reload || :
+
+%systemd_post() \
+ export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog \
+ /bin/systemd_booted && /bin/systemctl --quiet daemon-reload || : \
+ if [ $1 -eq 1 ]; then \
+ /bin/systemctl --quiet enable %{*} || : \
+ fi \
+ if [ $1 -gt 1 ] && [ -z "$NORESTART" ]; then \
+ /bin/systemctl --quiet try-restart %{*} || : \
+ fi \
+%{nil}
+
+%systemd_preun() \
+ if [ $1 -eq 0 ]; then \
+ export SYSTEMD_LOG_LEVEL=warning SYSTEMD_LOG_TARGET=syslog; \
+ /bin/systemctl --no-reload --quiet disable %{*} || : \
+ if /bin/systemd_booted; then \
+ /bin/systemctl --quiet stop %{*} || : \
+ fi \
+ fi \
+%{nil}
+
+%systemdunitdir /lib/systemd/system
+
# EOF