comparison recipes/kde_enterprise_4/kdepim.py @ 204:e868c6818f8c

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