[Pkg-privacy-commits] [irssi-plugin-otr] 56/267: Now it's really irc-otr with a subdir for each module.

Ximin Luo infinity0 at moszumanska.debian.org
Sat Aug 22 12:26:16 UTC 2015


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch debian
in repository irssi-plugin-otr.

commit 07350ac70c6f5b31ce3c892aa78f2d5be04832b6
Author: Uli Meis <a.sporto+bee at gmail.com>
Date:   Wed Feb 11 17:02:43 2009 +0100

    Now it's really irc-otr with a subdir for each module.
---
 CMakeLists.txt                   | 168 +++++++++------------------------------
 Packaging.cmake                  |   4 +-
 README                           |  41 +++++-----
 io-config.h.in                   |   2 +-
 irssi/CMakeLists.txt             |  74 +++++++++++++++++
 irssi_otr.c => irssi/irssi_otr.c |   2 +-
 irssi_otr.h => irssi/irssi_otr.h |   2 +
 mksrcpackage.sh                  |  36 ++-------
 otr.h                            |   2 +-
 otr_key.c                        |  16 ++--
 otr_ops.c                        |   2 +-
 otr_util.c                       |   2 +-
 xchat/CMakeLists.txt             |  38 +++++++++
 xchat_otr.c => xchat/xchat_otr.c |   2 +-
 xchat_otr.h => xchat/xchat_otr.h |   4 +-
 15 files changed, 200 insertions(+), 195 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 39a1210..4f7f28f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1,5 +1,5 @@
 #
-# Off-the-Record Messaging (OTR) module for the irssi IRC client
+# Off-the-Record Messaging (OTR) modules for IRC
 # Copyright (C) 2008  Uli Meis <a.sporto+bee at gmail.com>
 #
 # This program is free software; you can redistribute it and/or modify
@@ -17,7 +17,7 @@
 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,USA
 #
 
-PROJECT(irssi-otr)
+PROJECT(irc-otr)
 
 CMAKE_MINIMUM_REQUIRED(VERSION 2.4)
 IF(COMMAND cmake_policy)
@@ -37,22 +37,22 @@ INCLUDE(tarballdefs.cmake OPTIONAL)
 
 # get version from git
 
-IF(NOT IRSSIOTR_VERSION)
+IF(NOT IRCOTR_VERSION)
   IF(NOT EXISTS "${PROJECT_SOURCE_DIR}/.git")
