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; \
# Requires: rc-scripts
# -n option:
# BuildRequires: rpmbuild(macros) >= 1.450
-%service(qn) {{%(export noop=%{-n:1} quiet=%{-q:1}; /usr/lib/rpm/service_generator.sh %{*}) };}
-
+%service(qn) {{%(export noop=%{-n:1} quiet=%{-q:1} RPM_BUILD_ROOT=%{buildroot}; /usr/lib/rpm/service_generator.sh %{*}) };}
# Java macros. based on jpackage macros.java
#
# %cacti_import_template %{resourcedir}/cacti_host_template_varnish.xml
#
# Requires: cacti >= 0.8.7e-8
-# BuildRequires: rpmbuild(macros) >= 1.554
+# BuildRequires: rpmbuild(macros) >= 1.630
+# Note: 1.1 (cacti-0.8.7h) adds requirement for --with-template-rras or --with-user-rras option
%cacti_import_template() {\
-/usr/share/cacti/cli/import_template.php --filename=%1 || :; \
+v=$(%{__sed} -rne 's/.+Add Graphs Script ([0-9\.]+).+/\1/p' /usr/share/cacti/cli/import_template.php); \
+if [ "$v" != "1.0" ]; then \
+ rra="--with-template-rras"; \
+fi; \
+/usr/share/cacti/cli/import_template.php --filename=%1 $rra || :; \
}%{nil}
# pre/post script for -upstart subpackages
# Author: Bartlomiej Zimon <uzi18@o2.pl>
#
# Usage:
-# %systemd_post
-# %systemd_enable service_name.service
-# %systemd_preun service_name.service
-# %systemd_postun service_name.service
+# %systemd_reload
+# %systemd_post service_name1.service service_name2.service
+# %systemd_preun service_name1.service service_name2.service
#
# Sample:
# %post systemd
-# %systemd_post
+# %systemd_reload
# or if service must be enabled by default:
# %post systemd
-# %systemd_post
-# %systemd_enable %{name}
+# %systemd_post %{name}.service
#
# %preun systemd
-# %systemd_preun %{name}
+# %systemd_preun %{name}.service
#
# %postun systemd
-# %systemd_postun %{name}
+# %systemd_reload
#
# Requirements:
-# BuildRequires: rpmbuild(macros) >= 1.622
-# Requires: rc-scripts >= ...
+# BuildRequires: rpmbuild(macros) >= 1.627
+# Requires: systemd-units >= 37-0.10
-%systemd_enable() \
- if [ $1 -eq 1 ]; then \
- /bin/systemctl enable %1 >/dev/null 2>&1 || : \
- fi
+%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 daemon-reload >/dev/null 2>&1 || : \
- fi
+ /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 \
- /bin/systemctl --no-reload disable %1 > /dev/null 2>&1 || : \
- /bin/systemctl stop %1 > /dev/null 2>&1 || : \
- fi
-
-%systemd_postun() \
- /bin/systemctl daemon-reload >/dev/null 2>&1 || : \
- if [ $1 -ge 1 ]; then \
- /bin/systemctl try-restart %1 >/dev/null 2>&1 || : \
- fi
+ 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