annotate recipes/kde_enterprise_4/kdepim.py @ 218:4f3bb25c80ec

Use the recipes.kde_enterprise_4.base module to define the kdepimlibs packager
author Bernhard Herzog <bh@intevation.de>
date Tue, 06 Jan 2009 16:25:52 +0000
parents 4307e25d2afe
children 024b309c0520
rev   line source
204
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
1 # Copyright (C) 2007, 2008 by Intevation GmbH
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
2 # Authors:
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
3 # Bernhard Herzog <bh@intevation.de>
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
4 #
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
5 # This program is free software under the GPL (>=v2)
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
6 # Read the file COPYING coming with the software for details.
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
7
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
8 """Packager that builds KDE-PIM debian packages from the enterprise35 branch.
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
9 """
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
10
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
11 import os
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
12 import time
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
13 import re
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
14
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
15 import treepkg.util
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
16 import treepkg.packager
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
17
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
18
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
19 class SourcePackager(treepkg.packager.SourcePackager):
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
20
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
21 pkg_basename = "kdepim"
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
22
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
23 def __init__(self, *args, **kw):
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
24 super(SourcePackager, self).__init__(*args, **kw)
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
25 self.enterprise_version = (time.strftime("%Y%m%d", time.localtime()) \
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
26 + "." + str(self.revision))
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
27
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
28 def determine_package_version(self, directory):
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
29 enterprise_version = self.enterprise_version
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
30 return self.track.version_template % locals()
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
31
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
32 def update_version_numbers(self, pkgbasedir):
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
33 """Overrides the inherited method to update version numbers in the code
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
34 """
214
4307e25d2afe Activate version number patching for KDEPIM enterprise4 packages.
Bernhard Herzog <bh@intevation.de>
parents: 204
diff changeset
35 versionstring = "(enterprise4 %s)" % self.enterprise_version
204
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
36 failed = []
214
4307e25d2afe Activate version number patching for KDEPIM enterprise4 packages.
Bernhard Herzog <bh@intevation.de>
parents: 204
diff changeset
37 for versionfile in ["kaddressbook/kabcore.cpp",
4307e25d2afe Activate version number patching for KDEPIM enterprise4 packages.
Bernhard Herzog <bh@intevation.de>
parents: 204
diff changeset
38 "kmail/kmversion.h",
4307e25d2afe Activate version number patching for KDEPIM enterprise4 packages.
Bernhard Herzog <bh@intevation.de>
parents: 204
diff changeset
39 "kontact/src/main.cpp",
204
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
40 "korganizer/version.h"]:
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
41 if not treepkg.util.replace_in_file(os.path.join(pkgbasedir,
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
42 versionfile),
214
4307e25d2afe Activate version number patching for KDEPIM enterprise4 packages.
Bernhard Herzog <bh@intevation.de>
parents: 204
diff changeset
43 "\(enterprise4 ([^)]*)\)",
204
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
44 versionstring):
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
45 failed.append(versionfile)
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
46 if failed:
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
47 raise RuntimeError("kdepim: failed to update version numbers in %s"
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
48 % (", ".join(failed),))
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
49
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
50 def do_package(self):
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
51 pkgbaseversion, pkgbasedir = self.export_sources()
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
52 self.update_version_numbers(pkgbasedir)
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
53
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
54 pkgbasename = "kdepim_" + pkgbaseversion
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
55 origtargz = os.path.join(self.work_dir,
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
56 pkgbasename + ".orig.tar.gz")
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
57 self.create_tarball(origtargz, self.work_dir,
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
58 os.path.basename(pkgbasedir))
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
59
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
60 changemsg = ("Update to SVN enterprise35 branch rev. %d"
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
61 % (self.revision,))
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
62 self.copy_debian_directory(pkgbasedir, pkgbaseversion,
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
63 changemsg)
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
64
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
65 self.create_source_package(pkgbasedir, origtargz)
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
66 self.move_source_package(pkgbasename)
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
67
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
68
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
69 class RevisionPackager(treepkg.packager.RevisionPackager):
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
70
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
71 source_packager_cls = SourcePackager
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
72
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
73
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
74 class PackageTrack(treepkg.packager.PackageTrack):
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
75
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
76 extra_config_desc = ["version_template"]
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
77
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
78 revision_packager_cls = RevisionPackager
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
79
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
80 def __init__(self, *args, **kw):
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
81 self.version_template = kw.pop("version_template")
e868c6818f8c Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff changeset
82 super(PackageTrack, self).__init__(*args, **kw)
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)