--sharedstatedir=%{_sharedstatedir} \
--mandir=%{_mandir} \
--infodir=%{_infodir} \
- --x-libraries=/usr/X11R6/%{_lib} \
+ --x-libraries=%{?_x_libraries}%{!?_x_libraries:%{_libdir}} \
%{dependencytracking} \
}
--sharedstatedir=%{_sharedstatedir} \
--mandir=%{_mandir} \
--infodir=%{_infodir} \
- --x-libraries=/usr/X11R6/%{_lib} \
+ --x-libraries=%{?_x_libraries}%{!?_x_libraries:%{_libdir}} \
%{dependencytracking} \
%{?configure_cache:--cache-file=%{configure_cache_file:-%{buildroot}.configure.cache}} \
}
# Requires name = version-release
%requires_releq() %(echo '%*' | LC_ALL="C" xargs -r rpm -q --qf 'Requires: %%{name} = %%{epoch}:%%{version}-%%{release}\\n' | sed -e 's/ (none):/ /' | grep -v "is not")
-%releq_kernel_up() %(LC_ALL="C" rpm -qf --qf '%%{name}-up = %%{epoch}:%%{version}-%%{release}\\n' %{_kernelsrcdir}/include/linux/version.h | sed -e 's/ (none):/ /' | sed -e 's:-headers::' | grep -vE "(is not|no such)")
-%releq_kernel_smp() %(LC_ALL="C" rpm -qf --qf '%%{name}-smp = %%{epoch}:%%{version}-%%{release}\\n' %{_kernelsrcdir}/include/linux/version.h | sed -e 's/ (none):/ /' | sed -e 's:-headers::' | grep -vE "(is not|no such)")
-%requires_releq_kernel_up() %(LC_ALL="C" rpm -qf --qf 'PreReq: %%{name}-up = %%{epoch}:%%{version}-%%{release}\\n' %{_kernelsrcdir}/include/linux/version.h | sed -e 's/ (none):/ /' | sed -e 's:-headers::' | grep -vE "(is not|no such)")
-%requires_releq_kernel_smp() %(LC_ALL="C" rpm -qf --qf 'PreReq: %%{name}-smp = %%{epoch}:%%{version}-%%{release}\\n' %{_kernelsrcdir}/include/linux/version.h | sed -e 's/ (none):/ /' | sed -e 's:-headers::' | grep -vE "(is not|no such)")
+%releq_kernel_up() %(LC_ALL="C" rpm -qf --qf '%%{name}-up = %%{epoch}:%%{version}-%%{release}\\n' %{_kernelsrcdir}/include/linux/version.h 2>/dev/null || echo ERROR | sed -e 's/ (none):/ /' | sed -e 's:-headers::' | grep -vE "(is not|no such)")
+%releq_kernel_smp() %(LC_ALL="C" rpm -qf --qf '%%{name}-smp = %%{epoch}:%%{version}-%%{release}\\n' %{_kernelsrcdir}/include/linux/version.h 2>/dev/null || echo ERROR | sed -e 's/ (none):/ /' | sed -e 's:-headers::' | grep -vE "(is not|no such)")
+%requires_releq_kernel_up(s:) Requires%{-s:(%{-s*})}: %releq_kernel_up
+%requires_releq_kernel_smp(s:) Requires%{-s:(%{-s*})}: %releq_kernel_smp
+%requires_eq() %(echo '%*' | LC_ALL="C" xargs -r rpm -q --qf 'Requires: %%{name} = %%{epoch}:%%{version}\\n' | sed -e 's/ (none):/ /' -e 's/ 0:/ /' | grep -v "is not")
%requires_eq_to() %(LC_ALL="C" rpm -q --qf 'Requires: %1 = %%{epoch}:%%{version}\\n' %2 | sed -e 's/ (none):/ /' | grep -v "is not")
-%apache_modules_api(v:) %(awk '/#define MODULE_MAGIC_NUMBER_MAJOR/ {print $3}' /usr/include/apache%{-v*}/ap_mmn.h 2>/dev/null || echo ERROR)
+%apache_modules_api %(awk '/#define MODULE_MAGIC_NUMBER_MAJOR/ {print $3}' /usr/include/apache/ap_mmn.h 2>/dev/null || echo ERROR)
# kernel version-release handling
%__kernel_ver %([ -f %{_kernelsrcdir}/include/linux/version.h ] && (grep UTS_RELEASE %{_kernelsrcdir}/include/linux/version.h 2>/dev/null | head -n 1 | cut -d'"' -f2) || (awk '/^VERSION/ { ver = $0; gsub(/VERSION.*=/, NIL, ver); } /^PATCHLEVEL/ { plev = $0; gsub(/PATCHLEVEL.*=/, NIL, plev); } /^SUBLEVEL/ { slev = $0; gsub(/SUBLEVEL.*=/, NIL, slev); } /^EXTRAVERSION/ { ever = $0; gsub(/EXTRAVERSION.*=/, NIL, ever); gsub(/ /, NIL, ever); } END { printf("%d.%d.%d%s", ver, plev, slev, ever); }' %{_kernelsrcdir}/Makefile 2> /dev/null))
fi; \
} }
+# Remove common Perl files we don't package
+%__spec_install_post_perl_clean {\
+%{!?no_install_post_perl_clean: \
+%{?pdir:rm -f $RPM_BUILD_ROOT{%{perl_archlib}/perllocal.pod,%{perl_vendorarch}/auto/%{pdir}%{?pnam:/%(echo %{pnam} | tr - /)}/.packlist}} \
+} }
+
#-----------------------------------------------------------------
# Update GConf2 schemas
#
%perl_sitearch %(eval "`%{__perl} -V:installsitearch`"; echo $installsitearch)
# Ruby
-%ruby_archdir %(ruby -r rbconfig -e 'print Config::CONFIG["archdir"]')
-%ruby_ridir %(ruby -r rbconfig -e 'include Config; print File.join(CONFIG["datadir"], "ri", CONFIG["ruby_version"], "system")')
-%ruby_rubylibdir %(ruby -r rbconfig -e 'print Config::CONFIG["rubylibdir"]')
-%ruby_sitearchdir %(ruby -r rbconfig -e 'print Config::CONFIG["sitearchdir"]')
-%ruby_sitelibdir %(ruby -r rbconfig -e 'print Config::CONFIG["sitelibdir"]')
-%ruby_version %(ruby -r rbconfig -e 'print Config::CONFIG["ruby_version"]')
+%ruby_archdir %(ruby -r rbconfig -e 'print Config::CONFIG["archdir"]' 2>/dev/null || echo ERROR)
+%ruby_ridir %(ruby -r rbconfig -e 'include Config; print File.join(CONFIG["datadir"], "ri", CONFIG["ruby_version"], "system")' 2>/dev/null || echo ERROR)
+%ruby_rubylibdir %(ruby -r rbconfig -e 'print Config::CONFIG["rubylibdir"]' 2>/dev/null || echo ERROR)
+%ruby_sitearchdir %(ruby -r rbconfig -e 'print Config::CONFIG["sitearchdir"]' 2>/dev/null || echo ERROR)
+%ruby_sitelibdir %(ruby -r rbconfig -e 'print Config::CONFIG["sitelibdir"]' 2>/dev/null || echo ERROR)
+%ruby_version %(ruby -r rbconfig -e 'print Config::CONFIG["ruby_version"]' 2>/dev/null || echo ERROR)
+%ruby_ver_requires_eq Requires: ruby(ver) = %ruby_version
+%ruby_mod_ver_requires_eq Requires: ruby-modules(ver) = %ruby_version
%php_pear_dir %{_datadir}/pear
# apache_config_{install/uninstall} macros written by glen@pld-linux.org.
# All rights reserved. Permission to copy is hereby granted.. yada, yada, yada
#
+# You should use webapp macros instead. these are here until single piece of them is gone from specs ;)
+#
# The config is installed/removed inside trigger, this means that you can any
# time install apache1 or apache package and the configuration file is updated.
# if you don't need the config for various reason for specific apache, just
# -v REQUIRED: specify apache version. can be 1 or 2.
# -c OPTIONAL: specify full path to PACKAGE's config. Defaults to %{_sysconfdir}/apache-%{name}.conf.
# -n OPTIONAL: specify config "slot". defaults to 99
+# -f OPTIONAL: force symlink creation regardless if package was upraded. useful in triggers
#
# Internal macros. don't use ;).
# expands apache config dir by apache version at build time.
# expands apache service name by apache version at build time.
%__apache_svcname() %(if [ %{1} = 1 ]; then echo apache; elif [ %{1} = 2 ]; then echo httpd; else echo >&2 Unknown apache version specified; fi)
-%apache_config_install(v:c:n:) \
+%apache_config_install(fv:c:n:) \
%{!-v:%{error:apache_config_install: Required argument -v missing}} \
%{?debug:set -x; echo "apache_config_install:%{-v*} %{name}-%{version}-%{release} 1:[$1]; 2:[$2]"} \
-if [ "$1" = "1" ] && [ "$2" = "1" ] && [ -d %{__apache_confdir %{-v*}} ]; then\
+if [ -n "%{-f:1}" ] || ([ "$1" = "1" ] && [ "$2" = "1" ]) && [ -d %{__apache_confdir %{-v*}} ]; then\
ln -sf %{-c*}%{!-c:%{_sysconfdir}/apache-%{name}.conf} %{__apache_confdir %{-v*}}/%{-n*}%{!-n:99}_%{name}.conf\
fi\
# reload apache if the config symlink is there\
/usr/sbin/webapp register %1 %2\
fi\
# reload webserver if the config symlink is there and skip reload if webserver is upgraded\
-if [ -L /etc/%1/webapps.d/%2.conf ] && [ "$2" -lt "2" ] && [ -f /var/lock/subsys/%1 ]; then\
- /etc/rc.d/init.d/%1 reload 1>&2\
+if [ -L /etc/%1/webapps.d/%2.conf ] && [ "$2" -lt "2" ]; then\
+ %{expand:%service -q %%1 reload}\
fi\
%{nil}
# Remove package's config from webserver webapps dir.
# Usage:
-# %webapp_register WEBSERVER WEBAPP
-%webapp_unregister() \
+# %webapp_register [-f] WEBSERVER WEBAPP
+%webapp_unregister(f) \
%{?debug:set -x; echo "webapp_unregister: %{name}-%{version}-%{release}: 1:[$1]; 2:[$2]"} \
# remove link if either of the packages are gone \
-if [ "$1" = "0" ] || [ "$2" = "0" ] && [ -L /etc/%1/webapps.d/%2.conf ]; then \
+if [ -n "%{-f:1}" ] || [ "$1" = "0" ] || [ "$2" = "0" ] && [ -L /etc/%1/webapps.d/%2.conf ]; then \
/usr/sbin/webapp unregister %1 %2\
- if [ -f /var/lock/subsys/%1 ]; then \
- /etc/rc.d/init.d/%1 reload 1>&2 \
- fi \
+ %{expand:%service -q %%1 reload}\
fi \
%{nil}
# Usage:
# %service [-q] SERVICE ACTION ["SERVICE NICE DESCRIPTION"]
#
-# -q be silent when service isn't started (for postun scriplets)
+# -q be silent when service isn't started (for scriplets restaring other package's services)
#
%service(q) {{%(export quiet=%{-q:1}; /usr/lib/rpm/service_generator.sh %{*}) };}