--- rpm/SOURCES/rpm-find-lang	2006-12-30 20:34:38.344922516 +0100
+++ find-lang.sh	2007-02-13 14:33:35.234439569 +0100
@@ -47,6 +47,7 @@
 Additional options:
   --with-gnome		find GNOME help files
   --with-kde		find KDE help files
+  --with-omf		find scrollkeeper documentation
   --all-name		match all package/domain names
   --without-mo		skip *.mo locale files
 EOF
@@ -74,6 +75,7 @@
 
 GNOME='#'
 KDE='#'
+OMF='#'
 MO=''
 MO_NAME=$NAME.lang
 ALL_NAME='#'
@@ -88,6 +90,10 @@
 		KDE=''
 		shift
 		;;
+	--with-omf)
+		OMF=''
+		shift
+		;;
 	--without-mo)
 		MO='#'
 		shift
@@ -106,12 +112,19 @@
 
 echo '%defattr(644,root,root,755)' > $MO_NAME
 
-if [ ! -f __find.files ]; then
+#if [ ! -f __find.files ]; then
 	find $TOP_DIR -type f -name '*.mo' | xargs -r file | egrep -v ', 1 messages$' | \
 	sed -e '
 		s/:.*//
 		s:'"$TOP_DIR"'::' > __find.files
-fi
+#fi
+
+#if [ ! -f __omf.files ]; then
+	find $TOP_DIR -type f -name '*.omf' | \
+	sed -e '
+		s/:.*//
+		s:'"$TOP_DIR"'::' > __omf.files
+#fi
 
 { [ "$ALL_NAME" ] && fgrep $NAME __find.files || cat __find.files; } | sed '
 '"$ALL_NAME$MO"'s:\(.*/share/locale/\)\([^/_]\+\)\(.*\.mo$\):%lang(\2) \1\2\3:
@@ -120,9 +133,24 @@
 s:%lang(C) ::
 s:^\$::' | egrep -v '^$' >> $MO_NAME
 
+{ [ "$ALL_NAME" ] && fgrep $NAME __omf.files || cat __omf.files; } | sed '
+'"$NO_ALL_NAME$OMF"'s:\(.*/omf/'"$NAME"'\)\(.*\-\)\(.*\)\(.*\.omf\):%lang(\3) \1\2\3\4:
+'"$ALL_NAME$OMF"'s:\(.*/omf/[a-zA-Z0-9.\_\-]\+\)\(.*\-\)\(.*\)\(.*\.omf\):%lang(\3) \1\2\3\4:
+s:^\([^%].*\)::                                                                                                           
+s:%lang(C) :: 
+s:^\$::' | egrep -v '^$' >> $MO_NAME
+
 if [ ! -f __find.dirs ]; then
 	find $TOP_DIR -type d | sed 's:'"$TOP_DIR"'::' > __find.dirs
 fi
+
+{ [ "$ALL_NAME" ] && fgrep $NAME __find.dirs || cat __find.dirs; } | sed '
+'"$NO_ALL_NAME$OMF"'s:\(.*/omf/'"$NAME"'$\):%dir \1:
+'"$ALL_NAME$OMF"'s:\(.*/omf/[a-zA-Z0-9.\_\-]\+$\):%dir \1:
+s:^\([^%].*\)::                                                                                                           
+s:%lang(C) :: 
+s:^\$::' | egrep -v '^$' >> $MO_NAME
+
 { [ "$ALL_NAME" ] && fgrep $NAME __find.dirs || cat __find.dirs; } | sed '
 '"$NO_ALL_NAME$GNOME"'s:\(.*/gnome/help/'"$NAME"'$\):%dir \1:
 '"$NO_ALL_NAME$GNOME"'s:\(.*/gnome/help/'"$NAME"'/[a-zA-Z0-9.\_\-]/.\+\)::
