%ifdef() %if %{expand:%%{?%{1}:1}%%{!?%{1}:0}}
%ifndef() %if %{expand:%%{?%{1}:0}%%{!?%{1}:1}}
+# Shorthand for %{defined with_...}
+%with() %{expand:%%{?with_%{1}:1}%%{!?with_%{1}:0}}
+%without() %{expand:%%{?with_%{1}:0}%%{!?with_%{1}:1}}
+
+# Shorthand for %if %{with ...}
+%ifwith() %if %{expand:%%{?with_%{1}:1}%%{!?with_%{1}:0}}
+%ifwithout() %if %{expand:%%{?with_%{1}:0}%%{!?with_%{1}:1}}
+
# Handle conditional builds. %bcond_with is for case when feature is
# default off and needs to be activated with --with ... command line
# switch. %bcond_without is for the dual case.
# unchanged
%pyrequires_eq() Requires: %1 >= %py_ver %1 < %(echo `python -c "import sys; import string; ver=sys.version[:3].split('.'); ver[1]=str(int(ver[1])+1); print string.join(ver, '.')"`)
+# depmod macro
+%depmod() { \
+if [ -e /boot/System.map-%1 ]; then \
+ /sbin/depmod -a -F /boot/System.map-%1 %1; \
+else \
+ if [ -e /boot/System.map ]; then \
+ /sbin/depmod -a -F /boot/System.map %1; \
+ else \
+ /sbin/depmod -a %1; \
+ fi \
+fi; \
+}
+