X-Git-Url: http://git.pld-linux.org/?a=blobdiff_plain;f=rpm.macros;h=7b20b830a5960ea5bf62fc0a3dfa26a639684de6;hb=c9704b95bbc57f1a1c8df98b31c2f496ca39688a;hp=5db462b31afa6f4d45aedda7e4c686256e7f84a3;hpb=8736ae44cb2d27df5fd093b13e14245b3464c986;p=packages%2Frpm-build-macros.git diff --git a/rpm.macros b/rpm.macros index 5db462b..7b20b83 100644 --- a/rpm.macros +++ b/rpm.macros @@ -1,4 +1,6 @@ # $Revision$, $Date$ +# vim:ts=4 sw=4 noet ft=spec +# # PLD Linux rpm macros. # @@ -650,16 +652,21 @@ fi; }; __spec_install_post_chrpath } } } # and terminate if any found (termination can be turned off by define). #%no_install_post_check_so 1 #%skip_post_check_so libwithunresolvedok.so.* +# +# NOTE: define skip_post_check_so only if such library really requires +# unresolved symbols and always leave a comment why it is required: +# # executable provides symbols foo, bar for those libraries: +# %define skip_post_check_so libwithoutfoo.so.* libwithoutbar.so.* +# %__spec_install_post_check_so { \ - __spec_install_post_check_so() { \ - fail=0; \ - printf "Searching for shared objects with unresolved symbols..."; \ - for f in $(find $RPM_BUILD_ROOT -type f -name '*.so.*' -print); do \ - %{?skip_post_check_so:awk -v "file=$f" 'BEGIN { split("%{skip_post_check_so}", R); for (i=1; i in R; i++) { if (file ~ "(^|/)" R[i] "$") exit(1); } }' || continue;} \ - LC_ALL=C objdump -T $f 2> /dev/null | LC_ALL=C awk -v "file=$f" 'BEGIN { found=0; skip["program_name"]=1; symbols = "" } /^[0-9a-z]+ +D +\*UND\*/ { if ($NF in skip) { next; }; found = 1; symbols = symbols "\n\t" $NF } END { if (found) { print "\nUnresolved symbols found in: " file symbols; exit(1); } } ' || fail=1 ; \ - done ; \ - echo " DONE"; \ - %{!?no_install_post_check_so:return $fail;} \ +__spec_install_post_check_so() { \ + fail=0; \ + printf "Searching for shared objects with unresolved symbols..."; \ + for f in $(find $RPM_BUILD_ROOT -type f -name '*.so.*' -print); do \ + LC_ALL=C objdump -T $f 2> /dev/null | LC_ALL=C awk -v "file=$f" 'BEGIN { found=0; skip["program_name"]=1; symbols = "" } /^[0-9a-z]+ +D +\*UND\*/ { if ($NF in skip) { next; }; found = 1; symbols = symbols "\n\t" $NF } END { if (found) { print "\nUnresolved symbols found in: " file symbols; %{?skip_post_check_so:split("%{skip_post_check_so}", R); for (i=1; i in R; i++) { if (file ~ "(^|/)" R[i] "$") { print "Library marked with skip_post_check_so, ignoring errors.\n"; exit(0); } } } exit(1); } } ' || fail=1 ; \ + done ; \ + echo " DONE"; \ + %{!?no_install_post_check_so:return $fail;} \ }; __spec_install_post_check_so }} #----------------------------------------------------------------- @@ -759,6 +766,16 @@ if [ "$1" = "0" ]; then \ fi; \ %{nil} +#----------------------------------------------------------------- +# Compile GSettings schemas +# requires: glib2 >= 1:2.26.0 +# +%glib_compile_schemas() {{ \ + umask 022; \ + /usr/bin/glib-compile-schemas %{_datadir}/glib-2.0/schemas; \ +};} \ +%{nil} + #----------------------------------------------------------------- # post %install sequence: # - autodeps exceptions @@ -1962,18 +1979,18 @@ else: \ # migrate from init script to upstart job %upstart_post() \ - if [ -f /var/lock/subsys/"%1" ] ; then \ - /sbin/service --no-upstart "%1" stop \ - /sbin/service "%1" start \ + if [ -f /var/lock/subsys/%1 ]; then \ + /sbin/service --no-upstart %1 stop \ + /sbin/service %1 start \ fi # restart the job after upgrade or migrate to init script on removal # cannot be stopped with 'service' as /etc/init/$name.conf may be missing # at this point %upstart_postun() \ - if [ -x /sbin/initctl ] && /sbin/initctl status "%1" 2>/dev/null | grep -q 'running' ; then \ - /sbin/initctl stop "%1" >/dev/null 2>&1 \ - [ -f "/etc/rc.d/init.d/%1" -o -f "/etc/init/%1.conf" ] && { echo -n "Re-" ; /sbin/service "%1" start ; } ; \ + if [ -x /sbin/initctl ] && /sbin/initctl status %1 2>/dev/null | grep -q 'running' ; then \ + /sbin/initctl stop %1 >/dev/null 2>&1 \ + [ -f /etc/rc.d/init.d/%1 -o -f /etc/init/%1.conf ] && { echo -n "Re-"; /sbin/service %1 start; }; \ fi -# vim:ts=4 sw=4 noet ft=spec +# EOF