-    MESSAGE(FATAL_ERROR "Cannot determine the irssi-otr version since this is "
-    "not a git checkout. Please set IRSSIOTR_VERSION, e.g.
-    cmake -DIRSSIOTR_VERSION=mydistro-0.1
+    MESSAGE(FATAL_ERROR "Cannot determine the irc-otr version since this is "
+    "not a git checkout. Please set IRCOTR_VERSION, e.g.
+    cmake -DIRCOTR_VERSION=mydistro-0.1
     or
-    cmake -DIRSSIOTR_VERSION=mydistro-git-<git-commit>")
+    cmake -DIRCOTR_VERSION=mydistro-git-<git-commit>")
   ENDIF(NOT EXISTS "${PROJECT_SOURCE_DIR}/.git")
-  FIND_GIT_TAGORCOMMIT(${PROJECT_SOURCE_DIR} IRSSIOTR_VERSION)
-  IF(NOT IRSSIOTR_VERSION)
+  FIND_GIT_TAGORCOMMIT(${PROJECT_SOURCE_DIR} IRCOTR_VERSION)
+  IF(NOT IRCOTR_VERSION)
     MESSAGE(FATAL_ERROR 
-      "Couldn't determine version. Please run cmake -DIRSSIOTR_VERSION=...")
-  ENDIF(NOT IRSSIOTR_VERSION)
-ENDIF(NOT IRSSIOTR_VERSION)
+      "Couldn't determine version. Please run cmake -DIRCOTR_VERSION=...")
+  ENDIF(NOT IRCOTR_VERSION)
+ENDIF(NOT IRCOTR_VERSION)
 
-MESSAGE(STATUS "Building irssi-otr version ${IRSSIOTR_VERSION}")
+MESSAGE(STATUS "Building irc-otr version ${IRCOTR_VERSION}")
 
 # PkgConfig. Only available since 2.4.7, fetch if unavailable so people with
 # older cmake can run this
@@ -100,78 +100,17 @@ FIND_PACKAGE(LibGcrypt REQUIRED)
 
 # includes
 
-SET(IRSSIOTR_INCLUDE_DIRS
+SET(IRCOTR_INCLUDE_DIRS
   ${PROJECT_SOURCE_DIR} 
   ${PROJECT_BINARY_DIR} 
   ${GLIB_INCLUDE_DIRS} 
   ${LIBOTR_INCLUDE_DIRS})
 
-SET(CMAKE_REQUIRED_INCLUDES ${IRSSIOTR_INCLUDE_DIRS})
+SET(CMAKE_REQUIRED_INCLUDES ${IRCOTR_INCLUDE_DIRS})
 SET(CMAKE_REQUIRED_DEFINITIONS -DHAVE_CONFIG_H ${LIBGCRYPT_CFLAGS})
 
-# irssi public headers
-
-FIND_PATH(IRSSI_INCLUDE_DIR NAMES irssi/src/core/module.h)
-MARK_AS_ADVANCED(IRSSI_INCLUDE_DIR)
-
-IF(NOT IRSSI_INCLUDE_DIR)
-  MESSAGE(STATUS "*** no irssi found ***")
-ELSEIF(BUILDFOR AND NOT BUILDFOR STREQUAL "irssi")
-  MESSAGE(STATUS "*** not building for irssi ***")
-ELSE(NOT IRSSI_INCLUDE_DIR)
-  MESSAGE(STATUS "*** building for irssi ***")
-  SET(HAVE_IRSSI 1)
-  SET(IRSSIOTR_INCLUDE_DIRS
-    ${IRSSIOTR_INCLUDE_DIRS}
-    ${IRSSI_INCLUDE_DIR}/irssi
-    ${IRSSI_INCLUDE_DIR}/irssi/src
-    ${IRSSI_INCLUDE_DIR}/irssi/src/core
-    ${PROJECT_BINARY_DIR}/irssi-headers
-    ${PROJECT_SOURCE_DIR}/irssi-headers)
-
-  SET(CMAKE_REQUIRED_INCLUDES ${IRSSIOTR_INCLUDE_DIRS})
-
-  # irssi statusbar header
-
-  CHECK_INCLUDE_FILES("glib.h;common.h;fe-text/statusbar-item.h" HAVE_IRSSISBAR_H)
-
-  # Bad hack
-
-  IF (NOT HAVE_IRSSISBAR_H)
-    MESSAGE(STATUS "Need to fetch irssi header statusbar-item.h (you don't have it yet)")
-    IF (NOT WGET_EXECUTABLE)
-      FIND_PACKAGE(Wget REQUIRED)
-    ENDIF (NOT WGET_EXECUTABLE)
-    EXECUTE_PROCESS(COMMAND "mkdir" -p irssi-headers/fe-text)
-    EXECUTE_PROCESS(COMMAND "bash" "-c"
-      "${WGET_EXECUTABLE} '--post-data=revision=4936&root=irssi' \\
-      'http://svn.irssi.org/cgi-bin/viewvc.cgi/irssi/trunk/src/fe-text/statusbar-item.h' || exit 1"
-      ${PROJECT_SOURCE_DIR} WORKING_DIRECTORY irssi-headers/fe-text
-      RESULT_VARIABLE IISBAR_RET)
-    IF(NOT IISBAR_RET EQUAL 0)
-      MESSAGE(FATAL_ERROR "Couldn't check out irssi headers from SVN")
-    ENDIF(NOT IISBAR_RET EQUAL 0)
-    SET(HAVE_IRSSISBAR_H 1 CACHE INTERNAL "Having irssi headers" FORCE)
-  ENDIF (NOT HAVE_IRSSISBAR_H)
-
-ENDIF(NOT IRSSI_INCLUDE_DIR)
-
-FIND_PATH(XCHAT_INCLUDE_DIR NAMES xchat/xchat-plugin.h)
-MARK_AS_ADVANCED(XCHAT_INCLUDE_DIR)
-
-IF(NOT XCHAT_INCLUDE_DIR)
-  MESSAGE(STATUS "*** no xchat found ***")
-ELSEIF(BUILDFOR AND NOT BUILDFOR STREQUAL "xchat")
-  MESSAGE(STATUS "*** not building for xchat ***")
-ELSE(NOT XCHAT_INCLUDE_DIR)
-  MESSAGE(STATUS "*** building for xchat ***")
-  SET(HAVE_XCHAT 1)
-  SET(IRSSIOTR_INCLUDE_DIRS
-    ${IRSSIOTR_INCLUDE_DIRS}
-    ${XCHAT_INCLUDE_DIR}/xchat)
-ENDIF(NOT XCHAT_INCLUDE_DIR)
-
-include_directories(${IRSSIOTR_INCLUDE_DIRS})
+
+include_directories(${IRCOTR_INCLUDE_DIRS})
 
 # gregex.h 
 # available since 2.13 AFAIK
@@ -198,17 +137,11 @@ MESSAGE(STATUS "This is a ${CMAKE_BUILD_TYPE} build")
 
 ADD_DEFINITIONS(-DHAVE_CONFIG_H -Wall ${LIBGCRYPT_CFLAGS})
 
-# docdir
-
-IF(NOT DOCDIR)
-  SET(DOCDIR share/doc/${CMAKE_PROJECT_NAME})
-ENDIF(NOT DOCDIR)
-
 # generate otr-formats.{c,h}
 
 ADD_CUSTOM_COMMAND(OUTPUT 
-  ${PROJECT_BINARY_DIR}/otr-formats.c 
-  ${PROJECT_BINARY_DIR}/xchat-formats.c 
+  otr-formats.c 
+  xchat-formats.c 
   DEPENDS makeformats.py formats.txt README
   COMMAND 
   ${PYTHON_EXECUTABLE}
@@ -217,8 +150,6 @@ ADD_CUSTOM_COMMAND(OUTPUT
   ${PROJECT_SOURCE_DIR}/README
   )
 
-# lib
-
 # Now that took some time to figure out...
 
 IF(APPLE)
@@ -229,52 +160,31 @@ FOREACH(X ${LIBGCRYPT_LDFLAGS} ${GLIB_LDFLAGS} ${APPLE_LDFLAGS})
   SET(MAIN_LDFLAGS "${MAIN_LDFLAGS} ${X}")
 ENDFOREACH(X ${LIBGCRYPT_LDFLAGS} ${GLIB_LDFLAGS} ${APPLE_LDFLAGS})
 
-IF(HAVE_IRSSI)
-  ADD_LIBRARY(irssiotr SHARED irssi_otr.c otr_util.c otr_ops.c otr_key.c ${PROJECT_BINARY_DIR}/otr-formats.c)
-  TARGET_LINK_LIBRARIES(irssiotr ${GLIB_LIBRARIES} ${LIBOTR_LIBRARIES})
-  SET_TARGET_PROPERTIES(irssiotr PROPERTIES 
-    COMPILE_FLAGS -DTARGET_IRSSI
-    OUTPUT_NAME "otr"
-    LINK_FLAGS "${MAIN_LDFLAGS}")
-  IF(APPLE)
-    SET_TARGET_PROPERTIES(irssiotr PROPERTIES SUFFIX ".so")
-  ENDIF(APPLE)
-ENDIF(HAVE_IRSSI)
-
-IF(HAVE_XCHAT)
-  ADD_LIBRARY(xchatotr SHARED xchat_otr.c otr_util.c otr_ops.c otr_key.c ${PROJECT_BINARY_DIR}/xchat-formats.c)
-  TARGET_LINK_LIBRARIES(xchatotr ${GLIB_LIBRARIES} ${LIBOTR_LIBRARIES})
-  SET_TARGET_PROPERTIES(xchatotr PROPERTIES 
-    COMPILE_FLAGS -DTARGET_XCHAT
-    OUTPUT_NAME "xchatotr"
-    LINK_FLAGS "${MAIN_LDFLAGS}")
-  IF(APPLE)
-    SET_TARGET_PROPERTIES(xchatotr PROPERTIES SUFFIX ".so")
-  ENDIF(APPLE)
-ENDIF(HAVE_XCHAT)
+IF(CMAKE_SOURCE_DIR MATCHES "irssi[^/]*$")
+  SET(WANT_IRSSI ON)
+ELSEIF(CMAKE_SOURCE_DIR MATCHES "xchat[^/]*$")
+  SET(WANT_XCHAT ON)
+ELSE(CMAKE_SOURCE_DIR MATCHES "irssi[^/]*$")
+  SET(WANT_IRSSI ON)
+  SET(WANT_XCHAT ON)
+ENDIF(CMAKE_SOURCE_DIR MATCHES "irssi[^/]*$")
+
+OPTION(WANT_IRSSI "build irssi plugin" ${WANT_IRSSI})
+OPTION(WANT_XCHAT "build xchat plugin" ${WANT_XCHAT})
+
+IF(WANT_IRSSI)
+  INCLUDE(irssi/CMakeLists.txt)
+ENDIF(WANT_IRSSI)
+IF(WANT_XCHAT)
+  INCLUDE(xchat/CMakeLists.txt)
+ENDIF(WANT_XCHAT)
 
 # cscope
 
 FILE(GLOB CSANDHS *.c *.h)
-ADD_CSCOPE_TARGET("${CSANDHS}" "${IRSSIOTR_INCLUDE_DIRS}")
-
-# Install / CPack
-
-IF(CMAKE_INSTALL_TYPE MATCHES "package-.*")
-  INCLUDE(Packaging.cmake)
-ELSEIF(CMAKE_INSTALL_TYPE MATCHES "home")
-  INSTALL(TARGETS irssiotr DESTINATION "$ENV{HOME}/.irssi/modules")
-ELSE(CMAKE_INSTALL_TYPE MATCHES "package-.*")
-  IF(HAVE_IRSSI)
-    INSTALL(TARGETS irssiotr DESTINATION lib${LIB_SUFFIX}/irssi/modules)
-  ENDIF(HAVE_IRSSI)
-  IF(HAVE_XCHAT)
-    INSTALL(TARGETS xchatotr DESTINATION lib${LIB_SUFFIX}/xchat/plugins)
-  ENDIF(HAVE_XCHAT)
-  INSTALL(FILES README LICENSE DESTINATION ${DOCDIR})
-ENDIF(CMAKE_INSTALL_TYPE MATCHES "package-.*")
+ADD_CSCOPE_TARGET("${CSANDHS}" "${IRCOTR_INCLUDE_DIRS}")
 
 # Source tarball
 ADD_CUSTOM_TARGET(src-tarball 
   ${PROJECT_SOURCE_DIR}/mksrcpackage.sh ${PROJECT_SOURCE_DIR} 
-  ${IRSSIOTR_VERSION})
+  ${IRCOTR_VERSION})
diff --git a/Packaging.cmake b/Packaging.cmake
index 3dfea56..e57d041 100644
--- a/Packaging.cmake
+++ b/Packaging.cmake
@@ -8,11 +8,11 @@ SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY
   "Off-The-Record Messaging (OTR) for irssi")
 
 SET(CPACK_PACKAGE_FILE_NAME
-  ${CMAKE_PROJECT_NAME}-${IRSSIOTR_VERSION})
+  ${CMAKE_PROJECT_NAME}-${IRCOTR_VERSION})
 
 SET(CPACK_GENERATOR TGZ)
 
