comparison recipes/kde_enterprise_3_5/kdepim.py @ 132:d7b3dac63ad0

Reorganize and rename the packager hierarchy. The packagers from enterprise/ are now in recipes/kde_enterprise_3_5/ .
author Bernhard Herzog <bh@intevation.de>
date Fri, 23 May 2008 19:16:08 +0000
parents enterprise/kdepim.py@7f6fb8103db0
children 3f2ec4314855
comparison
equal deleted inserted replaced
131:bea9f1cc0bef 132:d7b3dac63ad0
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 enterprise branch"""
9
10 import os
11 import time
12 import re
13
14 import treepkg.util
15 import treepkg.packager
16
17
18 class SourcePackager(treepkg.packager.SourcePackager):
19
20 pkg_basename = "kdepim"
21
22 def __init__(self, *args, **kw):
23 super(SourcePackager, self).__init__(*args, **kw)
24 self.enterprise_version = (time.strftime("%Y%m%d", time.localtime()) \
25 + "." + str(self.revision))
26
27 def kdepim_version(self, directory):
28 """Determine the kdepim version.
29
30 The version is taken from the kdepim.lsm file.
31 """
32 return treepkg.util.extract_lsm_version(os.path.join(directory,
33 "kdepim.lsm"))
34
35 def determine_package_version(self, directory):
36 enterprise_version = self.enterprise_version
37 kdepimversion = self.kdepim_version(directory)
38 version_template = "%(kdepimversion)s.enterprise.0.%(enterprise_version)s"
39 return version_template % locals()
40
41 def update_version_numbers(self, pkgbasedir):
42 """Overrides the inherited method to update version numbers in the code
43 """
44 versionstring = "(enterprise %s)" % self.enterprise_version
45 for versionfile in ["kmail/kmversion.h", "kontact/src/main.cpp",
46 "korganizer/version.h"]:
47 treepkg.util.replace_in_file(os.path.join(pkgbasedir, versionfile),
48 "\(enterprise ([^)]*)\)",
49 versionstring)
50
51 def do_package(self):
52 pkgbaseversion, pkgbasedir = self.export_sources()
53 self.update_version_numbers(pkgbasedir)
54
55 pkgbasename = "kdepim_" + pkgbaseversion
56 origtargz = os.path.join(self.work_dir,
57 pkgbasename + ".orig.tar.gz")
58 self.create_tarball(origtargz, self.work_dir,
59 os.path.basename(pkgbasedir))
60
61 changemsg = ("Update to SVN enterprise branch rev. %d"
62 % (self.revision,))
63 self.copy_debian_directory(pkgbasedir, pkgbaseversion,
64 changemsg)
65
66 self.create_source_package(pkgbasedir, origtargz)
67 self.move_source_package(pkgbasename)
68
69
70 class RevisionPackager(treepkg.packager.RevisionPackager):
71
72 source_packager_cls = SourcePackager
73
74
75 class PackageTrack(treepkg.packager.PackageTrack):
76
77 revision_packager_cls = RevisionPackager
78
79 svn_external_subdirs = ["admin"]
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)