From cd78a874c9d4f1a911bea4ea876da041a6982cc6 Mon Sep 17 00:00:00 2001 From: helge Date: Thu, 10 Feb 2005 16:22:38 +0000 Subject: [PATCH] made sogod a tool, places bundles into Library/SOGo-0.9 git-svn-id: http://svn.opengroupware.org/SOGo/trunk@540 d1b88da0-ebda-0310-925b-ed51d893ca5b --- SOGo/Main/ChangeLog | 7 +++++++ SOGo/Main/GNUmakefile | 23 ++++++----------------- SOGo/Main/GNUmakefile.preamble | 12 +++++++++--- SOGo/Main/MainUIProduct.m | 16 ++++++++++++++++ SOGo/Main/README | 21 +++++++++++++++++++++ SOGo/Main/SOGo.m | 28 +++++++++++++++++++++++----- SOGo/Main/SOGoProductLoader.h | 3 +++ SOGo/Main/SOGoProductLoader.m | 32 +++++++++++++++++++++++--------- SOGo/Main/Version | 2 +- SOGo/Main/product.plist | 2 ++ SOGo/Protocols/common.make | 4 +++- SOGo/SoObjects/common.make | 4 +++- SOGo/UI/Common/ChangeLog | 4 ++++ SOGo/UI/Common/GNUmakefile | 6 ++---- SOGo/UI/Common/Version | 2 +- SOGo/UI/common.make | 4 +++- SOGo/Version | 1 - 17 files changed, 127 insertions(+), 44 deletions(-) diff --git a/SOGo/Main/ChangeLog b/SOGo/Main/ChangeLog index cba9d507..7b1601ad 100644 --- a/SOGo/Main/ChangeLog +++ b/SOGo/Main/ChangeLog @@ -1,5 +1,12 @@ 2005-02-10 Helge Hess + * v0.9.21 + + * SOGoProductLoader.m: perform properly versioned plugin lookups (load + bundles from Library/SOGo-0.9 instead of Library/SOGo) + + * sogod is now a tool, not a .woa anymore + * SOGo.m: minor cleanup in locale code, removed some dead code (v0.9.20) diff --git a/SOGo/Main/GNUmakefile b/SOGo/Main/GNUmakefile index f589055e..f1e14e38 100644 --- a/SOGo/Main/GNUmakefile +++ b/SOGo/Main/GNUmakefile @@ -1,16 +1,18 @@ # GNUstep makefile include $(GNUSTEP_MAKEFILES)/common.make +include ../Version +include ./Version -WOAPP_NAME = sogod -TOOL_NAME = sogod +SOGOD = sogod-$(MAJOR_VERSION).$(MINOR_VERSION) +TOOL_NAME = $(SOGOD) BUNDLE_NAME = MainUI BUNDLE_EXTENSION = .SOGo -BUNDLE_INSTALL_DIR = $(GNUSTEP_USER_ROOT)/Library/SOGo +BUNDLE_INSTALL_DIR = $(GNUSTEP_USER_ROOT)/Library/SOGo-$(MAJOR_VERSION).$(MINOR_VERSION) # daemon tool -sogod_OBJC_FILES += \ +$(SOGOD)_OBJC_FILES += \ sogod.m \ SOGo.m \ SOGoProductLoader.m \ @@ -41,20 +43,7 @@ MainUI_RESOURCE_FILES += \ MainUI_LOCALIZED_RESOURCE_FILES += \ Locale default.strings -# woapp support - -ifneq ($(tool),yes) -sogod_OBJC_FILES += $(MainUI_OBJC_FILES) -sogod_RESOURCE_FILES += $(MainUI_RESOURCE_FILES) -sogod_LOCALIZED_RESOURCE_FILES += $(MainUI_LOCALIZED_RESOURCE_FILES) -endif - - -include GNUmakefile.preamble -ifeq ($(tool),yes) include $(GNUSTEP_MAKEFILES)/bundle.make include $(GNUSTEP_MAKEFILES)/tool.make -else -include $(GNUSTEP_MAKEFILES)/woapp.make -endif -include GNUmakefile.postamble diff --git a/SOGo/Main/GNUmakefile.preamble b/SOGo/Main/GNUmakefile.preamble index e70c8e01..deaf71e5 100644 --- a/SOGo/Main/GNUmakefile.preamble +++ b/SOGo/Main/GNUmakefile.preamble @@ -1,4 +1,9 @@ -# $Id$ +# compile settings + +ADDITIONAL_CPPFLAGS += \ + -DSOGO_MAJOR_VERSION=$(MAJOR_VERSION) \ + -DSOGO_MINOR_VERSION=$(MINOR_VERSION) \ + -DSOGO_SUBMINOR_VERSION=$(SUBMINOR_VERSION) ADDITIONAL_INCLUDE_DIRS += \ -I../SoObjects/ \ @@ -8,9 +13,10 @@ ADDITIONAL_LIB_DIRS += \ -L../SoObjects/SOGo/$(GNUSTEP_OBJ_DIR)/ \ -L../../OGoContentStore/$(GNUSTEP_OBJ_DIR)/ \ -L../../SOGoLogic/$(GNUSTEP_OBJ_DIR)/ \ - -L/usr/local/lib -L/usr/lib -# todo: use syslibs +SYSTEM_LIB_DIR += -L/usr/local/lib -L/usr/lib + +# TODO: check which one we actually need! ADDITIONAL_TOOL_LIBS += \ -lSOGo \ -lSOGoLogic \ diff --git a/SOGo/Main/MainUIProduct.m b/SOGo/Main/MainUIProduct.m index bf13ead4..1018ad73 100644 --- a/SOGo/Main/MainUIProduct.m +++ b/SOGo/Main/MainUIProduct.m @@ -27,5 +27,21 @@ @end +#import + @implementation MainUIProduct + ++ (NSString *)pathToLocaleForLanguageNamed:(NSString *)_name { + // TODO: this is kind of a hack, we reuse the class registry to find + // resources ... + NSBundle *bundle; + NSString *ldir, *path; + + bundle = [NSBundle bundleForClass:self]; + ldir = [_name stringByAppendingPathExtension:@"lproj"]; + path = [bundle pathForResource:@"Locale" ofType:nil inDirectory:ldir]; + + return path; +} + @end /* MainUIProduct */ diff --git a/SOGo/Main/README b/SOGo/Main/README index 7e6d556b..ce89c08f 100644 --- a/SOGo/Main/README +++ b/SOGo/Main/README @@ -23,3 +23,24 @@ What it does - provides the root object (the application object with user lookup) - sets the authenticator - does some process limits and restart support + +Apache Setup +============ + + AliasMatch /SOGoHH/so/ControlPanel/Products/(.*)/Resources/(.*) \ + /home/helge/GNUstep/Library/SOGo-0.9/$1.SOGo/Resources/$2 + + + AuthName "Agenor LDAP" + AuthType Basic + AuthLDAPEnabled on + AuthLDAPUrl ldap://agenor-ldap:389/ou=organisation,dc=equipement,dc=gouv,dc=fr??sub?(&(objectClass=person)(uid=*)) + require valid-user + + SetHandler ngobjweb-adaptor + SetAppPort 9000 + + + + SetHandler default-handler + diff --git a/SOGo/Main/SOGo.m b/SOGo/Main/SOGo.m index 2fcec749..2242b25f 100644 --- a/SOGo/Main/SOGo.m +++ b/SOGo/Main/SOGo.m @@ -227,6 +227,28 @@ static BOOL doCrashOnSessionCreate = NO; return [self localeForLanguageNamed:@"English"]; } +- (NSString *)pathToLocaleForLanguageNamed:(NSString *)_name { + static Class MainProduct = Nil; + NSString *lpath; + + lpath = [[self resourceManager] pathForResourceNamed:@"Locale" + inFramework:nil + languages:[NSArray arrayWithObject:_name]]; + if ([lpath isNotNull]) + return lpath; + + if (MainProduct == Nil) { + if ((MainProduct = NSClassFromString(@"MainUIProduct")) == Nil) + [self logWithFormat:@"ERROR: did not find MainUIProduct class!"]; + } + + lpath = [MainProduct pathToLocaleForLanguageNamed:_name]; + if ([lpath isNotNull]) + return lpath; + + return nil; +} + - (NSDictionary *)localeForLanguageNamed:(NSString *)_name { NSString *lpath; id data; @@ -241,11 +263,7 @@ static BOOL doCrashOnSessionCreate = NO; if ((locale = [self->localeLUT objectForKey:_name]) != nil) return locale; - lpath = [[self resourceManager] - pathForResourceNamed:@"Locale" - inFramework:nil - languages:[NSArray arrayWithObject:_name]]; - if (![lpath isNotNull]) { + if ((lpath = [self pathToLocaleForLanguageNamed:_name]) == nil) { [self logWithFormat:@"ERROR: did not find Locale for language: %@", _name]; return nil; } diff --git a/SOGo/Main/SOGoProductLoader.h b/SOGo/Main/SOGoProductLoader.h index cf565572..f5941672 100644 --- a/SOGo/Main/SOGoProductLoader.h +++ b/SOGo/Main/SOGoProductLoader.h @@ -25,9 +25,12 @@ #import +@class NSString, NSArray; + @interface SOGoProductLoader : NSObject { NSString *productDirectoryName; + NSArray *searchPathes; } + (id)productLoader; diff --git a/SOGo/Main/SOGoProductLoader.m b/SOGo/Main/SOGoProductLoader.m index 8c4d545c..bd115d32 100644 --- a/SOGo/Main/SOGoProductLoader.m +++ b/SOGo/Main/SOGoProductLoader.m @@ -24,32 +24,42 @@ @implementation SOGoProductLoader ++ (int)sogoMajorVersion { + return SOGO_MAJOR_VERSION; +} ++ (int)sogoMinorVersion { + return SOGO_MINOR_VERSION; +} + + (id)productLoader { return [[[self alloc] init] autorelease]; } - (id)init { if ((self = [super init])) { - self->productDirectoryName = @"SOGo"; + self->productDirectoryName = + [[NSString alloc] initWithFormat:@"SOGo-%i.%i", + [[self class] sogoMajorVersion], + [[self class] sogoMinorVersion]]; } return self; } - (void)dealloc { [self->productDirectoryName release]; + [self->searchPathes release]; [super dealloc]; } /* loading */ - (NSArray *)productSearchPathes { - static NSArray *searchPathes = nil; NSMutableArray *ma; NSDictionary *env; id tmp; - if (searchPathes) - return searchPathes; + if (self->searchPathes != nil) + return self->searchPathes; env = [[NSProcessInfo processInfo] environment]; ma = [NSMutableArray arrayWithCapacity:6]; @@ -89,12 +99,14 @@ } #endif - searchPathes = [ma copy]; + self->searchPathes = [ma copy]; - if ([searchPathes count] == 0) - NSLog(@"%s: no search pathes were found !", __PRETTY_FUNCTION__); + if ([self->searchPathes count] == 0) { + [self logWithFormat:@"%s: no search pathes were found !", + __PRETTY_FUNCTION__]; + } - return searchPathes; + return self->searchPathes; } - (void)loadProducts { @@ -111,13 +123,15 @@ NSEnumerator *productNames; NSString *productName; + [self logWithFormat:@"scanning SOGo products in: %@", lpath]; + productNames = [[fm directoryContentsAtPath:lpath] objectEnumerator]; while ((productName = [productNames nextObject]) != nil) { NSString *bpath; bpath = [lpath stringByAppendingPathComponent:productName]; - [self logWithFormat:@"register SOGo product: %@", + [self logWithFormat:@" register SOGo product: %@", [bpath lastPathComponent]]; [registry registerProductAtPath:bpath]; } diff --git a/SOGo/Main/Version b/SOGo/Main/Version index 6cdceca8..053584a7 100644 --- a/SOGo/Main/Version +++ b/SOGo/Main/Version @@ -1,5 +1,5 @@ # Version file -SUBMINOR_VERSION:=20 +SUBMINOR_VERSION:=21 # v0.9.16 requires NGExtensions v4.5.136 diff --git a/SOGo/Main/product.plist b/SOGo/Main/product.plist index b6b86737..1303d9b1 100644 --- a/SOGo/Main/product.plist +++ b/SOGo/Main/product.plist @@ -1,4 +1,6 @@ { + requires = ( MAIN ); + publicResources = ( ); diff --git a/SOGo/Protocols/common.make b/SOGo/Protocols/common.make index cd675a2c..35b48ee6 100644 --- a/SOGo/Protocols/common.make +++ b/SOGo/Protocols/common.make @@ -1,9 +1,11 @@ # common make file for Protocol bundles include $(GNUSTEP_MAKEFILES)/common.make +include ../../Version +include ./Version BUNDLE_EXTENSION = .SOGo -BUNDLE_INSTALL_DIR = $(GNUSTEP_USER_ROOT)/Library/SOGo +BUNDLE_INSTALL_DIR = $(GNUSTEP_USER_ROOT)/Library/SOGo-$(MAJOR_VERSION).$(MINOR_VERSION) ADDITIONAL_INCLUDE_DIRS += \ -I.. \ diff --git a/SOGo/SoObjects/common.make b/SOGo/SoObjects/common.make index 384a6aa8..947d9a0c 100644 --- a/SOGo/SoObjects/common.make +++ b/SOGo/SoObjects/common.make @@ -1,9 +1,11 @@ # common make file for SoObject bundles include $(GNUSTEP_MAKEFILES)/common.make +include ../../Version +include ./Version BUNDLE_EXTENSION = .SOGo -BUNDLE_INSTALL_DIR = $(GNUSTEP_USER_ROOT)/Library/SOGo +BUNDLE_INSTALL_DIR = $(GNUSTEP_USER_ROOT)/Library/SOGo-$(MAJOR_VERSION).$(MINOR_VERSION) ADDITIONAL_INCLUDE_DIRS += \ -I.. \ diff --git a/SOGo/UI/Common/ChangeLog b/SOGo/UI/Common/ChangeLog index b4b95637..c7697360 100644 --- a/SOGo/UI/Common/ChangeLog +++ b/SOGo/UI/Common/ChangeLog @@ -1,3 +1,7 @@ +2005-02-10 Helge Hess + + * GNUmakefile: include ../common.make (v0.9.35) + 2005-01-24 Marcus Mueller * UIxPageFrame.wox: additional debug output (v0.9.34) diff --git a/SOGo/UI/Common/GNUmakefile b/SOGo/UI/Common/GNUmakefile index 2ba14261..bee0fdb0 100644 --- a/SOGo/UI/Common/GNUmakefile +++ b/SOGo/UI/Common/GNUmakefile @@ -1,10 +1,8 @@ # GNUstep makefile -include $(GNUSTEP_MAKEFILES)/common.make +include ../common.make -BUNDLE_NAME = CommonUI -BUNDLE_EXTENSION = .SOGo -BUNDLE_INSTALL_DIR = $(GNUSTEP_USER_ROOT)/Library/SOGo +BUNDLE_NAME = CommonUI CommonUI_PRINCIPAL_CLASS = CommonUIProduct diff --git a/SOGo/UI/Common/Version b/SOGo/UI/Common/Version index 7374c9b8..51e753f7 100644 --- a/SOGo/UI/Common/Version +++ b/SOGo/UI/Common/Version @@ -1,5 +1,5 @@ # Version file -SUBMINOR_VERSION:=34 +SUBMINOR_VERSION:=35 # v0.9.28 requires NGExtensions v4.5.136 diff --git a/SOGo/UI/common.make b/SOGo/UI/common.make index 1912e2f7..04f510a9 100644 --- a/SOGo/UI/common.make +++ b/SOGo/UI/common.make @@ -1,9 +1,11 @@ # common make file for UI bundles include $(GNUSTEP_MAKEFILES)/common.make +include ../../Version +include ./Version BUNDLE_EXTENSION = .SOGo -BUNDLE_INSTALL_DIR = $(GNUSTEP_USER_ROOT)/Library/SOGo +BUNDLE_INSTALL_DIR = $(GNUSTEP_USER_ROOT)/Library/SOGo-$(MAJOR_VERSION).$(MINOR_VERSION) ADDITIONAL_INCLUDE_DIRS += \ -I.. \ diff --git a/SOGo/Version b/SOGo/Version index 398c99c9..99ae2aad 100644 --- a/SOGo/Version +++ b/SOGo/Version @@ -1,4 +1,3 @@ -# $Id$ # # This file is included by library makefiles to set the version information # of the executable. -- 2.39.5