summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Mrázek2011-03-19 23:26:32 +0100
committerPetr Mrázek2011-03-19 23:26:32 +0100
commit1481b07b6bd23bf336d7cba8dfc6e95f73ed32b4 (patch)
tree0dcd3afbd795002f2fa691a81bf0471e870333f2
parent2bc7aacb7946722bcfdfc76ccae333546ba1f5dc (diff)
downloaddfhack-1481b07b6bd23bf336d7cba8dfc6e95f73ed32b4.tar.gz
dfhack-1481b07b6bd23bf336d7cba8dfc6e95f73ed32b4.tar.bz2
dfhack-1481b07b6bd23bf336d7cba8dfc6e95f73ed32b4.tar.xz
Ubuntu packaging magic, forgotten header files, an icon.
-rw-r--r--CMakeLists.txt89
-rw-r--r--dfhack-icon.pngbin0 -> 2467 bytes
-rw-r--r--library/private/ModuleFactory.h44
-rw-r--r--package/ubuntu-10.10/99-dfhack.conf6
-rwxr-xr-xpackage/ubuntu-10.10/postinst3
-rwxr-xr-xpackage/ubuntu-10.10/postrm2
-rwxr-xr-xpackage/ubuntu-10.10/preinst3
7 files changed, 145 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 293dde42..9c3b2d5d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -17,8 +17,23 @@ endif()
set(CPACK_PACKAGE_VERSION_MAJOR "0")
set(CPACK_PACKAGE_VERSION_MINOR "5")
set(CPACK_PACKAGE_VERSION_PATCH "8")
+set(DFHACK_REVISION "1")
+
set(DFHACK_VERSION "${CPACK_PACKAGE_VERSION_MAJOR}.${CPACK_PACKAGE_VERSION_MINOR}.${CPACK_PACKAGE_VERSION_PATCH}")
+set(CPACK_PACKAGE_VERSION ${DFHACK_VERSION})
+
set(CPACK_PACKAGE_NAME "dfhack")
+SET(CPACK_PACKAGE_VENDOR "dethware.org")
+SET(CPACK_PACKAGE_CONTACT "peterix@dethware.org")
+SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "Memory hacks for Dwarf Fortress")
+SET(CPACK_PACKAGE_DESCRIPTION
+"DFHack is a Dwarf Fortress memory access library and a set of basic
+tools using this library. The library is a work in progress, so things
+might change as more tools are written for it.
+.
+It is an attempt to unite the various ways tools access DF memory and
+allow for easier development of new tools.")
+
## setting the build type
IF(NOT DEFINED CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL "")
@@ -35,8 +50,14 @@ IF(WIN32)
ELSE()
set (DFHACK_INST_DEFAULT "linux")
ENDIF()
-SET( DFHACK_INSTALL ${DFHACK_INST_DEFAULT} CACHE STRING "Choose the install type: 'portable' for a portable zip or tar.gz package (windows default), 'linux' for packaging and system installs on linux (linux default).")
-SET( MEMXML_DATA_PATH . CACHE PATH "Path to a valid Memory.xml file. This is baked into the library, so when you package DFHack for linux, set it to the right path.")
+SET( DFHACK_INSTALL ${DFHACK_INST_DEFAULT} CACHE STRING
+"Choose the install type:
+'portable' for a portable zip or tar.gz package (windows default)
+'linux' for generic packaging and system installs on linux (linux default)
+'ubuntu-10.10' for ubuntu maverick package.")
+SET( MEMXML_DATA_PATH . CACHE PATH
+"Path to a valid Memory.xml file.
+This is baked into the library, so when you package DFHack for linux, set it to the right path.")
IF(${DFHACK_INSTALL} STREQUAL "portable")
# the dfhack libraries will be installed here:
@@ -82,6 +103,31 @@ IF(${DFHACK_INSTALL} STREQUAL "linux")
SET(DFHACK_DOXYGEN_DESTINATION share/dfhack/doc/doxygen)
ENDIF()
+IF(${DFHACK_INSTALL} STREQUAL "ubuntu-10.10")
+ if(WIN32)
+ MESSAGE(FATAL_ERROR "WTF are you doing?")
+ endif()
+ # set RPATH to always point at the dfhack lib using relative path.
+ SET(CMAKE_INSTALL_RPATH "$ORIGIN/../lib/")
+ # the dfhack libraries will be installed here:
+ SET(DFHACK_LIBRARY_DESTINATION usr/lib)
+ # the dfhack tools will be installed here:
+ SET(DFHACK_BINARY_DESTINATION usr/bin)
+ # Memory.xml goes here:
+ SET(DFHACK_DATA_DESTINATION usr/share/dfhack)
+ # Includes go here:
+ SET(DFHACK_INCLUDES_DESTINATION usr/include)
+ # documentation goes here:
+ SET(DFHACK_USERDOC_DESTINATION usr/share/dfhack/doc)
+ SET(DFHACK_DEVDOC_DESTINATION usr/share/dfhack/doc)
+ SET(DFHACK_DOXYGEN_DESTINATION usr/share/dfhack/doc/doxygen)
+ INSTALL(FILES
+ "${CMAKE_CURRENT_SOURCE_DIR}/package/ubuntu-10.10/99-dfhack.conf"
+ DESTINATION etc/sysctl.d)
+ENDIF()
+
+
+
## some options for the user/developer to play with
OPTION(BUILD_DFHACK_LIBRARY "Build the library. Needed for all the tools." ON)
OPTION(BUILD_DFHACK_C_BINDINGS "Build the C portion of the library." ON)
@@ -153,4 +199,43 @@ IF(${DFHACK_INSTALL} STREQUAL "portable")
ENDIF()
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${DFHACK_VERSION}-${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}")
INCLUDE(CPack)
+ENDIF()
+
+#-------------------------------------------------------------------------------
+# Figure out debian architecture
+#-------------------------------------------------------------------------------
+
+FUNCTION(GET_DEBIAN_ARCHITECTURE arch)
+ SET(dpkgarch)
+
+ FIND_PROGRAM(DPKG_CMD dpkg)
+ IF(NOT DPKG_CMD)
+ MESSAGE(STATUS "Can not find dpkg in your path, default to i386.")
+ SET(${arch} i386 PARENT_SCOPE)
+ ENDIF()
+ EXECUTE_PROCESS(COMMAND "${DPKG_CMD}" --print-architecture
+ OUTPUT_VARIABLE dpkgarch
+ OUTPUT_STRIP_TRAILING_WHITESPACE )
+ SET(${arch} ${dpkgarch} PARENT_SCOPE)
+ENDFUNCTION()
+
+IF(${DFHACK_INSTALL} STREQUAL "ubuntu-10.10")
+ SET(CPACK_GENERATOR "DEB")
+
+ #wtf, wtf, wtf. force them to be empty
+ set(CMAKE_INSTALL_PREFIX "" FORCE)
+ set(CPACK_INSTALL_PREFIX "")
+ SET(CPACK_PACKAGING_INSTALL_PREFIX "")
+ set(CPACK_SET_DESTDIR true)
+
+ SET(CPACK_DEBIAN_PACKAGE_SECTION "Games") # yep. magma.
+ SET(CPACK_DEBIAN_PACKAGE_PRIORITY "optional") # very.
+ SET(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) # find deps automatically! hopefully... maybe...
+ SET(INSTSCRIPT "${CMAKE_CURRENT_SOURCE_DIR}/package/ubuntu-10.10")
+ SET(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${INSTSCRIPT}/postinst;${INSTSCRIPT}/preinst;${INSTSCRIPT}/postrm")
+
+ GET_DEBIAN_ARCHITECTURE(PKG_ARCHITECTURE)
+
+ set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}_${DFHACK_VERSION}-${DFHACK_REVISION}_${PKG_ARCHITECTURE}")
+ INCLUDE(CPack)
ENDIF() \ No newline at end of file
diff --git a/dfhack-icon.png b/dfhack-icon.png
new file mode 100644
index 00000000..9f0de50b
--- /dev/null
+++ b/dfhack-icon.png
Binary files differ
diff --git a/library/private/ModuleFactory.h b/library/private/ModuleFactory.h
new file mode 100644
index 00000000..be6be379
--- /dev/null
+++ b/library/private/ModuleFactory.h
@@ -0,0 +1,44 @@
+/*
+ w ww.so*urceforge.net/projects/dfhack
+ Copyright (c) 2009 Petr Mrázek (peterix), Kenneth Ferland (Impaler[WrG]), dorf
+
+ This software is provided 'as-is', without any express or implied
+ warranty. In no event will the authors be held liable for any
+ damages arising from the use of this software.
+
+ Permission is granted to anyone to use this software for any
+ purpose, including commercial applications, and to alter it and
+ redistribute it freely, subject to the following restrictions:
+
+ 1. The origin of this software must not be misrepresented; you must
+ not claim that you wrote the original software. If you use this
+ software in a product, an acknowledgment in the product documentation
+ would be appreciated but is not required.
+
+ 2. Altered source versions must be plainly marked as such, and
+ must not be misrepresented as being the original software.
+
+ 3. This notice may not be removed or altered from any source
+ distribution.
+ */
+
+#ifndef MODULE_FACTORY_H_INCLUDED
+#define MODULE_FACTORY_H_INCLUDED
+
+namespace DFHack
+{
+ class Module;
+ class DFContextShared;
+ Module* createCreatures(DFContextShared * d);
+ Module* createGui(DFContextShared * d);
+ Module* createWindowIO(DFContextShared * d);
+ Module* createWorld(DFContextShared * d);
+ Module* createMaterials(DFContextShared * d);
+ Module* createItems(DFContextShared * d);
+ Module* createTranslation(DFContextShared * d);
+ Module* createVegetation(DFContextShared * d);
+ Module* createBuildings(DFContextShared * d);
+ Module* createConstructions(DFContextShared * d);
+ Module* createMaps(DFContextShared * d);
+}
+#endif \ No newline at end of file
diff --git a/package/ubuntu-10.10/99-dfhack.conf b/package/ubuntu-10.10/99-dfhack.conf
new file mode 100644
index 00000000..bc7cd2bc
--- /dev/null
+++ b/package/ubuntu-10.10/99-dfhack.conf
@@ -0,0 +1,6 @@
+# some settings required for dfhack. fucks up local security...
+# shame on kernel devs and ubuntu people for not providing
+# an /official/ way to manipulate things and just putting up roadblocks
+# instead of proper design
+kernel.randomize_va_space = 0
+kernel.yama.ptrace_scope = 0 \ No newline at end of file
diff --git a/package/ubuntu-10.10/postinst b/package/ubuntu-10.10/postinst
new file mode 100755
index 00000000..040e2b03
--- /dev/null
+++ b/package/ubuntu-10.10/postinst
@@ -0,0 +1,3 @@
+#!/bin/sh
+sysctl -w kernel.randomize_va_space=0
+sysctl -w kernel.yama.ptrace_scope=0 \ No newline at end of file
diff --git a/package/ubuntu-10.10/postrm b/package/ubuntu-10.10/postrm
new file mode 100755
index 00000000..3b8cdfc6
--- /dev/null
+++ b/package/ubuntu-10.10/postrm
@@ -0,0 +1,2 @@
+#!/bin/sh
+# do nothing. blah. \ No newline at end of file
diff --git a/package/ubuntu-10.10/preinst b/package/ubuntu-10.10/preinst
new file mode 100755
index 00000000..b194ee6c
--- /dev/null
+++ b/package/ubuntu-10.10/preinst
@@ -0,0 +1,3 @@
+#!/bin/sh
+mkdir -p /usr/share/dfhack/doc
+mkdir -p /usr/share/dfhack \ No newline at end of file