7 if test x"$1" = x ; then
8 echo "$0 Objectname [srcfile]\n";
9 echo " creates gstobjectname.{c,h} implementing GstObjectname\n";
13 if test x"$2" = x ; then
15 srcfile_h="gstplugin.h"
18 id=$(echo '$Id$' | sed \
19 -e 's/\$I[d]: \([^$]*\)\$/\1/g' \
22 TEMPLATE=$(echo $Template | tr a-z A-Z)
23 template=$(echo $Template | tr A-Z a-z)
24 filename=$(echo $template | tr -d _)
25 Template=$(echo $Template | tr -d _)
26 template_=$(echo $Template | sed "s/\([a-z]\)\([A-Z]\)/\1_\2/g" | tr A-Z a-z)
29 if [ -z "$REAL_NAME" ]; then
31 if [ `which 2>/dev/null getent` ]; then
32 entry=`getent passwd $user`
34 entry=`grep $user /etc/passwd`
36 REAL_NAME=`echo $entry | awk -F":" '{ print $5 }' | awk -F"," '{ print $1 }'`
38 if [ -z "$EMAIL_ADDRESS" ]; then
39 EMAIL_ADDRESS="<user@hostname.org>"
42 # remember to break up the Id: in the line below
44 -e 's/gstplugin\.c/SOURCEFILE/g' \
45 -e "s/gstplugin\.h/gst$filename.h/g" \
46 -e "s/gsttransform\.h/gst$filename.h/g" \
47 -e "s/GstPluginTemplate/Gst$Template/g" \
48 -e "s/gst_plugin_template/gst_$template_/g" \
49 -e "s/gst_type_plugin_template/gst_$template_/g" \
50 -e "s/GST_PLUGIN_TEMPLATE/GST_$TEMPLATE/g" \
51 -e "s/GST_TYPE_PLUGIN_TEMPLATE/GST_TYPE_$TEMPLATE/g" \
52 -e 's/\$I[d]: \([^$]*\)\$/\1/g' \
53 -e 's/SOURCEFILE/gstobject\.c/g' \
54 -e "s%MAKEFILTERVERSION%$id%g" \
55 -e "s/plugin/$template/g" \
56 -e "s/\([^G][^s][^t]\)Plugin/\1$Template/g" \
58 -e "s/AUTHOR_NAME/$REAL_NAME/g" \
59 -e "s/AUTHOR_EMAIL/<$EMAIL_ADDRESS>/g" \
60 $srcfile >gst$filename.c.tmp && mv gst$filename.c.tmp gst$filename.c
62 if [ -e $srcfile_h ]; then
64 -e 's/gstplugin\.c/SOURCEFILE/g' \
65 -e "s/GstPluginTemplate/Gst$Template/g" \
66 -e "s/gst_plugin_template/gst_$template_/g" \
67 -e "s/gst_type_plugin_template/gst_$template_/g" \
68 -e "s/GST_PLUGIN_TEMPLATE/GST_$TEMPLATE/g" \
69 -e "s/GST_TYPE_PLUGIN_TEMPLATE/GST_TYPE_$TEMPLATE/g" \
70 -e "s/GST_IS_PLUGIN_TEMPLATE/GST_IS_$TEMPLATE/g" \
71 -e 's/\$I[d]: \([^$]*\)\$/\1/g' \
72 -e 's/SOURCEFILE/gstobject\.c/g' \
73 -e "s%MAKEFILTERVERSION%$id%g" \
74 -e "s/plugin/$template/g" \
75 -e "s/\([^G][^s][^t]\)Plugin/\1$Template/g" \
77 -e "s/AUTHOR_NAME/$REAL_NAME/g" \
78 -e "s/AUTHOR_EMAIL/<$EMAIL_ADDRESS>/g" \
79 $srcfile_h >gst$filename.h.tmp && mv gst$filename.h.tmp gst$filename.h