]> code.citadel.org Git - citadel.git/blobdiff - webcit/scripts/get_ical_data.sh
Remove preprocessor tests for OpenSSL. It's a requirement.
[citadel.git] / webcit / scripts / get_ical_data.sh
index 3f80db31bb5e96730564273f3630410760259b80..da7cbac181542b41bed55d420ce07dfffc4b198f 100755 (executable)
@@ -1,7 +1,25 @@
 #!/bin/sh
+
+echo Running $0
+
+# Find our copy of sed , it might be called "gsed" on FreeBSD
+if gsed --version >/dev/null 2>&1 ; then
+       SED=`which gsed`
+elif sed --version >/dev/null 2>&1 ; then
+       SED=`which sed`
+else
+       sed: not found
+       exit 1
+fi
+
+echo sed is ${SED}
+
+
 ICAL=/usr/local/ctdlsupport/include/libical/ical.h
 if test -f /usr/include/libical/ical.h; then 
     ICAL=/usr/include/libical/ical.h
+elif test -f /usr/local/include/libical/ical.h; then
+       ICAL=/usr/local/include/libical/ical.h
 fi
 
 if test ! -f ${ICAL}; then 
@@ -60,21 +78,21 @@ ICALTYPES="icalproperty_kind"\
 
     for icaltype in $ICALTYPES; do 
        cat ./scripts/get_ical_data__template.sed | \
-           sed -e "s;__ICALTYPE__;$icaltype;g" > \
+           ${SED} -e "s;__ICALTYPE__;$icaltype;g" > \
            /tmp/get_ical_data.sed
     
        printf "Ical_${icaltype} ${icaltype}_map[] = {\n"
        cat ${ICAL} |\
-sed -e 's;/\*.*\*/;;' -e 's;\t;;g' |\
-sed -nf /tmp/get_ical_data.sed |\
-sed -e "s;.*typedef *enum *${icaltype} *{\(.*\)} ${icaltype} *\;.*;\1,;" \
+${SED} -e 's;/\*.*\*/;;' -e 's;\t;;g' |\
+${SED} -nf /tmp/get_ical_data.sed |\
+${SED} -e "s;.*typedef *enum *${icaltype} *{\(.*\)} ${icaltype} *\;.*;\1,;" \
            -e 's;/\*.*\*/;;' \
            -e 's;/;\n/\n;g' \
            -e 's;,;,\n;g' \
            -e 's; *;;g' \
            -e 's;^t*;;g' \
            -e 's;\=[0-9]*;;g'|\
-sed -e 's;\(.*\),;{HKEY("\1"), \1},;'
+${SED} -e 's;\(.*\),;{HKEY("\1"), \1},;'
        printf '{"", 0, 0}\n};\n\n\n' 
        
     done