-SET(CPACK_PACKAGE_VERSION ${IRSSIOTR_VERSION})
+SET(CPACK_PACKAGE_VERSION ${IRCOTR_VERSION})
 
 IF(CMAKE_INSTALL_TYPE STREQUAL "package-rpm")
   CMAKE_MINIMUM_REQUIRED(VERSION 2.6)
diff --git a/README b/README
index 394d891..31e46ce 100644
--- a/README
+++ b/README
@@ -1,22 +1,23 @@
-Quick start: Do "/load otr", write "?OTR?" to your OTR buddy, wait until the now
-ongoing key generation finishs and write "?OTR?" again. You should "go secure".
+Quick start:  Do "/load otr"  (irssi syntax), write  "?OTR?" to your  OTR buddy,
+wait until the now ongoing key  generation finishes and write "?OTR?" again. You
+should "go secure".
 
-Key generation happens in a seperate  process and its duration mainly depends on
+Key generation happens in a separate  process and its duration mainly depends on
 the available entropy. On  my desktop it takes about 6  Minutes, about 2 Minutes
 if I run  "du /" in parallel  and on an idle  server system it can  even take an
 hour.
 
-The  default  OTR policy  of  irssi-otr  is  now  something between  manual  and
-opportunistic. Manual means  you have to start it yourself  by issueing "?OTR?",
+The  default  OTR  policy  of  irc-otr  is  now  something  between  manual  and
+opportunistic. Manual  means you have to  start it yourself by  issuing "?OTR?",
 opportunistic means  both peers send  some magic  whitespace and start  OTR once
