Creating a Package
If you wish to contribute a package for your distribution that we could include on this website for others to use, you only need to copy, paste and adapt a few lines in the file CMakeLists.txt located in the source directory. This is fairly easy, only the items highlighted in violet in the code below must be adapted.
Building the Sources without Installing
Start by building the sources without installing: proceed as described
previously but replace 'make install' with 'make'.
# cmake -DCMAKE_INSTALL_PREFIX=/usr ..
# make
Adapting CMakeLists.txt
If your distribution uses .deb packages, find the following line in CMakeLists.txt:
# >>> TEMPLATE CODE FOR ADDITIONAL DEBIAN-LIKE DISTRIBUTIONS <<<
If your distribution uses .rpm packages, find the following line instead:
# >>> TEMPLATE CODE FOR ADDITIONAL REDHAT-LIKE DISTRIBUTIONS <<<
The paragraph located just below is the Packaging Code. Duplicate it and uncomment it (remove the '#' signs). For example, here is the Packaging Code for Klusters in Debian-like distributions (for RedHat-like distributions, it is almost identical except the uppercase variable names are different):
elseif(DISTRIBUTION STREQUAL "Ubuntu")
# Set Ubuntu-specific information (see http://www.cmake.org/Wiki/CMake:CPackPackageGenerators)
if(ARCHITECTURE MATCHES ".*x86_64.*")
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "amd64")
else()
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "i386")
endif()
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Your Name")
set(CPACK_DEBIAN_PACKAGE_SECTION "Science")
set(CPACK_DEBIAN_PACKAGE_RECOMMENDS "nphys-data, neuroscope, ndmanager")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libklustersshared, libqt4-network, libqt4-xml, libqtcore4, libqtgui4, libqtwebkit4")
set(CPACK_DEBIAN_PACKAGE_HOMEPAGE "http://klusters.sourceforge.net")
set(CPACK_GENERATOR "DEB")
set(CPACK_DEBIAN_PACKAGE_CONTROL_EXTRA "${CMAKE_CURRENT_SOURCE_DIR}/postinst;${CMAKE_CURRENT_SOURCE_DIR}/postrm;" )
set(CPACK_PACKAGE_FILE_NAME ${CPACK_PACKAGE_NAME}_${CPACK_PACKAGE_VERSION}-${RELEASE}_${CPACK_DEBIAN_PACKAGE_ARCHITECTURE})
The values highlighted in violet are for Ubuntu and must be adapted to your distribution, as described in the following sections.
Distribution Name
To determine the official name of your distribution, type:
Replace 'Ubuntu' with the output of this command in the Packaging Code (two instances).
Computer Architecture
The acronyms 'amd64' and 'i386' indicate whether the package is for a 64 bit or a 32 bit system, respectively. Each distribution uses slightly different acronyms, such as 'x86_64' for 64 bits, or 'i586' or 'i686' for 32 bits. Replace these values with the appropriate ones – this information can easily be found by searching for packages for your distribution on the internet: the acronyms appear as suffixes in the package names.
Your Name
This one should be fairly easy (if you cannot remember, just check your ID or passport).
Package Dependencies
There is a script in the source directory to help you determine the appropriate values. From within the source directory, type:
This will print a long comma-separated list. Find and copy the items related to Qt – those are typically named 'libqt...' or 'qt...' Edit CMakeLists.txt as appropriate, but make sure you
do not remove libklustersshared from the list!
Package Name
The last line in the Packaging Code is used to generate the package file name: it simply appends the package name, the package version and release, and the computer architecture. Different distributions use different separators between these elements, such as '_', '-' and '.' Again, this information can easily be found by searching for packages for your distribution on the internet and examining their file name. For instance, the core Qt libraries are provided in a package named 'libqt4-core_4.8.1-0ubuntu4.4_amd64.deb' in Ubuntu, and 'libqt4-4.8.5-322.1.x86_64.rpm' in openSUSE. These names use different separators:
libqt4-core_4.8.1-0ubuntu4.4_amd64.deb
libqt4-4.8.5-322.1.x86_64.deb
Adapt the last line in the Packaging Code as needed.
Generating the Package
The package can now be generated:
If you create packages for LibKlustersshared, Klusters, Neuroscope and/or NDManager, please contact me at
michael.zugaro at college-de-france.fr so we can upload them to this website.