#include <unistd.h>
#include <netdb.h>
#include <stdio.h>
+#ifdef __FreeBSD__
+#include <sys/socket.h>
+#endif
#include <libcitadel.h>
#include "ctdl_module.h"
#include "clientsocket.h"
#ifdef HAVE_ARPA_NAMESER_COMPAT_H
#include <arpa/nameser_compat.h>
#endif
+#ifdef __FreeBSD__
+#include <netinet/in.h>
+#endif
#include <resolv.h>
#endif
#include <libcitadel.h>
#include "ctdl_module.h"
#include "serv_nntp.h"
+#ifndef __FreeBSD__
extern long timezone;
+#endif
//
// Tests whether the supplied string is a valid newsgroup name
thetime = mktime(&tm);
if (!strcasecmp(stringy_gmt, "GMT")) {
tzset();
+#ifdef __FreeBSD__
+ thetime += &tm.tm_gmtoff;
+#else
thetime += timezone;
+#endif
}
#
ECHO=/usr/bin/printf
-SED=/bin/sed
+SED=/usr/bin/sed
#MINUS_e=X`$ECHO -n -e`
#if [ $MINUS_e != "X" ] ; then
else
if test -d $SRC_DIR/../.git ; then
echo "have Git repository."
- BUILD=`/usr/bin/git log -1 --pretty=%h . `
+ BUILD=`/usr/bin/env git log -1 --pretty=%h . `
echo "This code base git-revision: $BUILD"
CAN_BUILD_SVN_REVISION="yes"
else
shlibpath_var=LD_LIBRARY_PATH
;;
-freebsd1*)
+freebsd1.*)
dynamic_linker=no
;;
esac
shlibpath_var=LD_LIBRARY_PATH
case $host_os in
- freebsd2*)
+ freebsd2.*)
shlibpath_overrides_runpath=yes
;;
freebsd3.[[01]]* | freebsdelf3.[[01]]*)
_LT_AC_TAGVAR(hardcode_shlibpath_var, $1)=no
;;
- freebsd1*)
+ freebsd1.*)
_LT_AC_TAGVAR(ld_shlibs, $1)=no
;;
;;
# Unfortunately, older versions of FreeBSD 2 do not have this feature.
- freebsd2*)
+ freebsd2.*)
_LT_AC_TAGVAR(archive_cmds, $1)='$LD -Bshareable -o $lib $libobjs $deplibs $linker_flags'
_LT_AC_TAGVAR(hardcode_direct, $1)=yes
_LT_AC_TAGVAR(hardcode_minus_L, $1)=yes
# The standard client looks for this file in:
# 1. $HOME/.citadelrc
# 2. <compiled CTDLDIR>/citadel.rc
-# 3. /etc/citadel.rc
-# 4. <current directory>/citadel.rc
+# 3. /usr/local/etc/citadel.rc
+# 4. /etc/citadel.rc
+# 5. <current directory>/citadel.rc
# Set ENCRYPT to yes to force SSL/TLS encryption when connecting to a
# Citadel server, even if the server is on the same machine as the
if (ccfile == NULL) {
ccfile = fopen(file_citadel_rc, "r");
}
+ if (ccfile == NULL) {
+ ccfile = fopen("/usr/local/etc/citadel.rc", "r");
+ }
if (ccfile == NULL) {
ccfile = fopen("/etc/citadel.rc", "r");
}
echo SSL: $SSL
[ "$SSL" = "yes" ] && {
CFLAGS=${CFLAGS}' -DHAVE_OPENSSL'
- LDFLAGS=${LDFLAGS}' -lssl -lcrypto'
+ LDFLAGS=${LDFLAGS}' -lssl -lcrypto -lz'
}
# Output the config.mk
(
echo "CFLAGS := ${CFLAGS}"
- echo "LDFLAGS := ${LDFLAGS}"
+ echo "LDFLAGS := ${LDFLAGS} -liconv"
echo "PREFIX := ${PREFIX}"
echo "BINDIR := ${BINDIR}"
echo "CTDLDIR := ${CTDLDIR}"
* some systems.
*/
tzset();
+#ifdef __FreeBSD__
+ tt.tm_sec = tt.tm_sec - tt.tm_gmtoff;
+#else
tt.tm_sec = tt.tm_sec - (int)timezone;
+#endif
t = mktime(&tt);
return t;
}
#include "webcit.h"
+#ifdef __FreeBSD__
+/** I like to believe there is a better way to do this. */
+#define HAVE_STRUCT_TM_TM_GMTOFF
+#endif
/** HTTP Months - do not translate - these are not for human consumption */
static char *httpdate_months[] = {
"Jan", "Feb", "Mar", "Apr", "May", "Jun",
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
for icaltype in $ICALTYPES; do
cat ./scripts/get_ical_data__template.sed | \
- sed -e "s;__ICALTYPE__;$icaltype;g" > \
+ gsed -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,;" \
+gsed -e 's;/\*.*\*/;;' -e 's;\t;;g' |\
+gsed -nf /tmp/get_ical_data.sed |\
+gsed -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},;'
+gsed -e 's;\(.*\),;{HKEY("\1"), \1},;'
printf '{"", 0, 0}\n};\n\n\n'
done