Hello, I'm started this WE packaging the owncloud-client and csync for debian. As basis I took the obs and the ubuntu packages. Some parts are unclear for me:
mirall/owncloud-client: * license mismatch in owncloud-client/mirall: COPYIING.documentation says that the documentation CCLC vs. doc/script/README.rst says: LGPGv3 => what is the license of the documenation? * the documention for owncloud-client & manpage should be build and installed by "make" [ a rough doc2default.patch], so it is possible to use manpages and create a -doc package. * can someone explain me, why mirall is created but not rm'ed in the obs packages? What is the difference between mirall and owncloud-client? csync/ocsync/csync-owncloud: * the best would be to use only one name for this package. Otherwise peaope get problems if they try to switch from the obs package to the pure package and further around. We (pkg-owncloud) prefered ocsync, 'cause the tarball was named like this. * libiniparser and that this package has problems getting into debian [1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=582657 and that Andreas Schneider (csync developer) don't want to replace libiniparser [2]. I used the mentions this patch to create a updated version (0001-csync_config-Drop-iniparser-dependency.patch). But the best would be if this patch would be upstream. It is not my intenstion, that the packages differ from upstream. You can also get to the sources: ocsync [3] and owncloud-client [4] Feel free to ask and/or join our packaging team: http://wiki.debian.org/Teams/pkg-owncloud sandro [1] http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=582657 [2] https://open.cryptomilk.org/issues/5 [3] http://anonscm.debian.org/gitweb/?p=pkg-owncloud/ocsync.git [4] http://anonscm.debian.org/gitweb/?p=pkg-owncloud/owncloud-client.git
Index: owncloud-client-1.1.3/doc/CMakeLists.txt =================================================================== --- owncloud-client-1.1.3.orig/doc/CMakeLists.txt 2012-12-16 22:09:03.898373721 +0100 +++ owncloud-client-1.1.3/doc/CMakeLists.txt 2012-12-16 23:53:08.421415833 +0100 @@ -11,7 +11,7 @@ set(MSHTML_COMPILER wine 'C:\\Program Files\\HTML Help Workshop\\hhc.exe') configure_file("${CMAKE_CURRENT_SOURCE_DIR}/conf.py.in" conf.py @ONLY) - add_custom_target(doc DEPENDS doc-html doc-man COMMENT "Building documentation...") + add_custom_target(doc ALL DEPENDS doc-html doc-man COMMENT "Building documentation...") if(PDFLATEX_FOUND) # if this still fails on Debian/Ubuntu, run # apt-get install texlive-latex-recommended texlive-latex-extra texlive-fonts-recommended @@ -23,6 +23,7 @@ add_custom_target(doc-pdf make -C ${SPHINX_PDF_DIR} all-pdf DEPENDS doc-latex ) add_dependencies(doc doc-pdf) + install(DIRECTORY ${SPHINX_PDF_DIR} DESTINATION ${CMAKE_INSTALL_DOCDIR}) endif(PDFLATEX_FOUND) if (EXISTS ${QT_QCOLLECTIONGENERATOR_EXECUTABLE}) add_custom_target( doc-qch-sphinx ${SPHINX_EXECUTABLE} @@ -34,17 +35,20 @@ ${SPHINX_QCH_DIR}/*.qhcp DEPENDS doc-qch-sphinx ) add_dependencies(doc doc-qch) + install(DIRECTORY ${SPHINX_QCH_DIR} DESTINATION ${CMAKE_INSTALL_DOCDIR}) endif() add_custom_target( doc-html ${SPHINX_EXECUTABLE} -q -c . -b html -d ${SPHINX_CACHE_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${SPHINX_HTML_DIR} ) + install(DIRECTORY ${SPHINX_HTML_DIR} DESTINATION ${CMAKE_INSTALL_DOCDIR}) add_custom_target( doc-man ${SPHINX_EXECUTABLE} -q -c . -b man -d ${SPHINX_CACHE_DIR} ${CMAKE_CURRENT_SOURCE_DIR} ${SPHINX_MAN_DIR} ) + install(DIRECTORY ${SPHINX_MAN_DIR} DESTINATION ${CMAKE_INSTALL_MANDIR}) ## Building CHM files requires HTML Help Workshop. Since it requires wine ## with special dependencies, it's impossible to write a cmake check for it. ## This is why doc-chm is not a dependency for doc. Instead, run
From 89566756bbb98a778b83e3f5c3d57a266ef9dd02 Mon Sep 17 00:00:00 2001 From: Gergely Nagy <alger...@madhouse-project.org> Date: Sat, 28 Apr 2012 20:03:37 +0200 Subject: [PATCH] csync_config: Drop iniparser dependency Instead of using iniparser to parse three settings out of an ini-file, use an embedded copy of inih (http://code.google.com/p/inih/). This has the advantage of trimming the dependencies, and making csync easier to compile on distributions that do not include iniparser, such as Debian. Signed-off-by: Gergely Nagy <alger...@madhouse-project.org> --- INSTALL | 1 - cmake/Modules/FindIniparser.cmake | 38 ---------- src/CMakeLists.txt | 4 +- src/csync_config.c | 61 +++++++++++---- src/ini.c | 149 +++++++++++++++++++++++++++++++++++++ src/ini.h | 55 ++++++++++++++ 6 files changed, 251 insertions(+), 57 deletions(-) delete mode 100644 cmake/Modules/FindIniparser.cmake create mode 100644 src/ini.c create mode 100644 src/ini.h Index: csync-owncloud/INSTALL =================================================================== --- csync-owncloud.orig/INSTALL 2012-12-14 17:51:27.564798202 +0100 +++ csync-owncloud/INSTALL 2012-12-14 17:52:36.000000000 +0100 @@ -12,7 +12,6 @@ - [log4c](http://log4c.sourceforge.net) >= 1.2 - [sqlite3](http://www.sqlite.org) >= 3.4 -- [libiniparser](http://ndevilla.free.fr/iniparser/) >= 2.10 - [libsmbclient](http://www.samba.org) >= 3.5 - [libssh](http://www.libssh.org) >= 0.5 Index: csync-owncloud/src/CMakeLists.txt =================================================================== --- csync-owncloud.orig/src/CMakeLists.txt 2012-12-14 17:51:27.564798202 +0100 +++ csync-owncloud/src/CMakeLists.txt 2012-12-14 17:52:36.000000000 +0100 @@ -6,12 +6,9 @@ if (CSYNC_STATIC_COMPILE_DIR) set(SQLITE3_INCLUDE_DIRS "") set(SQLITE3_LIBRARIES "") - set(INIPARSER_LIBRARIES "") - set(INIPARSER_INCLUDE_DIRS "") include_directories(${CSYNC_STATIC_COMPILE_DIR}) else (CSYNC_STATIC_COMPILE_DIR) find_package(SQLite3 REQUIRED) - find_package(Iniparser REQUIRED) endif() @@ -37,7 +34,6 @@ ${CSYNC_LIBRARY} ${CSTDLIB_LIBRARY} ${CSYNC_REQUIRED_LIBRARIES} - ${INIPARSER_LIBRARIES} ${SQLITE3_LIBRARIES} ) @@ -48,6 +44,7 @@ set(csync_SRCS csync.c + ini.c csync_config.c csync_exclude.c csync_statedb.c Index: csync-owncloud/src/csync_config.c =================================================================== --- csync-owncloud.orig/src/csync_config.c 2012-12-14 17:51:27.564798202 +0100 +++ csync-owncloud/src/csync_config.c 2012-12-14 17:56:36.171739975 +0100 @@ -23,12 +23,12 @@ /* #define _GNU_SOURCE */ #include <stdio.h> -#include <iniparser.h> #include "c_lib.h" #include "c_private.h" #include "csync_private.h" #include "csync_config.h" +#include "ini.h" #include "csync_misc.h" #define CSYNC_LOG_CATEGORY_NAME "csync.config" @@ -75,9 +75,47 @@ return re; } -int csync_config_load(CSYNC *ctx, const char *config) { - dictionary *dict; +static int csync_config_handle(void *user_data, const char *section, + const char *name, const char *value) { + CSYNC *ctx = (CSYNC *)user_data; + + if (strcmp(section, "global") != 0) { + return 1; + } + + if (strcmp(name, "max_depth") == 0) { + ctx->options.max_depth = atoi(value); + return 1; + } + if (strcmp(name, "max_time_difference") == 0) { + ctx->options.max_time_difference = atoi(value); + return 1; + } + + if (strcmp(name, "sync_symbolic_links") == 0) { + switch (value[0]) { + case 'y': + case 'Y': + case 't': + case 'T': + case '1': + ctx->options.sync_symbolic_links = 1; + return 1; + case 'n': + case 'N': + case 'f': + case 'F': + case '0': + ctx->options.sync_symbolic_links = 0; + return 1; + } + } + + return 1; +} + +int csync_config_load(CSYNC *ctx, const char *config) { /* copy default config, if no config exists */ if (! c_isfile(config)) { /* check if there is still one csync.conf left over in $HOME/.csync @@ -125,27 +163,21 @@ } } - dict = iniparser_load(config); - if (dict == NULL) { + ctx->options.max_depth = MAX_DEPTH; + ctx->options.max_time_difference = MAX_TIME_DIFFERENCE; + ctx->options.sync_symbolic_links = 0; + + if (ini_parse(config, csync_config_handle, (void *)ctx) < 0) { return -1; } - ctx->options.max_depth = iniparser_getint(dict, "global:max_depth", MAX_DEPTH); CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "Config: max_depth = %d", ctx->options.max_depth); - - ctx->options.max_time_difference = iniparser_getint(dict, - "global:max_time_difference", MAX_TIME_DIFFERENCE); CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "Config: max_time_difference = %d", ctx->options.max_time_difference); - - ctx->options.sync_symbolic_links = iniparser_getboolean(dict, - "global:sync_symbolic_links", 0); CSYNC_LOG(CSYNC_LOG_PRIORITY_TRACE, "Config: sync_symbolic_links = %d", ctx->options.sync_symbolic_links); - iniparser_freedict(dict); - return 0; } Index: csync-owncloud/src/ini.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ csync-owncloud/src/ini.c 2012-12-14 17:52:36.000000000 +0100 @@ -0,0 +1,149 @@ +/* inih -- simple .INI file parser + +inih is released under the New BSD license (see LICENSE.txt). Go to the project +home page for more info: + +http://code.google.com/p/inih/ + +*/ + +#include <stdio.h> +#include <ctype.h> +#include <string.h> + +#include "ini.h" + +#define MAX_LINE 200 +#define MAX_SECTION 50 +#define MAX_NAME 50 + +/* Strip whitespace chars off end of given string, in place. Return s. */ +static char* rstrip(char* s) +{ + char* p = s + strlen(s); + while (p > s && isspace(*--p)) + *p = '\0'; + return s; +} + +/* Return pointer to first non-whitespace char in given string. */ +static char* lskip(const char* s) +{ + while (*s && isspace(*s)) + s++; + return (char*)s; +} + +/* Return pointer to first char c or ';' comment in given string, or pointer to + null at end of string if neither found. ';' must be prefixed by a whitespace + character to register as a comment. */ +static char* find_char_or_comment(const char* s, char c) +{ + int was_whitespace = 0; + while (*s && *s != c && !(was_whitespace && *s == ';')) { + was_whitespace = isspace(*s); + s++; + } + return (char*)s; +} + +/* Version of strncpy that ensures dest (size bytes) is null-terminated. */ +static char* strncpy0(char* dest, const char* src, size_t size) +{ + strncpy(dest, src, size); + dest[size - 1] = '\0'; + return dest; +} + +/* See documentation in header file. */ +int ini_parse_file(FILE* file, + int (*handler)(void*, const char*, const char*, + const char*), + void* user) +{ + /* Uses a fair bit of stack (use heap instead if you need to) */ + char line[MAX_LINE]; + char section[MAX_SECTION] = ""; + char prev_name[MAX_NAME] = ""; + + char* start; + char* end; + char* name; + char* value; + int lineno = 0; + int error = 0; + + /* Scan through file line by line */ + while (fgets(line, sizeof(line), file) != NULL) { + lineno++; + start = lskip(rstrip(line)); + + if (*start == ';' || *start == '#') { + /* Per Python ConfigParser, allow '#' comments at start of line */ + } +#if INI_ALLOW_MULTILINE + else if (*prev_name && *start && start > line) { + /* Non-black line with leading whitespace, treat as continuation + of previous name's value (as per Python ConfigParser). */ + if (!handler(user, section, prev_name, start) && !error) + error = lineno; + } +#endif + else if (*start == '[') { + /* A "[section]" line */ + end = find_char_or_comment(start + 1, ']'); + if (*end == ']') { + *end = '\0'; + strncpy0(section, start + 1, sizeof(section)); + *prev_name = '\0'; + } + else if (!error) { + /* No ']' found on section line */ + error = lineno; + } + } + else if (*start && *start != ';') { + /* Not a comment, must be a name[=:]value pair */ + end = find_char_or_comment(start, '='); + if (*end != '=') { + end = find_char_or_comment(start, ':'); + } + if (*end == '=' || *end == ':') { + *end = '\0'; + name = rstrip(start); + value = lskip(end + 1); + end = find_char_or_comment(value, '\0'); + if (*end == ';') + *end = '\0'; + rstrip(value); + + /* Valid name[=:]value pair found, call handler */ + strncpy0(prev_name, name, sizeof(prev_name)); + if (!handler(user, section, name, value) && !error) + error = lineno; + } + else if (!error) { + /* No '=' or ':' found on name[=:]value line */ + error = lineno; + } + } + } + + return error; +} + +/* See documentation in header file. */ +int ini_parse(const char* filename, + int (*handler)(void*, const char*, const char*, const char*), + void* user) +{ + FILE* file; + int error; + + file = fopen(filename, "r"); + if (!file) + return -1; + error = ini_parse_file(file, handler, user); + fclose(file); + return error; +} Index: csync-owncloud/src/ini.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ csync-owncloud/src/ini.h 2012-12-14 17:52:36.000000000 +0100 @@ -0,0 +1,55 @@ +/* inih -- simple .INI file parser + +inih is released under the New BSD license (see LICENSE.txt). Go to the project +home page for more info: + +http://code.google.com/p/inih/ + +*/ + +#ifndef __INI_H__ +#define __INI_H__ + +/* Make this header file easier to include in C++ code */ +#ifdef __cplusplus +extern "C" { +#endif + +#include <stdio.h> + +/* Parse given INI-style file. May have [section]s, name=value pairs + (whitespace stripped), and comments starting with ';' (semicolon). Section + is "" if name=value pair parsed before any section heading. name:value + pairs are also supported as a concession to Python's ConfigParser. + + For each name=value pair parsed, call handler function with given user + pointer as well as section, name, and value (data only valid for duration + of handler call). Handler should return nonzero on success, zero on error. + + Returns 0 on success, line number of first error on parse error (doesn't + stop on first error), or -1 on file open error. +*/ +int ini_parse(const char* filename, + int (*handler)(void* user, const char* section, + const char* name, const char* value), + void* user); + +/* Same as ini_parse(), but takes a FILE* instead of filename. This doesn't + close the file when it's finished -- the caller must do that. */ +int ini_parse_file(FILE* file, + int (*handler)(void* user, const char* section, + const char* name, const char* value), + void* user); + +/* Nonzero to allow multi-line value parsing, in the style of Python's + ConfigParser. If allowed, ini_parse() will call the handler with the same + name for each subsequent line parsed. */ +#ifndef INI_ALLOW_MULTILINE +#define INI_ALLOW_MULTILINE 1 +#endif + +#ifdef __cplusplus +} +#endif + +#endif /* __INI_H__ */ Index: csync-owncloud/cmake/Modules/FindIniparser.cmake =================================================================== --- csync-owncloud.orig/cmake/Modules/FindIniparser.cmake 2012-12-14 17:51:27.564798202 +0100 +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 @@ -1,40 +0,0 @@ -# - Try to find Iniparser -# Once done this will define -# -# INIPARSER_FOUND - system has Iniparser -# INIPARSER_INCLUDE_DIRS - the Iniparser include directory -# INIPARSER_LIBRARIES - Link these to use Iniparser -# INIPARSER_DEFINITIONS - Compiler switches required for using Iniparser -# -# Copyright (c) 2007 Andreas Schneider <m...@cynapses.org> -# (c) 2012 Dominik Schmidt <d...@dominik-schmidt.org> -# -# Redistribution and use is allowed according to the terms of the New -# BSD license. -# For details see the accompanying COPYING-CMAKE-SCRIPTS file. -# - -include(GNUInstallDirs) - -find_path(INIPARSER_INCLUDE_DIRS - NAMES - iniparser.h - HINTS - ${CMAKE_INSTALL_INCLUDEDIR} -) - -find_library(INIPARSER_LIBRARIES - NAMES - iniparser - HINTS - ${CMAKE_INSTALL_PREFIX}/lib - ${CMAKE_INSTALL_PREFIX}/lib64 - ${CMAKE_INSTALL_LIBDIR} -) - -include(FindPackageHandleStandardArgs) -find_package_handle_standard_args(Iniparser - REQUIRED_VARS INIPARSER_LIBRARIES INIPARSER_INCLUDE_DIRS -) - -
signature.asc
Description: This is a digitally signed message part.
_______________________________________________ Owncloud mailing list Owncloud@kde.org https://mail.kde.org/mailman/listinfo/owncloud