[SCM] ci-tooling packaging branch, master, updated. 1f214f78718fbdf49112ed73d90b17c6b9b6cb6c
Harald Sitter
apachelogger-guest at moszumanska.debian.org
Mon Oct 5 12:37:41 UTC 2015
Gitweb-URL: http://git.debian.org/?p=pkg-kde/ci-tooling.git;a=commitdiff;h=9b44f1d
The following commit has been merged in the master branch:
commit 9b44f1de1fd01528bd65db10b6b01e9ca81bb1a5
Author: Harald Sitter <sitter at kde.org>
Date: Mon Oct 5 14:36:13 2015 +0200
restore source building code
---
kci/builder.rb | 95 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
1 file changed, 94 insertions(+), 1 deletion(-)
diff --git a/kci/builder.rb b/kci/builder.rb
index 9b4b519..7910d76 100755
--- a/kci/builder.rb
+++ b/kci/builder.rb
@@ -89,7 +89,100 @@ class KCIBuilder
version = CI::BuildVersion.new(changelog)
source_name = changelog.name
- C
+ FileUtils.rm_r('build') if File.exist?('build')
+ FileUtils.mkpath('build/source/')
+
+ # copy upstream sources around
+ if Dir.exist?('source') && !Dir.glob('source/*').empty?
+ abort 'Failed to copy source' unless system('cp -r source/* build/source/')
+ Dir.chdir('build/source') do
+ FileUtils.rm_rf(Dir.glob('**/.bzr'))
+ FileUtils.rm_rf(Dir.glob('**/.git'))
+ FileUtils.rm_rf(Dir.glob('**/.svn'))
+ end
+
+ # create orig tar
+ Dir.chdir('build/') do
+ tar = "#{source_name}_#{version.tar}.orig.tar"
+ abort 'Failed to create a tarball' unless system("tar -cf #{tar} source")
+ abort 'Failed to compress the tarball' unless system("xz -6 #{tar}")
+ end
+
+ # Copy packaging
+ unless system('cp -r packaging/debian build/source/')
+ abort 'Failed to copy packaging'
+ end
+ else
+ # This is a native package as we have no upstream source directory.
+ # TODO: quite possibly this should be porperly validated via source format and
+ # or changelog version format.
+ unless system('cp -r packaging/* build/source/')
+ abort 'Failed to copy packaging'
+ end
+ end
+
+ # Create changelog entry
+ Dir.chdir('build/source/') do
+ env = {
+ 'DEBFULLNAME' => 'Kubuntu CI',
+ 'DEBEMAIL' => 'kubuntu-ci at lists.launchpad.net'
+ }
+ args = []
+ args << '-b'
+ args << '-v' << version.full
+ args << '-D' << project.series
+ args << '"Automatic Kubuntu Build"'
+ abort 'Failed to create changelog entry' unless system(env, 'dch', *args)
+ end
+
+ # Rip out locale install
+ Dir.chdir('build/source/') do
+ Dir.glob('debian/*.install').each do |install_file_path|
+ # Strip localized manpages
+ # e.g. usr /share /man / * /man 7 /kf5options.7
+ man_regex = %r{^.*usr/share/man/(\*|\w+)/man\d/.*$}
+ subbed = File.open(install_file_path).read.gsub(man_regex, '')
+ File.open(install_file_path, 'w') do |f|
+ f << subbed
+ end
+
+ # FIXME: bloody workaround for kconfigwidgets and kdelibs4support containing
+ # legit locale data
+ next if source_name == 'kconfigwidgets' || source_name == 'kdelibs4support'
+ locale_regex = %r{^.*usr/share/locale.*$}
+ subbed = File.open(install_file_path).read.gsub(locale_regex, '')
+ File.open(install_file_path, 'w') do |f|
+ f << subbed
+ end
+ end
+ # If the package is now empty, lintian override the empty warning to avoid
+ # false positives
+ Dir.glob('debian/*.install').each do | install_file_path |
+ next unless File.open(install_file_path, 'r').read.strip.empty?
+ package_name = File.basename(install_file_path, '.install')
+ lintian_overrides_path = install_file_path.gsub('.install',
+ '.lintian-overrides')
+ puts "#{package_name} is now empty, trying to add lintian override"
+ File.open(lintian_overrides_path, 'a') do |file|
+ file.write("#{package_name}: empty-binary-package
")
+ end
+ end
+ # Rip out symbol files unless we are on latest
+ unless project.series == KCI.latest_series
+ symbols = Dir.glob('debian/symbols') +
+ Dir.glob('debian/*.symbols') +
+ Dir.glob('debian/*.symbols.*')
+ symbols.each { |s| FileUtils.rm(s) }
+ end
+ end
+
+ # dpkg-buildpackage
+ Dir.chdir('build/source/') do
+ system('update-maintainer')
+ unless system('dpkg-buildpackage -us -uc -S -d')
+ abort 'Failed to build source package'
+ end
+ end
# Mangle dsc to not do ARM builds unless explicitly enabled.
# With hundreds of distinct sources on CI, building all of them on three
--
ci-tooling packaging
More information about the pkg-kde-commits
mailing list