[Pkg-privacy-commits] [irssi-plugin-otr] 22/267: Source package with irssi headers

Ximin Luo infinity0 at moszumanska.debian.org
Sat Aug 22 12:41:24 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 de8830edc24e09bfcfba7291b4a5cb350ee9803a
Author: Uli Meis <a.sporto+bee at gmail.com>
Date:   Tue Jul 1 00:20:05 2008 +0200

    Source package with irssi headers
---
 CMakeLists.txt      | 51 +++++++++++++++++++++++++++++++--------------------
 HOWTO_PACKAGE       |  3 ++-
 Packaging-DEB.cmake |  2 +-
 mksrcpackage.sh     | 14 ++++++++++++++
 4 files changed, 48 insertions(+), 22 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index b72e113..130c7b4 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -32,6 +32,8 @@ INCLUDE(cmake-extensions/cscope.cmake)
 INCLUDE(cmake-extensions/Git.cmake)
 INCLUDE(CheckFunctionExists)
 INCLUDE(CheckIncludeFile)
+INCLUDE(CheckIncludeFiles)
+INCLUDE(tarballdefs.cmake OPTIONAL)
 
 # get version from git
 
@@ -105,29 +107,14 @@ IF(NOT IRSSI_INCLUDE_DIR)
     "usually installed in /usr/include/irssi")
 ENDIF(NOT IRSSI_INCLUDE_DIR)
 
