From: helge Date: Sun, 29 Aug 2004 19:53:50 +0000 (+0000) Subject: added FHS hack, fixed some minor issues X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=52fcc1ce6fb992bf33b3a35ed166d37d4028eb8f;p=sope added FHS hack, fixed some minor issues git-svn-id: http://svn.opengroupware.org/SOPE/trunk@82 e4a50df8-12e2-0310-a44c-efbce7f8a7e3 --- diff --git a/sope-mime/ChangeLog b/sope-mime/ChangeLog new file mode 100644 index 00000000..0b361be8 --- /dev/null +++ b/sope-mime/ChangeLog @@ -0,0 +1,8 @@ +2004-08-29 Helge Hess + + * added hack to install the project in FHS locations - the library, + its headers, the tools and the resources will be installed in + FHS_INSTALL_ROOT if specified (eg make FHS_INSTALL_ROOT=/usr/local) + (v4.3.175) + + * added ChangeLog for libNGMime diff --git a/sope-mime/GNUmakefile b/sope-mime/GNUmakefile index f578b429..4162252e 100644 --- a/sope-mime/GNUmakefile +++ b/sope-mime/GNUmakefile @@ -1,4 +1,4 @@ -# $Id$ +# $Id: GNUmakefile 32 2004-08-21 00:50:30Z helge $ include $(GNUSTEP_MAKEFILES)/common.make include ./Version @@ -20,3 +20,4 @@ ADDITIONAL_CPPFLAGS += -DLIBRARY_MAJOR_VERSION=${MAJOR_VERSION} \ -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/library.make -include GNUmakefile.postamble +-include fhs.make diff --git a/sope-mime/Version b/sope-mime/Version index 6f3c7970..769d66b9 100644 --- a/sope-mime/Version +++ b/sope-mime/Version @@ -2,6 +2,6 @@ MAJOR_VERSION=4 MINOR_VERSION=3 -SUBMINOR_VERSION:=174 +SUBMINOR_VERSION:=175 # v4.2.149 requires libNGStreams v4.2.34 diff --git a/sope-mime/fhs.make b/sope-mime/fhs.make new file mode 100644 index 00000000..0ec04f3f --- /dev/null +++ b/sope-mime/fhs.make @@ -0,0 +1,30 @@ +# postprocessing + +# FHS support (this is a hack and is going to be done by gstep-make!) + +ifneq ($(FHS_INSTALL_ROOT),) + +FHS_INCLUDE_DIR=$(FHS_INSTALL_ROOT)/include/ +FHS_LIB_DIR=$(FHS_INSTALL_ROOT)/lib/ +FHS_BIN_DIR=$(FHS_INSTALL_ROOT)/bin/ + +fhs-header-dirs :: + $(MKDIRS) $(FHS_INCLUDE_DIR)$(libNGMime_HEADER_FILES_INSTALL_DIR) + +move-headers-to-fhs :: fhs-header-dirs + @echo "moving headers to $(FHS_INCLUDE_DIR) .." + mv $(GNUSTEP_HEADERS)$(libNGMime_HEADER_FILES_INSTALL_DIR)/*.h \ + $(FHS_INCLUDE_DIR)$(libNGMime_HEADER_FILES_INSTALL_DIR)/ + +NONFHS_LIBDIR="$(GNUSTEP_LIBRARIES)/$(GNUSTEP_TARGET_LDIR)/" +NONFHS_LIBNAME="$(LIBRARY_NAME)$(LIBRARY_NAME_SUFFIX)$(SHARED_LIBEXT)" + +move-libs-to-fhs :: + @echo "moving libs to $(FHS_LIB_DIR) .." + mv $(NONFHS_LIBDIR)/$(NONFHS_LIBNAME)* $(FHS_LIB_DIR)/ + +move-to-fhs :: move-headers-to-fhs move-libs-to-fhs + +after-install :: move-to-fhs + +endif diff --git a/sope-mime/samples/ChangeLog b/sope-mime/samples/ChangeLog index e48ddf02..e3025527 100644 --- a/sope-mime/samples/ChangeLog +++ b/sope-mime/samples/ChangeLog @@ -1,3 +1,13 @@ +2004-08-29 Helge Hess + + * added hack to install the tools in FHS locations - the executables + will be installed in FHS_INSTALL_ROOT if specified (eg make + FHS_INSTALL_ROOT=/usr/local) + + * imapquota.m: fixed a warning + + * fixed makefile for new SOPE 4.3 setup + 2004-08-20 Helge Hess * moved in NGMime samples from sope-core diff --git a/sope-mime/samples/GNUmakefile b/sope-mime/samples/GNUmakefile index d0af1267..76d510cd 100644 --- a/sope-mime/samples/GNUmakefile +++ b/sope-mime/samples/GNUmakefile @@ -1,63 +1,20 @@ -# $Id$ +# $Id: GNUmakefile 9 2004-08-20 18:40:42Z helge $ include $(GNUSTEP_MAKEFILES)/common.make TOOL_NAME = \ mime2xml \ imapls \ - encoding \ - fmdls \ - testdirenum \ - bmlookup \ test_qpdecode \ - eoqual \ - ldapls \ - ldap2dsml \ - ldapchkpwd \ imapquota \ - testsock \ - httpu_notify \ - ical2 \ - ical3 \ - parserule \ - testurl \ - -ifneq ($(OBJC_RUNTIME_LIB),apple) -TOOL_NAME += subclassing -endif imapquota_OBJC_FILES = ImapQuotaTool.m ImapTool.m imapquota.m imapget_OBJC_FILES = ImapTool.m imapget.m mime2xml_OBJC_FILES = Mime2XmlTool.m mime2xml.m imapls_OBJC_FILES = ImapTool.m ImapListTool.m imapls.m -encoding_OBJC_FILES = EncodingTool.m encoding.m -subclassing_OBJC_FILES = subclassing.m -fmdls_OBJC_FILES = fmdls.m -bmlookup_OBJC_FILES = bmlookup.m -testdirenum_OBJC_FILES = testdirenum.m test_qpdecode_OBJC_FILES = test_qpdecode.m -eoqual_OBJC_FILES = eoqual.m EOQualTool.m -ldapls_OBJC_FILES = ldapls.m -ldap2dsml_OBJC_FILES = ldap2dsml.m -ldapchkpwd_OBJC_FILES = ldapchkpwd.m -testsock_OBJC_FILES = testsock.m -parserule_OBJC_FILES = parserule.m -httpu_notify_OBJC_FILES = httpu_notify.m -testurl_OBJC_FILES = testurl.m - -ical2_OBJC_FILES = ical2.m -ical3_OBJC_FILES = ical3.m - -#TOOL_NAME = #pwd-check -#pwd-check_OBJC_FILES = pwd-check.m - -ldapls_TOOL_LIBS += -lNGLdap -ldap2dsml_TOOL_LIBS += -lNGLdap -ldapchkpwd_TOOL_LIBS += -lNGLdap - -ical2_TOOL_LIBS += -lNGiCal -lSaxObjC -ical3_TOOL_LIBS += -lNGiCal -lSaxObjC -include GNUmakefile.preamble include $(GNUSTEP_MAKEFILES)/tool.make -include GNUmakefile.postamble +-include fhs.make diff --git a/sope-mime/samples/GNUmakefile.preamble b/sope-mime/samples/GNUmakefile.preamble index 7bf84719..f7215e85 100644 --- a/sope-mime/samples/GNUmakefile.preamble +++ b/sope-mime/samples/GNUmakefile.preamble @@ -1,4 +1,4 @@ -# $Id$ +# $Id: GNUmakefile.preamble 9 2004-08-20 18:40:42Z helge $ ADDITIONAL_INCLUDE_DIRS += \ -I.. \ @@ -13,6 +13,7 @@ ADDITIONAL_LIB_DIRS += \ -L../NGMime/$(GNUSTEP_OBJ_DIR) \ -L../NGLdap/$(GNUSTEP_OBJ_DIR) \ -L../NGiCal/$(GNUSTEP_OBJ_DIR) \ + -L/usr/local/lib -L/usr/lib ADDITIONAL_TOOL_LIBS += \ diff --git a/sope-mime/samples/ImapQuotaTool.h b/sope-mime/samples/ImapQuotaTool.h index 821eae49..7695c658 100644 --- a/sope-mime/samples/ImapQuotaTool.h +++ b/sope-mime/samples/ImapQuotaTool.h @@ -1,7 +1,7 @@ /* - Copyright (C) 2000-2003 SKYRIX Software AG + Copyright (C) 2000-2004 SKYRIX Software AG - This file is part of OGo + This file is part of OpenGroupware.org. OGo is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the @@ -18,7 +18,6 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -// $Id: ImapQuotaTool.h 4 2004-08-20 17:04:31Z helge $ #include "ImapTool.h" diff --git a/sope-mime/samples/fhs.make b/sope-mime/samples/fhs.make new file mode 100644 index 00000000..27c85d13 --- /dev/null +++ b/sope-mime/samples/fhs.make @@ -0,0 +1,26 @@ +# postprocessing + +# FHS support (this is a hack and is going to be done by gstep-make!) + +ifneq ($(FHS_INSTALL_ROOT),) + +FHS_INCLUDE_DIR=$(FHS_INSTALL_ROOT)/include/ +FHS_LIB_DIR=$(FHS_INSTALL_ROOT)/lib/ +FHS_BIN_DIR=$(FHS_INSTALL_ROOT)/bin/ + +fhs-bin-dirs :: + $(MKDIRS) $(FHS_BIN_DIR) + +NONFHS_BINDIR="$(GNUSTEP_TOOLS)/$(GNUSTEP_TARGET_LDIR)" + +move-tools-to-fhs :: fhs-bin-dirs + @echo "moving tools from $(NONFHS_BINDIR) to $(FHS_BIN_DIR) .." + for i in $(TOOL_NAME); do \ + mv "$(NONFHS_BINDIR)/$${i}" $(FHS_BIN_DIR); \ + done + +move-to-fhs :: move-tools-to-fhs + +after-install :: move-to-fhs + +endif diff --git a/sope-mime/samples/imapquota.m b/sope-mime/samples/imapquota.m index 847bf5a0..c9abc64d 100644 --- a/sope-mime/samples/imapquota.m +++ b/sope-mime/samples/imapquota.m @@ -1,7 +1,7 @@ /* - Copyright (C) 2000-2003 SKYRIX Software AG + Copyright (C) 2000-2004 SKYRIX Software AG - This file is part of OGo + This file is part of OpenGroupware.org. OGo is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the @@ -18,15 +18,14 @@ Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -// $Id: imapquota.m 4 2004-08-20 17:04:31Z helge $ -#import "ImapQuotaTool.h" +#include "ImapQuotaTool.h" #include "common.h" int main(int argc, char **argv, char **env) { NSAutoreleasePool *pool; - ImapTool *tool; + ImapQuotaTool *tool; int res = 0; pool = [NSAutoreleasePool new]; diff --git a/sope-mime/samples/test_qpdecode.m b/sope-mime/samples/test_qpdecode.m new file mode 100644 index 00000000..3040d2a5 --- /dev/null +++ b/sope-mime/samples/test_qpdecode.m @@ -0,0 +1,87 @@ +/* + Copyright (C) 2000-2004 SKYRIX Software AG + + This file is part of OpenGroupware.org. + + OGo is free software; you can redistribute it and/or modify it under + the terms of the GNU Lesser General Public License as published by the + Free Software Foundation; either version 2, or (at your option) any + later version. + + OGo is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public + License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with OGo; see the file COPYING. If not, write to the + Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. +*/ + +/* + check whether the quoted printable MIME decoding works ... +*/ + +#include +#include "common.h" + +static void test(void) { + static unsigned char *fields[] = { + "attachment; filename=\"Mappe langerp=?iso-8859-15?q?=FC=E4=F6=20Name=F6=F6=F6=201234456=2Exls?=\"", + "Umlaute: =?iso-8859-15?q?=FC=E4=F6?=", + "keine Umlaute: =?iso-8859-15?q?keine Umlaute?=", + "=?iso-8859-15?q?keine Umlaute?=", + "=?iso-8859-15?q?=FC=E4=F6?=", + "", + "hello world !", + "??doit??", + NULL + }; + unsigned char *field; + int i; + + for (i = 0; (field = fields[i]); i++) { + NSData *fieldData; + id result; + + NSLog(@"decoding field: '%s'", field); + fieldData = [NSData dataWithBytes:field length:strlen(field)]; + NSLog(@" length: %i", [fieldData length]); + + result = [fieldData decodeQuotedPrintableValueOfMIMEHeaderField: + @"content-disposition"]; + + if (result == nil) { + NSLog(@" got no result for field data %@ !!!", fieldData); + } + else if ([result isKindOfClass:[NSData class]]) { + NSLog(@" got a data, length %i: %@", [result length], result); + } + else if ([result isKindOfClass:[NSString class]]) { + NSLog(@" got a string, length %i: '%@'", [result length], result); + } + else { + NSLog(@" got an unexpected object, class %@: %@", + NSStringFromClass([result class]), result); + } + } +} + +int main(int argc, char **argv, char **env) { + NSAutoreleasePool *pool; + + pool = [NSAutoreleasePool new]; + +#if LIB_FOUNDATION_LIBRARY + [NSProcessInfo initializeWithArguments:argv count:argc environment:env]; +#endif + + test(); + + [pool release]; + exit(0); + /* static linking */ + [NGExtensions class]; + return 0; +}