Ubuntu packaging magic, forgotten header files, an icon.

develop
Petr Mrázek 2011-03-19 23:26:32 +01:00
parent 2bc7aacb79
commit 1481b07b6b
7 changed files with 145 additions and 2 deletions

@ -17,8 +17,23 @@ endif()
set(CPACK_PACKAGE_VERSION_MAJOR "0") set(CPACK_PACKAGE_VERSION_MAJOR "0")
set(CPACK_PACKAGE_VERSION_MINOR "5") set(CPACK_PACKAGE_VERSION_MINOR "5")
set(CPACK_PACKAGE_VERSION_PATCH "8") 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(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_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 ## setting the build type
IF(NOT DEFINED CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL "") IF(NOT DEFINED CMAKE_BUILD_TYPE OR CMAKE_BUILD_TYPE STREQUAL "")
@ -35,8 +50,14 @@ IF(WIN32)
ELSE() ELSE()
set (DFHACK_INST_DEFAULT "linux") set (DFHACK_INST_DEFAULT "linux")
ENDIF() 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( DFHACK_INSTALL ${DFHACK_INST_DEFAULT} CACHE STRING
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.") "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") IF(${DFHACK_INSTALL} STREQUAL "portable")
# the dfhack libraries will be installed here: # the dfhack libraries will be installed here:
@ -82,6 +103,31 @@ IF(${DFHACK_INSTALL} STREQUAL "linux")
SET(DFHACK_DOXYGEN_DESTINATION share/dfhack/doc/doxygen) SET(DFHACK_DOXYGEN_DESTINATION share/dfhack/doc/doxygen)
ENDIF() 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 ## 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_LIBRARY "Build the library. Needed for all the tools." ON)
OPTION(BUILD_DFHACK_C_BINDINGS "Build the C portion of the library." ON) OPTION(BUILD_DFHACK_C_BINDINGS "Build the C portion of the library." ON)
@ -153,4 +199,43 @@ IF(${DFHACK_INSTALL} STREQUAL "portable")
ENDIF() ENDIF()
set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${DFHACK_VERSION}-${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}") set(CPACK_PACKAGE_FILE_NAME "${CPACK_PACKAGE_NAME}-${DFHACK_VERSION}-${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}")
INCLUDE(CPack) 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() ENDIF()

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB

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

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

@ -0,0 +1,3 @@
#!/bin/sh
sysctl -w kernel.randomize_va_space=0
sysctl -w kernel.yama.ptrace_scope=0

@ -0,0 +1,2 @@
#!/bin/sh
# do nothing. blah.

@ -0,0 +1,3 @@
#!/bin/sh
mkdir -p /usr/share/dfhack/doc
mkdir -p /usr/share/dfhack