#!/bin/sh # # Combined library.prov, desktop-file.prov and appdata.prov for hugin # # Transform appdata xml file into RPM appdata(filename) provides # Author: Michael Schroeder # # Transform desktop mimetype info into RPM mimehandler(type) provides # Author: Richard Hughes # # Also based on library provides scripts from RPM OLD_IFS="$IFS" mark64=$(uname -m |grep -o 64) while read instfile ; do case "$instfile" in *.desktop) if ! grep -q '^Type=Application$' "$instfile"; then continue; fi if ! grep -q '^Exec=' "$instfile"; then continue; fi echo "application()" echo "application(${instfile##*/applications/})" mime=`grep '^MimeType=' "$instfile" | cut -d'=' -f2` IFS=';' for type in $mime ; do echo 'mimehandler('$type')' done ;; *.appdata.xml) echo "appdata()" echo "appdata(${instfile##*/appdata/})" ;; */usr/lib$mark64/*.so.?.?) soname=$(objdump -p $instfile | awk '/SONAME/ {print $2}') if [ $mark64 -eq 64 ] ; then lib64="()(64bit)" ; else lib64="" ; fi echo "$soname$lib64" ;; esac done IFS=$OLD_IFS