comparison recipes/wince/gnupg/base.py @ 549:e38976f77e26

Change the packaging rules to handle git sources
author Andre Heinecke <aheinecke@intevation.de>
date Tue, 08 Mar 2011 11:48:26 +0000
parents c7d22fd36815
children
comparison
equal deleted inserted replaced
548:6b6cd977785c 549:e38976f77e26
43 43
44 raise RuntimeError("Could not determine the version number from %s" 44 raise RuntimeError("Could not determine the version number from %s"
45 % filename) 45 % filename)
46 46
47 def determine_package_version(self, directory): 47 def determine_package_version(self, directory):
48 return "%s-svn%s" % (self.orig_source_version(directory), self.revision) 48 """ Returns a Git package Name """
49 date = run.capture_output(cmdexpand("/bin/sh -c \" git log --date=iso \
50 -n 1 | grep Date \
51 | awk \'{print $$2}\'\""),
52 cwd=directory)
53 time = run.capture_output(cmdexpand("/bin/sh -c \" git log --date=iso \
54 -n 1 | grep Date \
55 | awk \'{print $$3}\'\""),
56 cwd=directory)
57 date = date.replace('-','')
58 time = time.replace(':','')
59 return "%s~%s%s.git%s" % (self.orig_source_version(directory),
60 date[:8], time[:4], self.revision[:7])
61
49 def sign_package(self): 62 def sign_package(self):
50 return None 63 return None
51 64
52 def do_package(self): 65 def do_package(self):
53 pkgbaseversion, pkgbasedir = self.export_sources() 66 pkgbaseversion, pkgbasedir = self.export_sources()
59 # patch the version number in the newly generated configure 72 # patch the version number in the newly generated configure
60 # file. autogen.sh normally determines it from svn, but here it 73 # file. autogen.sh normally determines it from svn, but here it
61 # ran on a copy that did not include the .svn subdirectories and 74 # ran on a copy that did not include the .svn subdirectories and
62 # thus could not find the svn revision. 75 # thus could not find the svn revision.
63 treepkg.util.replace_in_file(os.path.join(pkgbasedir, "configure"), 76 treepkg.util.replace_in_file(os.path.join(pkgbasedir, "configure"),
64 re.escape(orig_version) + "-svn0", 77 re.escape(orig_version) + "-git0",
65 orig_version + "-svn%s" % self.revision) 78 orig_version + "-git%s" % self.revision)
66 79
67 pkgbasename = self.pkg_basename + "_" + pkgbaseversion 80 pkgbasename = self.pkg_basename + "_" + pkgbaseversion
68 origtargz = os.path.join(self.work_dir, 81 origtargz = os.path.join(self.work_dir,
69 pkgbasename + ".orig.tar.gz") 82 pkgbasename + ".orig.tar.gz")
70 self.create_tarball(origtargz, self.work_dir, 83 self.create_tarball(origtargz, self.work_dir,
71 os.path.basename(pkgbasedir)) 84 os.path.basename(pkgbasedir))
72 85
73 changemsg = ("Update to SVN rev. %s" % (self.revision,)) 86 changemsg = ("Update to GIT rev. %s" % (self.revision,))
74 self.copy_debian_directory(pkgbasedir, pkgbaseversion, 87 self.copy_debian_directory(pkgbasedir, pkgbaseversion,
75 changemsg) 88 changemsg)
76 89
77 self.create_source_package(pkgbasedir, origtargz) 90 self.create_source_package(pkgbasedir, origtargz)
78 self.move_source_package(pkgbasename) 91 self.move_source_package(pkgbasename)
111 export LIB=$MINGWPATH/arm-mingw32ce/lib:$MINGWPATH/lib:\ 124 export LIB=$MINGWPATH/arm-mingw32ce/lib:$MINGWPATH/lib:\
112 /home/builder/wce-build/install/lib:$LIB 125 /home/builder/wce-build/install/lib:$LIB
113 export PATH=:$PATH:$MINGWPATH/bin:$MINGWPATH/arm-mingw32ce/bin:\ 126 export PATH=:$PATH:$MINGWPATH/bin:$MINGWPATH/arm-mingw32ce/bin:\
114 $MINGWPATH/libexec/gcc/arm-mingw32ce/4.4.0: 127 $MINGWPATH/libexec/gcc/arm-mingw32ce/4.4.0:
115 export w32ce_root=/opt/mingw32ce 128 export w32ce_root=/opt/mingw32ce
129 export w32root=/opt/mingw32ce
116 130
117 ./autogen.sh --build-w32ce 131 ./autogen.sh --build-w32ce
118 132
119 # revert autoconf changes, so that the original Makefile.am ends up in 133 # revert autoconf changes, so that the original Makefile.am ends up in
120 # the tarball 134 # the tarball
154 run.call(cmdexpand("/bin/sh autogen.sh"), cwd=copied_working_copy, 168 run.call(cmdexpand("/bin/sh autogen.sh"), cwd=copied_working_copy,
155 suppress_output=True) 169 suppress_output=True)
156 orig_version = self.orig_source_version(copied_working_copy) 170 orig_version = self.orig_source_version(copied_working_copy)
157 treepkg.util.replace_in_file(os.path.join(copied_working_copy, 171 treepkg.util.replace_in_file(os.path.join(copied_working_copy,
158 "configure"), 172 "configure"),
159 re.escape(orig_version) + "-svn0", 173 re.escape(orig_version) + "-git0",
160 orig_version + "-svn%s" % self.revision) 174 orig_version + "-git%s" % self.revision)
161 175
162 script = (self.createtarball_script 176 script = (self.createtarball_script
163 % dict(builddeps=" ".join(self.track.dependencies_required() 177 % dict(builddeps=" ".join(self.track.dependencies_required()
164 | self.tarball_dependencies), 178 | self.tarball_dependencies),
165 basedir=copied_working_copy, 179 basedir=copied_working_copy,
194 208
195 def do_package(self): 209 def do_package(self):
196 self.create_original_tarball() 210 self.create_original_tarball()
197 orig_dir = self.create_orig_dir() 211 orig_dir = self.create_orig_dir()
198 212
199 changemsg = ("Update to SVN rev. %s" % (self.revision,)) 213 changemsg = ("Update to GIT rev. %s" % (self.revision,))
200 self.copy_debian_directory(orig_dir, self.pkgbaseversion, changemsg) 214 self.copy_debian_directory(orig_dir, self.pkgbaseversion, changemsg)
201 215
202 self.create_source_package(orig_dir, self.origtargz) 216 self.create_source_package(orig_dir, self.origtargz)
203 self.move_source_package(self.pkgbasename) 217 self.move_source_package(self.pkgbasename)
204 218
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)