Mercurial > treepkg
annotate recipes/kde_enterprise_4/kdebase.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 | 8f2be31f0df1 |
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 """Build kdebase debian packages from the kdepim/enterprise4 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 import os |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
11 import time |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
12 import re |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
13 |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
14 import treepkg.util |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
15 import treepkg.packager |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
16 |
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 class SourcePackager(treepkg.packager.SourcePackager): |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
19 |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
20 pkg_basename = "kdebase" |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
21 |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
22 def __init__(self, *args, **kw): |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
23 super(SourcePackager, self).__init__(*args, **kw) |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
24 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
|
25 + "." + str(self.revision)) |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
26 |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
27 def kdebase_version(self, directory): |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
28 """Determine the kdebase version. |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
29 |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
30 The version is taken from the kdebase.lsm file. |
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 return treepkg.util.extract_lsm_version(os.path.join(directory, |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
33 "kdebase.lsm")) |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
34 |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
35 def determine_package_version(self, directory): |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
36 enterprise_version = self.enterprise_version |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
37 return self.track.version_template % locals() |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
38 |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
39 def do_package(self): |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
40 pkgbaseversion, pkgbasedir = self.export_sources() |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
41 |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
42 pkgbasename = self.pkg_basename + "_" + pkgbaseversion |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
43 origtargz = os.path.join(self.work_dir, |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
44 pkgbasename + ".orig.tar.gz") |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
45 self.create_tarball(origtargz, self.work_dir, |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
46 os.path.basename(pkgbasedir)) |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
47 |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
48 changemsg = ("Update to SVN enterprise4 branch rev. %d" |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
49 % (self.revision,)) |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
50 self.copy_debian_directory(pkgbasedir, pkgbaseversion, |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
51 changemsg) |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
52 |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
53 self.create_source_package(pkgbasedir, origtargz) |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
54 self.move_source_package(pkgbasename) |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
55 |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
56 |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
57 class RevisionPackager(treepkg.packager.RevisionPackager): |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
58 |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
59 source_packager_cls = SourcePackager |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
60 |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
61 |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
62 class PackageTrack(treepkg.packager.PackageTrack): |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
63 |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
64 svn_external_subdirs = ["workspace/kwin/clients/ozone/lib", |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
65 "workspace/kwin/clients/oxygen/lib"] |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
66 |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
67 extra_config_desc = ["version_template"] |
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 revision_packager_cls = 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 def __init__(self, *args, **kw): |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
72 self.version_template = kw.pop("version_template") |
e868c6818f8c
Add recipes for KDEPIM enterprise 4 packages
Bernhard Herzog <bh@intevation.de>
parents:
diff
changeset
|
73 super(PackageTrack, self).__init__(*args, **kw) |