Project

General

Profile

Wiki » History » Version 4

Felix Tiede, 01/17/2013 09:57 PM
New script for packaging versions 0.1.6 and younger.

1 1 Felix Tiede
h1. KDE Certification Authority
2
3
{{>toc}}
4
5
The KDE Certification Authority is an application using the KDE framework to manage X.509 Certification Authorities and signed certificates.
6
7
It is currently still in a very basic state, though it made some steps forward in the past few weeks. It still doesn't serve its main purpose as it is yet not possible to sign requests and other functions do not work from GUI. But some of the most of the background parts are already complete and working so there's just the GUI missing.
8
9
h2. Download
10
11
kCA is available via "git":http://git-scm.com at http://git.pc-tiede.de/kca.git. Use
12
<pre>
13
git clone http://git.pc-tiede.de/kca.git/ /path/to/cloned/kca
14
</pre>
15
to clone latest changes into a local directory.
16
17 2 Felix Tiede
To stay up-to-date just change into `/path/to/cloned/kca` and type
18 1 Felix Tiede
<pre>
19
git pull
20
</pre>
21 3 Felix Tiede
nwhich will download all changes.
22 1 Felix Tiede
23
h2. Compiling
24
25
kCA needs following prerequisites to be compiled cleanly:
26
 * KDE 4.x and its prerequisites, including Qt and their respective development headers
27
 * SQLite 3 or later and its development headers
28
 * cmake
29
30
To compile kCA change into its directory and configure by using cmake:
31
<pre>
32
cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release -DWITH_QtNetwork=ON -DWITH_SQLite3=ON
33
</pre>
34
If you want to use a detached build directory, create that directory, change into it and use the following cmake command:
35
<pre>
36
cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=Release -DWITH_QtNetwork=ON -DWITH_SQLite3=ON /path/to/cloned/kca
37
</pre>
38 2 Felix Tiede
Change install prefix as needed, if you want to install kca somewhere different from '@/usr/local@'. There's also '@Debug@' available as build type.
39 1 Felix Tiede
40
After running cmake just call '@make@' to compile kca.
41
42 3 Felix Tiede
Since this software is way from being 
43
usable, it should not be installed.
44 1 Felix Tiede
45
h2. Packaging
46
47 4 Felix Tiede
bq. *As of release 0.1.6 git-archive sets version information in packages.*
48
49
From version 0.1.6 onward a new, less complicated script can be used to package a tagged version of kca:
50
<pre><code>#!sh
51
# VERSION must be provided as a full tagname
52
VERSION="$1"
53
WORKDIR="`mktemp -dt kca_packaging.XXXXXX`"
54
CURRENT="`pwd`"
55
56
git clone http://git.pc-tiede.de/kca.git "${WORKDIR}/kca"
57
58
cd "${WORKDIR}/kca"
59
git archive --format=tar --prefix="kca-${VERSION#v}/" "${VERSION}" | \
60
    bzip2 > "${CURRENT}/kca-${VERSION#v}"
61
62
cd "${CURRENT}"
63
rm -rf "${WORKDIR}"
64
</code></pre>
65
66
For reference, the old information for versions prior to 0.1.6 is {{collapse(still provided.)
67 2 Felix Tiede
kCA build system uses @git describe@ to set the application version information which is not available after using @git archive@. Because of this the build system is able to read the version from a file which must be created during packaging process. To make things worse, @git describe@ does not work correctly if the checked out version mismatches the version of packaging.
68 1 Felix Tiede
69
To help with packaging the following sh-script can be used.
70
<pre><code>#!sh
71
#!/bin/sh
72
# VERSION must be provided without the v of the tagname
73
VERSION="$1"
74
WORKDIR="`mktemp -dt kca_packaging.XXXXXX`"
75
CURRENT="`pwd`"
76
77
git clone http://git.pc-tiede.de/kca.git "${WORKDIR}/kca"
78
79
cd "${WORKDIR}/kca"
80
git archive --format=tar --prefix="kca-${VERSION}/" "v${VERSION}" | (cd "${WORKDIR}" && tar xf -)
81
echo "v${VERSION}" > "${WORKDIR}/kca-${VERSION}/VERSION"
82
cd "${WORKDIR}"
83 2 Felix Tiede
84 3 Felix Tiede
tar cfj "${CURRENT}/kca-${VERSION}.tar.bz2" "kca-${VERSION}/"
85 1 Felix Tiede
cd "${PWD}"
86
rm -rf "${WORKDIR}"
87
</code></pre>
88 4 Felix Tiede
}}