-they  receive this  whitespace from  the other  side. irssi-otr  uses a  mode in
-between  where  we  are  not  sending  whitespace  as  an  announcement  (as  in
-opportunistic) but we still  handle whitespace if we see it  from the other side
-(I'm  calling  it handlews).  Therefore  if  your  peer uses  opportunistic  the
-handshake should still start automatically once he writes something.
+they receive this whitespace from the other side. irc-otr uses a mode in between
+where we are not sending whitespace as an announcement (as in opportunistic) but
+we still  handle whitespace if  we see  it from the  other side (I'm  calling it
+handlews). Therefore if your peer  uses opportunistic the handshake should still
+start automatically once he writes something.
 
 You can  now set the  OTR policy  per peer via  the otr_policy /setting.  It's a
-comma seperated  list of "<nick>@<server> <policy>"  pairs where <nick>@<server>
+comma separated  list of "<nick>@<server> <policy>"  pairs where <nick>@<server>
 is interpreted as a glob pattern, i.e. you can use wildcard "*" and joker "?" as
 you would  in a shell.  The policy  can be one  of never, manual,  handlews (the
 default),  opportunistic, and  always. Be  aware that  the opportunistic  policy
@@ -27,11 +28,11 @@ encrypted.
 If  a  fingerprint can  be  found  for someone,  i.e.  someone  you had  an  OTR
 conversation  with  before,  then  the otr_policy_known  setting  applies  after
 otr_policy. It has the same syntax. The  default is "* always", i.e. enforce OTR
-with  anyone you've  used  OTR with  before.
+with anyone you've used OTR with before.
 
-Should you finish an OTR session via "/otr finish" and should the active policy
-be always or opportunistic then it will be temporarily set back to handlews.
-Otherwise OTR would start again right away which is probably not what you want.
+Should you finish an OTR session via  "/otr finish" and should the active policy
+be always  or opportunistic then  it will be  temporarily set back  to handlews.
+Otherwise OTR would start again right away  which is probably not what you want.
 This is however reset once you close the query window.
 
 To make  sure that you are  actually talking to your  buddy, you can agree  on a
@@ -40,11 +41,11 @@ other  one will  be  asked to  do  the  same and  you're  done. The  traditional
 alternative, comparing  fingerprints over a secure  line, can also be  used. Use
 "/otr trust" once you're sure they match.
 
-I also strongly  recommend to do "/statusbar window add  otr" so you're informed
-about what's going on.
+I also  strongly recommend to do  "/statusbar window add otr"  (irssi syntax) so
+you're informed about what's going on.
 
-In  "~/.irssi/otr/otr.{key,fp}" you'll  find the  fingerprints and  your private
-keys(should you at any point be interested).
+In "<client config dir>/otr/otr.{key,fp}" you'll  find the fingerprints and your
+private keys(should you at any point be interested).
 
 Commands:
 
@@ -64,7 +65,7 @@ Commands:
 /otr finish [<nick>@<server>]
 	Finish an OTR conversation
 /otr version
-	Display irssi-otr version. Might be a git commit
+	Display irc-otr version. Might be a git commit
 
 Settings:
 
diff --git a/io-config.h.in b/io-config.h.in
index 02dd318..a753af6 100644
--- a/io-config.h.in
+++ b/io-config.h.in
@@ -1,3 +1,3 @@
 #cmakedefine HAVE_STRSIGNAL
 #cmakedefine HAVE_GREGEX_H
-#define IRSSIOTR_VERSION "${IRSSIOTR_VERSION}"
+#define IRCOTR_VERSION "${IRCOTR_VERSION}"
diff --git a/irssi/CMakeLists.txt b/irssi/CMakeLists.txt
new file mode 100644
index 0000000..10bd726
--- /dev/null
+++ b/irssi/CMakeLists.txt
@@ -0,0 +1,74 @@
+# irssi public headers
+
+FIND_PATH(IRSSI_INCLUDE_DIR NAMES irssi/src/core/module.h)
+MARK_AS_ADVANCED(IRSSI_INCLUDE_DIR)
+
+IF(NOT IRSSI_INCLUDE_DIR)
+  MESSAGE(STATUS "*** no irssi found ***")
+ELSEIF(BUILDFOR AND NOT BUILDFOR STREQUAL "irssi")
+  MESSAGE(STATUS "*** not building for irssi ***")
+ELSE(NOT IRSSI_INCLUDE_DIR)
+  MESSAGE(STATUS "*** building for irssi ***")
+  SET(HAVE_IRSSI 1)
+  SET(IRCOTR_INCLUDE_DIRS
+    ${IRCOTR_INCLUDE_DIRS}
+    ${IRSSI_INCLUDE_DIR}/irssi
+    ${IRSSI_INCLUDE_DIR}/irssi/src
+    ${IRSSI_INCLUDE_DIR}/irssi/src/core
+    ${PROJECT_BINARY_DIR}/irssi-headers
+    ${PROJECT_SOURCE_DIR}/irssi-headers
+    irssi)
+
+  INCLUDE_DIRECTORIES(${IRCOTR_INCLUDE_DIRS})
+
+  SET(CMAKE_REQUIRED_INCLUDES ${IRCOTR_INCLUDE_DIRS})
+
+  # irssi statusbar header
+
+  CHECK_INCLUDE_FILES("glib.h;common.h;fe-text/statusbar-item.h" HAVE_IRSSISBAR_H)
+
+  # Bad hack
+
+  IF (NOT HAVE_IRSSISBAR_H)
+    MESSAGE(STATUS "Need to fetch irssi header statusbar-item.h (you don't have it yet)")
+    IF (NOT WGET_EXECUTABLE)
+      FIND_PACKAGE(Wget REQUIRED)
+    ENDIF (NOT WGET_EXECUTABLE)
+    EXECUTE_PROCESS(COMMAND "mkdir" -p irssi-headers/fe-text)
+    EXECUTE_PROCESS(COMMAND "bash" "-c"
+      "${WGET_EXECUTABLE} '--post-data=revision=4936&root=irssi' \\
+      'http://svn.irssi.org/cgi-bin/viewvc.cgi/irssi/trunk/src/fe-text/statusbar-item.h' || exit 1"
+      ${PROJECT_SOURCE_DIR} WORKING_DIRECTORY irssi-headers/fe-text
+      RESULT_VARIABLE IISBAR_RET)
+    IF(NOT IISBAR_RET EQUAL 0)
+      MESSAGE(FATAL_ERROR "Couldn't check out irssi headers from SVN")
+    ENDIF(NOT IISBAR_RET EQUAL 0)
+    SET(HAVE_IRSSISBAR_H 1 CACHE INTERNAL "Having irssi headers" FORCE)
+  ENDIF (NOT HAVE_IRSSISBAR_H)
+
+ENDIF(NOT IRSSI_INCLUDE_DIR)
+
+IF(HAVE_IRSSI)
+  ADD_LIBRARY(irssiotr SHARED irssi/irssi_otr.c otr_util.c otr_ops.c otr_key.c ${CMAKE_BINARY_DIR}/otr-formats.c)
+  TARGET_LINK_LIBRARIES(irssiotr ${GLIB_LIBRARIES} ${LIBOTR_LIBRARIES})
+  SET_TARGET_PROPERTIES(irssiotr PROPERTIES 
+    COMPILE_FLAGS -DTARGET_IRSSI
+    OUTPUT_NAME "otr"
+    LINK_FLAGS "${MAIN_LDFLAGS}")
+  IF(APPLE)
+    SET_TARGET_PROPERTIES(irssiotr PROPERTIES SUFFIX ".so")
+  ENDIF(APPLE)
+ENDIF(HAVE_IRSSI)
+
+# docdir
+
+IF(NOT DOCDIR)
+  SET(DOCDIR share/doc/irssi-otr)
+ENDIF(NOT DOCDIR)
+
+IF(CMAKE_INSTALL_TYPE MATCHES "home")
+  INSTALL(TARGETS irssiotr DESTINATION "$ENV{HOME}/.irssi/modules")
+ELSE(CMAKE_INSTALL_TYPE MATCHES "home")
+  INSTALL(TARGETS irssiotr DESTINATION lib${LIB_SUFFIX}/irssi/modules)
+  INSTALL(FILES README LICENSE DESTINATION ${DOCDIR})
+ENDIF(CMAKE_INSTALL_TYPE MATCHES "home")
diff --git a/irssi_otr.c b/irssi/irssi_otr.c
similarity index 99%
rename from irssi_otr.c
rename to irssi/irssi_otr.c
index 7687601..81d04c9 100644
--- a/irssi_otr.c
+++ b/irssi/irssi_otr.c
@@ -222,7 +222,7 @@ static void cmd_help(const char *data, void *server, WI_ITEM_REC *item)
  */
 static void cmd_version(const char *data, void *server, WI_ITEM_REC *item)
 {
-	otr_noticest(TXT_CMD_VERSION,IRSSIOTR_VERSION);
+	otr_noticest(TXT_CMD_VERSION,IRCOTR_VERSION);
 }
 
 /*
diff --git a/irssi_otr.h b/irssi/irssi_otr.h
similarity index 97%
rename from irssi_otr.h
rename to irssi/irssi_otr.h
index ca63c1c..81643c6 100644
--- a/irssi_otr.h
+++ b/irssi/irssi_otr.h
@@ -17,6 +17,8 @@
 
 #define IRC_CTX SERVER_REC
 
+#define get_client_config_dir get_irssi_dir
+
 static IRC_CTX *IRCCTX_DUP(IRC_CTX *ircctx) __attribute__ ((unused));
 
 static IRC_CTX *IRCCTX_DUP(IRC_CTX *ircctx) {
diff --git a/mksrcpackage.sh b/mksrcpackage.sh
index af44b7d..7d75cbc 100755
--- a/mksrcpackage.sh
+++ b/mksrcpackage.sh
@@ -1,37 +1,17 @@
 #!/bin/bash
 if [ -z "$2" ]; then echo "Syntax: $0 <src-dir> <git-commit/tag>"; exit 1;fi
 SDIR="$1"
-#VER=`(cd "$SDIR/.git/refs/tags/" && ls -t)|head -n1|sed -e 's/.//'`
 VER=$2
 
 PKG=irc-otr-$VER.tar
 HDIR=irc-otr-$VER
 mkdir "$HDIR" &&\
-(cd "$SDIR" && git archive --format=tar --prefix=irc-otr-$VER/ HEAD )>$PKG &&\
 (cd "$HDIR" && ln -s ../irssi-headers &&\
-	echo -e "SET(IRSSIOTR_VERSION $VER)" >tarballdefs.cmake) &&\
-tar rhf $PKG "$HDIR" &&\
-rm $HDIR/{irssi-headers,tarballdefs.cmake} &&\
-rmdir $HDIR &&\
-gzip $PKG
-
-PKG=irssi-otr-$VER.tar
-HDIR=irssi-otr-$VER
-mkdir "$HDIR" &&\
-(cd "$SDIR" && git archive --format=tar --prefix=irssi-otr-$VER/ HEAD )>$PKG &&\
-(cd "$HDIR" && ln -s ../irssi-headers &&\
-	echo -e "SET(IRSSIOTR_VERSION $VER)\nSET(BUILDFOR irssi)" >tarballdefs.cmake) &&\
-tar rhf $PKG "$HDIR" &&\
-rm $HDIR/{irssi-headers,tarballdefs.cmake} &&\
-rmdir $HDIR &&\
-gzip $PKG
-
-PKG=xchat-otr-$VER.tar
-HDIR=xchat-otr-$VER
-mkdir "$HDIR" &&\
-(cd "$SDIR" && git archive --format=tar --prefix=xchat-otr-$VER/ HEAD )>$PKG &&\
-(cd "$HDIR" && echo -e "SET(IRSSIOTR_VERSION $VER)\nSET(BUILDFOR xchat)" >tarballdefs.cmake) &&\
-tar rhf $PKG "$HDIR" &&\
-rm $HDIR/tarballdefs.cmake &&\
-rmdir $HDIR &&\
-gzip $PKG
+	echo -e "SET(IRCOTR_VERSION $VER)" >tarballdefs.cmake) &&\
+	for plugin in irc xchat irssi; do
+		pkg=$plugin-otr-$VER
+		(cd "$SDIR" && git archive --format=tar --prefix=$pkg/ HEAD )>$pkg.tar &&\
+		tar rhf $pkg.tar "$HDIR" 
+		gzip $pkg.tar
+	done && rm $HDIR/{irssi-headers,tarballdefs.cmake} &&\
+rmdir $HDIR
diff --git a/otr.h b/otr.h
index bb7fb02..d1e8c3b 100644
--- a/otr.h
+++ b/otr.h
@@ -1,5 +1,5 @@
 /*
- * Off-the-Record Messaging (OTR) module for the irssi IRC client
+ * Off-the-Record Messaging (OTR) modules for IRC
  * Copyright (C) 2008  Uli Meis <a.sporto+bee at gmail.com>
  *
  * This program is free software; you can redistribute it and/or modify
diff --git a/otr_key.c b/otr_key.c
index 9e32158..ee89193 100644
--- a/otr_key.c
+++ b/otr_key.c
@@ -1,5 +1,5 @@
 /*
- * Off-the-Record Messaging (OTR) module for the irssi IRC client
+ * Off-the-Record Messaging (OTR) modules for IRC
  * Copyright (C) 2008  Uli Meis <a.sporto+bee at gmail.com>
  *
  * This program is free software; you can redistribute it and/or modify
@@ -90,9 +90,9 @@ gboolean keygen_complete(GIOChannel *source, GIOCondition condition,
 			 gpointer data)
 {
 	gcry_error_t err;
-	const char *irssidir = get_irssi_dir();
-	char *filename    = g_strconcat(irssidir,KEYFILE,NULL);
-	char *tmpfilename = g_strconcat(irssidir,TMPKEYFILE,NULL);
+	const char *clconfdir = get_client_config_dir();
+	char *filename    = g_strconcat(clconfdir,KEYFILE,NULL);
+	char *tmpfilename = g_strconcat(clconfdir,TMPKEYFILE,NULL);
 
 	read(g_io_channel_unix_get_fd(kg_st.ch[0]),&err,sizeof(err));
 
@@ -138,7 +138,7 @@ void keygen_run(const char *accname)
 	gcry_error_t err;
 	int ret;
 	int fds[2];
-	char *filename = g_strconcat(get_irssi_dir(),TMPKEYFILE,NULL);
+	char *filename = g_strconcat(get_client_config_dir(),TMPKEYFILE,NULL);
 	char *dir = dirname(g_strdup(filename));
 
 	if (kg_st.status!=KEYGEN_NO) {
@@ -236,7 +236,7 @@ void keygen_abort(int ignoreidle)
 void otr_writefps()
 {
 	gcry_error_t err;
-	char *filename = g_strconcat(get_irssi_dir(),FPSFILE,NULL);
+	char *filename = g_strconcat(get_client_config_dir(),FPSFILE,NULL);
 
 	err = otrl_privkey_write_fingerprints(otr_state,filename);
 
@@ -256,7 +256,7 @@ void otr_writefps()
 void key_load()
 {
 	gcry_error_t err;
-	char *filename = g_strconcat(get_irssi_dir(),KEYFILE,NULL);
+	char *filename = g_strconcat(get_client_config_dir(),KEYFILE,NULL);
 
 	if (!g_file_test(filename, G_FILE_TEST_EXISTS)) {
 		otr_noticest(TXT_KEY_NOT_FOUND);
@@ -281,7 +281,7 @@ void key_load()
 void fps_load()
 {
 	gcry_error_t err;
-	char *filename = g_strconcat(get_irssi_dir(),FPSFILE,NULL);
+	char *filename = g_strconcat(get_client_config_dir(),FPSFILE,NULL);
 
 	if (!g_file_test(filename, G_FILE_TEST_EXISTS)) {
 		otr_noticest(TXT_FP_NOT_FOUND);
diff --git a/otr_ops.c b/otr_ops.c
index 38bab3f..8da3800 100644
--- a/otr_ops.c
+++ b/otr_ops.c
@@ -1,5 +1,5 @@
 /*
- * Off-the-Record Messaging (OTR) module for the irssi IRC client
+ * Off-the-Record Messaging (OTR) modules for IRC
  * Copyright (C) 2008  Uli Meis <a.sporto+bee at gmail.com>
  *
  * This program is free software; you can redistribute it and/or modify
diff --git a/otr_util.c b/otr_util.c
index 5ed5720..bbffa46 100644
--- a/otr_util.c
+++ b/otr_util.c
@@ -1,5 +1,5 @@
 /*
- * Off-the-Record Messaging (OTR) module for the irssi IRC client
+ * Off-the-Record Messaging (OTR) modules for IRC
  * Copyright (C) 2008  Uli Meis <a.sporto+bee at gmail.com>
  *
  * This program is free software; you can redistribute it and/or modify
diff --git a/xchat/CMakeLists.txt b/xchat/CMakeLists.txt
new file mode 100644
index 0000000..2407d19
--- /dev/null
+++ b/xchat/CMakeLists.txt
@@ -0,0 +1,38 @@
+FIND_PATH(XCHAT_INCLUDE_DIR NAMES xchat/xchat-plugin.h)
+MARK_AS_ADVANCED(XCHAT_INCLUDE_DIR)
+
+IF(NOT XCHAT_INCLUDE_DIR)
+  MESSAGE(STATUS "*** no xchat found ***")
+ELSEIF(BUILDFOR AND NOT BUILDFOR STREQUAL "xchat")
+  MESSAGE(STATUS "*** not building for xchat ***")
+ELSE(NOT XCHAT_INCLUDE_DIR)
+  MESSAGE(STATUS "*** building for xchat ***")
+  SET(HAVE_XCHAT 1)
+  SET(IRCOTR_INCLUDE_DIRS
+    ${IRCOTR_INCLUDE_DIRS}
+    ${XCHAT_INCLUDE_DIR}/xchat
+    xchat)
+ENDIF(NOT XCHAT_INCLUDE_DIR)
+
+INCLUDE_DIRECTORIES(${IRCOTR_INCLUDE_DIRS})
+
+IF(HAVE_XCHAT)
+  ADD_LIBRARY(xchatotr SHARED xchat/xchat_otr.c otr_util.c otr_ops.c otr_key.c ${PROJECT_BINARY_DIR}/xchat-formats.c)
+  TARGET_LINK_LIBRARIES(xchatotr ${GLIB_LIBRARIES} ${LIBOTR_LIBRARIES})
+  SET_TARGET_PROPERTIES(xchatotr PROPERTIES 
+    COMPILE_FLAGS -DTARGET_XCHAT
+    OUTPUT_NAME "xchatotr"
+    LINK_FLAGS "${MAIN_LDFLAGS}")
+  IF(APPLE)
+    SET_TARGET_PROPERTIES(xchatotr PROPERTIES SUFFIX ".so")
+  ENDIF(APPLE)
+ENDIF(HAVE_XCHAT)
+
+# docdir
+
+IF(NOT DOCDIR)
+  SET(DOCDIR share/doc/xchat-otr)
+ENDIF(NOT DOCDIR)
+
+INSTALL(TARGETS xchatotr DESTINATION lib${LIB_SUFFIX}/xchat/plugins)
+INSTALL(FILES README LICENSE DESTINATION ${DOCDIR})
diff --git a/xchat_otr.c b/xchat/xchat_otr.c
similarity index 99%
rename from xchat_otr.c
rename to xchat/xchat_otr.c
index 6d85c88..05dcd47 100644
--- a/xchat_otr.c
+++ b/xchat/xchat_otr.c
@@ -49,7 +49,7 @@ int cmd_otr(char *word[], char *word_eol[], void *userdata)
 		debug = !debug;
 		otr_noticest(debug ? TXT_CMD_DEBUG_ON : TXT_CMD_DEBUG_OFF);
 	} else if (strcmp(cmd,"version")==0) {
-		otr_noticest(TXT_CMD_VERSION,IRSSIOTR_VERSION);
+		otr_noticest(TXT_CMD_VERSION,IRCOTR_VERSION);
 	} else if (strcmp(cmd,"finish")==0) {
 		if (word[3]&&*word[3])
 			otr_finish(NULL,NULL,word[3],TRUE);
diff --git a/xchat_otr.h b/xchat/xchat_otr.h
similarity index 93%
rename from xchat_otr.h
rename to xchat/xchat_otr.h
index afea3f9..a103efd 100644
--- a/xchat_otr.h
+++ b/xchat/xchat_otr.h
@@ -2,7 +2,7 @@
 
 #define PNAME "xchat-otr"
 #define PDESC "Off-The-Record Messaging for xchat"
-#define PVERSION IRSSIOTR_VERSION
+#define PVERSION IRCOTR_VERSION
 
 #define MAX_FORMAT_PARAMS 10
 
@@ -28,7 +28,7 @@ enum { MSGLEVEL_CRAP, MSGLEVEL_MSGS } lvls;
 extern xchat_plugin *ph;   /* plugin handle */
 
 #define statusbar_items_redraw(name) ;
-#define get_irssi_dir() xchat_get_info(ph,"xchatdir")
+#define get_client_config_dir() xchat_get_info(ph,"xchatdir")
 
 void printformat(IRC_CTX *ircctx, const char *nick, int lvl, int fnum, ...);
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/irssi-plugin-otr.git



More information about the Pkg-privacy-commits mailing list