-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpackaging.html
137 lines (96 loc) · 5.79 KB
/
packaging.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN
"http://www.w3.org/TR/html4/loose.dtd"">
<html>
<head>
<title>Klusters, Neuroscope and NDManager</title>
<link rel="stylesheet" href="style.css">
</head>
<body bgcolor="#F5F5F5" link="#64819E" alink="#64819E" vlink="#64819E">
<!-- ******************************************** Header ******************************************** -->
<div class="box">
<div class="header"> </div>
<!-- ******************************************** Building ******************************************** -->
<h1>Creating a Package</h1>
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.
<h2>Building the Sources without Installing</h2>
Start by building the sources without installing: proceed as described <a href="building.html">previously</a> but replace 'make install' with 'make'.
<div class="code">
<pre>
# cmake -DCMAKE_INSTALL_PREFIX=/usr ..
# make
</pre>
</div>
<h2>Adapting CMakeLists.txt</h2>
If your distribution uses .deb packages, find the following line in CMakeLists.txt:
<div class="code">
<pre>
# >>> TEMPLATE CODE FOR ADDITIONAL DEBIAN-LIKE DISTRIBUTIONS <<<
</pre>
</div>
If your distribution uses .rpm packages, find the following line instead:
<div class="code">
<pre>
# >>> TEMPLATE CODE FOR ADDITIONAL REDHAT-LIKE DISTRIBUTIONS <<<
</pre>
</div>
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):
<div class="code">
<pre>
elseif(DISTRIBUTION STREQUAL "<span class="replace">Ubuntu</span>")
# Set <span class="replace">Ubuntu</span>-specific information (see http://www.cmake.org/Wiki/CMake:CPackPackageGenerators)
if(ARCHITECTURE MATCHES ".*x86_64.*")
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "<span class="replace">amd64</span>")
else()
set(CPACK_DEBIAN_PACKAGE_ARCHITECTURE "<span class="replace">i386</span>")
endif()
set(CPACK_DEBIAN_PACKAGE_MAINTAINER "<span class="replace">Your Name</span>")
set(CPACK_DEBIAN_PACKAGE_SECTION "Science")
set(CPACK_DEBIAN_PACKAGE_RECOMMENDS "nphys-data, neuroscope, ndmanager")
set(CPACK_DEBIAN_PACKAGE_DEPENDS "libklustersshared, <span class="replace">libqt4-network, libqt4-xml, libqtcore4, libqtgui4, libqtwebkit4</span>")
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}<span class="replace_">_</span>${CPACK_PACKAGE_VERSION}<span class="replace_">-</span>${RELEASE}<span class="replace_">_</span>${CPACK_DEBIAN_PACKAGE_ARCHITECTURE})
</pre>
</div>
The values highlighted in violet are for Ubuntu and must be adapted to your distribution, as described in the following sections.
<h3>Distribution Name</h3>
To determine the official name of your distribution, type:
<div class="code">
<pre>
# lsb_release -si
</pre>
</div>
Replace 'Ubuntu' with the output of this command in the Packaging Code (two instances).
<h3>Computer Architecture</h3>
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.
<h3>Your Name</h3>
This one should be fairly easy (if you cannot remember, just check your ID or passport).
<h3>Package Dependencies</h3>
There is a script in the source directory to help you determine the appropriate values. From within the source directory, type:
<div class="code">
<pre>
# ./depends
</pre>
</div>
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 <span class="emph">do not remove libklustersshared</span> from the list!
<h3>Package Name</h3>
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:
<div class="code">
<pre>
libqt4-core<span class="replace_">_</span>4.8.1<span class="replace_">-</span>0ubuntu4.4<span class="replace_">_</span>amd64.deb
libqt4<span class="replace_">-</span>4.8.5<span class="replace_">-</span>322.1<span class="replace_">.</span>x86_64.deb
</pre>
</div>
Adapt the last line in the Packaging Code as needed.
<h2>Generating the Package</h2>
The package can now be generated:
<div class="code">
<pre>
# cpack
</pre>
</div>
If you create packages for LibKlustersshared, Klusters, Neuroscope and/or NDManager, please contact me at <span class="email">michael.zugaro at college-de-france.fr</span> so we can upload them to this website.
</div>
</body>
</html>