Mercurial > treepkg
comparison recipes/kde_enterprise_4/kdepim.py @ 221:024b309c0520
Use the recipes.kde_enterprise_4.base module to define the kdepim packager
author | Bernhard Herzog <bh@intevation.de> |
---|---|
date | Tue, 06 Jan 2009 16:45:38 +0000 |
parents | 4307e25d2afe |
children |
comparison
equal
deleted
inserted
replaced
220:5cb7bb947522 | 221:024b309c0520 |
---|---|
1 # Copyright (C) 2007, 2008 by Intevation GmbH | 1 # Copyright (C) 2007, 2008, 2009 by Intevation GmbH |
2 # Authors: | 2 # Authors: |
3 # Bernhard Herzog <bh@intevation.de> | 3 # Bernhard Herzog <bh@intevation.de> |
4 # | 4 # |
5 # This program is free software under the GPL (>=v2) | 5 # This program is free software under the GPL (>=v2) |
6 # Read the file COPYING coming with the software for details. | 6 # Read the file COPYING coming with the software for details. |
7 | 7 |
8 """Packager that builds KDE-PIM debian packages from the enterprise35 branch. | 8 """Build kdepim debian packages from the kdepim/enterprise4 branch. |
9 """ | 9 """ |
10 | 10 |
11 import os | 11 import os |
12 import time | |
13 import re | |
14 | 12 |
15 import treepkg.util | 13 import treepkg.util |
16 import treepkg.packager | |
17 | 14 |
15 import base | |
18 | 16 |
19 class SourcePackager(treepkg.packager.SourcePackager): | 17 class SourcePackager(base.BaseSourcePackager): |
20 | 18 |
21 pkg_basename = "kdepim" | 19 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 | 20 |
32 def update_version_numbers(self, pkgbasedir): | 21 def update_version_numbers(self, pkgbasedir): |
33 """Overrides the inherited method to update version numbers in the code | 22 """Overrides the inherited method to update version numbers in the code |
34 """ | 23 """ |
35 versionstring = "(enterprise4 %s)" % self.enterprise_version | 24 versionstring = "(enterprise4 %s)" % self.enterprise_version |
45 failed.append(versionfile) | 34 failed.append(versionfile) |
46 if failed: | 35 if failed: |
47 raise RuntimeError("kdepim: failed to update version numbers in %s" | 36 raise RuntimeError("kdepim: failed to update version numbers in %s" |
48 % (", ".join(failed),)) | 37 % (", ".join(failed),)) |
49 | 38 |
50 def do_package(self): | |
51 pkgbaseversion, pkgbasedir = self.export_sources() | |
52 self.update_version_numbers(pkgbasedir) | |
53 | 39 |
54 pkgbasename = "kdepim_" + pkgbaseversion | 40 base.define_kdepim_packager() |
55 origtargz = os.path.join(self.work_dir, | |
56 pkgbasename + ".orig.tar.gz") | |
57 self.create_tarball(origtargz, self.work_dir, | |
58 os.path.basename(pkgbasedir)) | |
59 | |
60 changemsg = ("Update to SVN enterprise35 branch rev. %d" | |
61 % (self.revision,)) | |
62 self.copy_debian_directory(pkgbasedir, pkgbaseversion, | |
63 changemsg) | |
64 | |
65 self.create_source_package(pkgbasedir, origtargz) | |
66 self.move_source_package(pkgbasename) | |
67 | |
68 | |
69 class RevisionPackager(treepkg.packager.RevisionPackager): | |
70 | |
71 source_packager_cls = SourcePackager | |
72 | |
73 | |
74 class PackageTrack(treepkg.packager.PackageTrack): | |
75 | |
76 extra_config_desc = ["version_template"] | |
77 | |
78 revision_packager_cls = RevisionPackager | |
79 | |
80 def __init__(self, *args, **kw): | |
81 self.version_template = kw.pop("version_template") | |
82 super(PackageTrack, self).__init__(*args, **kw) |