-# Bad hack for irssi private headers
-
-IF (NOT EXISTS "mainwindows.h" AND 
-    NOT EXISTS "${PROJECT_SOURCE_DIR}/mainwindows.h")
-  MESSAGE(STATUS "Need to fetch and patch irssi private headers "
-    "mainwindows.h,statusbar.h,term.h from SVN (see irssi FS#535)")
-  EXECUTE_PROCESS(COMMAND "bash" "-c"
-    "${WGET_EXECUTABLE} '--post-data=revision=4806&root=irssi' \\
-    'http://svn.irssi.org/cgi-bin/viewvc.cgi/irssi/trunk/src/fe-text/mainwindows.h' \\
-    'http://svn.irssi.org/cgi-bin/viewvc.cgi/irssi/trunk/src/fe-text/term.h' \\
-    'http://svn.irssi.org/cgi-bin/viewvc.cgi/irssi/trunk/src/fe-text/statusbar.h' || exit 1
-    patch -p0 mainwindows.h < \"$0/privheaders.patch\" || exit 1" 
-    ${PROJECT_SOURCE_DIR} RESULT_VARIABLE IIPRIV_RET)
-  IF(NOT IIPRIV_RET EQUAL 0)
-    MESSAGE(FATAL_ERROR "Couldn't check out irssi private headers from SVN")
-  ENDIF(NOT IIPRIV_RET EQUAL 0)
-ENDIF (NOT EXISTS "mainwindows.h" AND 
-    NOT EXISTS "${PROJECT_SOURCE_DIR}/mainwindows.h")
-
 # includes
 
 SET(IRSSIOTR_INCLUDE_DIRS
-  ${PROJECT_SOURCE_DIR} ${PROJECT_BINARY_DIR} ${GLIB_INCLUDE_DIRS} 
+  ${PROJECT_SOURCE_DIR} 
+  ${PROJECT_SOURCE_DIR}/irssi-private-headers
+  ${PROJECT_BINARY_DIR} 
+  ${PROJECT_BINARY_DIR}/irssi-private-headers
+  ${GLIB_INCLUDE_DIRS} 
   ${LIBOTR_INCLUDE_DIRS} 
   ${IRSSI_INCLUDE_DIR}/irssi
   ${IRSSI_INCLUDE_DIR}/irssi/src
@@ -135,6 +122,7 @@ SET(IRSSIOTR_INCLUDE_DIRS
 
 include_directories(${IRSSIOTR_INCLUDE_DIRS})
 SET(CMAKE_REQUIRED_INCLUDES ${IRSSIOTR_INCLUDE_DIRS})
+SET(CMAKE_REQUIRED_DEFINITIONS -DHAVE_CONFIG_H)
 
 # gregex.h 
 # available since 2.13 AFAIK
@@ -142,6 +130,29 @@ SET(CMAKE_REQUIRED_INCLUDES ${IRSSIOTR_INCLUDE_DIRS})
 
 CHECK_INCLUDE_FILE(glib/gregex.h HAVE_GREGEX_H)
 
+# irssi private headers
+
+CHECK_INCLUDE_FILES("glib.h;common.h;statusbar.h" HAVE_IRSSIPRIV_H)
+
+# Bad hack
+
+IF (NOT HAVE_IRSSIPRIV_H)
+  MESSAGE(STATUS "Need to fetch and patch irssi private headers "
+    "mainwindows.h,statusbar.h,term.h from SVN (see irssi FS#535)")
+  EXECUTE_PROCESS(COMMAND "mkdir" irssi-private-headers)
+  EXECUTE_PROCESS(COMMAND "bash" "-c"
+    "${WGET_EXECUTABLE} '--post-data=revision=4806&root=irssi' \\
+    'http://svn.irssi.org/cgi-bin/viewvc.cgi/irssi/trunk/src/fe-text/mainwindows.h' \\
+    'http://svn.irssi.org/cgi-bin/viewvc.cgi/irssi/trunk/src/fe-text/term.h' \\
+    'http://svn.irssi.org/cgi-bin/viewvc.cgi/irssi/trunk/src/fe-text/statusbar.h' || exit 1
+    patch -p0 mainwindows.h < \"$0/privheaders.patch\" || exit 1" 
+    ${PROJECT_SOURCE_DIR} WORKING_DIRECTORY irssi-private-headers
+    RESULT_VARIABLE IIPRIV_RET)
+  IF(NOT IIPRIV_RET EQUAL 0)
+    MESSAGE(FATAL_ERROR "Couldn't check out irssi private headers from SVN")
+  ENDIF(NOT IIPRIV_RET EQUAL 0)
+ENDIF (NOT HAVE_IRSSIPRIV_H)
+
 # check for strsignal
 
 CHECK_FUNCTION_EXISTS(strsignal HAVE_STRSIGNAL)
diff --git a/HOWTO_PACKAGE b/HOWTO_PACKAGE
index 6addcdf..90334d5 100644
--- a/HOWTO_PACKAGE
+++ b/HOWTO_PACKAGE
@@ -1,4 +1,5 @@
-Thanks for helping me with packaging.
+You can let cmake generate a package for you. But don't expect it to be in
+full conformance with your distribution.
 
 You'll need cmake >= 2.6. In theory, all you should have to do is:
 
diff --git a/Packaging-DEB.cmake b/Packaging-DEB.cmake
index abc265d..d1e524d 100644
--- a/Packaging-DEB.cmake
+++ b/Packaging-DEB.cmake
@@ -4,4 +4,4 @@ INSTALL(FILES README LICENSE DESTINATION share/doc/${CMAKE_PROJECT_NAME}-${IRSSI
 SET(CPACK_GENERATOR DEB)
 #SET(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
 SET(CPACK_DEBIAN_PACKAGE_SECTION "net")
-SET(CPACK_DEBIAN_PACKAGE_DEPENDS "irssi, libotr (>= 3.1.0)")
+SET(CPACK_DEBIAN_PACKAGE_DEPENDS "irssi, libotr2 (>= 3.1.0)")
diff --git a/mksrcpackage.sh b/mksrcpackage.sh
new file mode 100755
index 0000000..5eb576e
--- /dev/null
+++ b/mksrcpackage.sh
@@ -0,0 +1,14 @@
+#!/bin/bash
+if [ -z "$1" ]; then echo Need src dir; exit 1;fi
+SDIR="$1"
+VER=`(cd "$SDIR" && git tag)|head -n1|sed -e 's/.//'`
+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-private-headers &&\
+	echo "SET(IRSSIOTR_VERSION $VER)" >tarballdefs.cmake) &&\
+tar rhf $PKG "$HDIR" &&\
+rm $HDIR/{irssi-private-headers,tarballdefs.cmake} &&\
+rmdir $HDIR &&\
+gzip $PKG

-- 
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