Removes comments and refs

This commit is contained in:
torsten committed 2026-07-18 13:06:31 +02:00
1 parent d6584b3519
commit 6bb80ee9c8
12 files changed
+215 -215

No files matched your search

+2 -2
View File
@@ -12,8 +12,8 @@ Prefix: /shd/CTC/WS
%if 0%{?suse_version} < 1120 %if 0%{?suse_version} < 1120
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
%endif %endif
Vendor: Rheinmetall Defence Electronis GmbH Vendor: LifeMaps GmbH
URL: http://www.rheinmetall-defence.com URL: http://www.life-maps.com
Packager: ctc Packager: ctc
AutoReqProv: no AutoReqProv: no
+2 -2
View File
@@ -12,8 +12,8 @@ Prefix: /shd/CTC/WH
%if 0%{?suse_version} < 1120 %if 0%{?suse_version} < 1120
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
%endif %endif
Vendor: Rheinmetall Defence Electronis GmbH Vendor: LifeMaps GmbH
URL: http://www.rheinmetall-defence.com URL: http://www.life-maps.com
Packager: ctc Packager: ctc
AutoReqProv: no AutoReqProv: no
+7 -7
View File
@@ -1,11 +1,11 @@
#!/usr/bin/python #!/usr/bin/python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
#
# $Id: helpers.py 1370 2022-07-05 11:08:18Z wille_m $
# $HeadURL: svn://192.168.133.21/admin/rpmbuild/helpers.py $
# $Author: wille_m $
# Created by Christian Ehrlicher, SLSE, 20013-02-19
#
import getpass import getpass
import os import os
@@ -15,7 +15,7 @@ import stat
import subprocess import subprocess
import sys import sys
# helper functions
def verbose(): def verbose():
verb = os.getenv( "EMERGE_VERBOSE" ) verb = os.getenv( "EMERGE_VERBOSE" )
if ( not verb == None and verb.isdigit() and int(verb) > 0 ): if ( not verb == None and verb.isdigit() and int(verb) > 0 ):
+18 -18
View File
@@ -11,7 +11,7 @@ import time
import ConfigParser import ConfigParser
import fnmatch import fnmatch
# helper functions
loc = os.path.dirname( sys.argv[0] ) loc = os.path.dirname( sys.argv[0] )
loc = os.path.abspath( loc ) loc = os.path.abspath( loc )
exec(compile(open('helpers.py').read(), 'helpers.py', 'exec')) exec(compile(open('helpers.py').read(), 'helpers.py', 'exec'))
@@ -85,17 +85,17 @@ class build(object):
die( 'Unable to find a valid spec file in %s' % specdir ) die( 'Unable to find a valid spec file in %s' % specdir )
def copy_spec( self, dest_dir, spec_fullpath ): def copy_spec( self, dest_dir, spec_fullpath ):
# copy spec to build
f = open( spec_fullpath, 'r' ) f = open( spec_fullpath, 'r' )
content = f.read() content = f.read()
f.close() f.close()
# Jenkins Build Tag (wird von Jenkins gesetzt wenn darüber gebaut wird)
jenkins_build_tag = os.getenv( "BUILD_TAG" ) jenkins_build_tag = os.getenv( "BUILD_TAG" )
if jenkins_build_tag == None or len(jenkins_build_tag) == 0: if jenkins_build_tag == None or len(jenkins_build_tag) == 0:
jenkins_build_tag = 'Not build with jenkins job' jenkins_build_tag = 'Not build with jenkins job'
# Versionsinformationen übergeben
cmake_flags = "" cmake_flags = ""
cmake_flags += '-D%s_VERSION_MAJOR:STRING="%s" ' % (self.cmake_version_prefix, self.version_maj) cmake_flags += '-D%s_VERSION_MAJOR:STRING="%s" ' % (self.cmake_version_prefix, self.version_maj)
cmake_flags += '-D%s_VERSION_MINOR:STRING="%s" ' % (self.cmake_version_prefix, self.version_min) cmake_flags += '-D%s_VERSION_MINOR:STRING="%s" ' % (self.cmake_version_prefix, self.version_min)
@@ -112,7 +112,7 @@ class build(object):
if self.cmake_build_flags: if self.cmake_build_flags:
cmake_flags += ' %s ' % self.cmake_build_flags cmake_flags += ' %s ' % self.cmake_build_flags
# und den Buildtype
cmake_flags += '-DCMAKE_BUILD_TYPE="%s" ' % self.buildtype cmake_flags += '-DCMAKE_BUILD_TYPE="%s" ' % self.buildtype
filename = 'project.%s.cfg' % self.project_name filename = 'project.%s.cfg' % self.project_name
@@ -164,8 +164,8 @@ class build(object):
info( "Packing pack %s" % ( os.path.split( src_dir )[1]) ) info( "Packing pack %s" % ( os.path.split( src_dir )[1]) )
info( "--------------------------------" ) info( "--------------------------------" )
removeDirectory( xzfilename ) # falls es ein directory ist removeDirectory( xzfilename )
if os.path.exists( xzfilename ): # falls es eine datei ist if os.path.exists( xzfilename ):
os.remove( xzfilename ) os.remove( xzfilename )
if not os.path.exists( dest_dir ): if not os.path.exists( dest_dir ):
os.makedirs( dest_dir ) os.makedirs( dest_dir )
@@ -174,16 +174,16 @@ class build(object):
cmd = "tar cJf %s %s" % ( xzfilename, os.path.split( src_dir )[1] ) cmd = "tar cJf %s %s" % ( xzfilename, os.path.split( src_dir )[1] )
system( cmd, sys.stdout ) and die( "while packing. cmd: %s" % command ) system( cmd, sys.stdout ) and die( "while packing. cmd: %s" % command )
# svn export ${svn} ${base}
# fixup_rde_header ${base} "c"
# fixup_rde_header ${base} "h"
# fixup_rde_header ${base} "cpp"
# fixup_rde_header ${base} "hpp"
# fixup_rde_header ${base} "txt"
# fixup_rde_header ${base} "py"
# cp ${base}/specs/ctc.spec /usr/src/packages/SPECS/
def usage(): def usage():
@@ -226,14 +226,14 @@ def main():
except: except:
die( "Invalid version format (maj.min): %s" % a ) die( "Invalid version format (maj.min): %s" % a )
# b.check_rpm("ctc_EXTFW_%s" % os_str)
b.version_date = os.getenv( "VERSION_DATE" ) b.version_date = os.getenv( "VERSION_DATE" )
b.init() b.init()
b.printOptions() b.printOptions()
rpmbase_dir = '/shd/CTC/TOOLS/rpmbuild' rpmbase_dir = '/shd/CTC/TOOLS/rpmbuild'
# project_base_dir = '/builds/projects-domain-live/tds'
project_base_dir = os.getenv( "PROJECT_BASE_DIR" ) project_base_dir = os.getenv( "PROJECT_BASE_DIR" )
specdir = os.path.join( rpmbase_dir, "SPECS" ) specdir = os.path.join( rpmbase_dir, "SPECS" )
if not os.path.exists(specdir): if not os.path.exists(specdir):
@@ -247,7 +247,7 @@ def main():
b.pack_sources( project_base_dir, os.path.join( rpmbase_dir, "SOURCES" ) ) b.pack_sources( project_base_dir, os.path.join( rpmbase_dir, "SOURCES" ) )
exec_rpmbuild( specdir, specname ) exec_rpmbuild( specdir, specname )
# move rpms to FOO-1.2-345
dstdir = os.path.join( b.output_dir, "%s-%s-%s" % ( b.project_name, b.repository, full_version ) ) dstdir = os.path.join( b.output_dir, "%s-%s-%s" % ( b.project_name, b.repository, full_version ) )
filter = re.compile( "^.*%s\..*\.rpm$" % full_version ) filter = re.compile( "^.*%s\..*\.rpm$" % full_version )
moved_files = moveFilesToDir( rpmbase_dir, moved_files = moveFilesToDir( rpmbase_dir,
+24 -24
View File
@@ -1,11 +1,11 @@
#!/usr/bin/python #!/usr/bin/python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
#
# $Id: make_rpm.py 1382 2023-10-09 04:11:49Z fritsche_h $
# $HeadURL: svn://192.168.133.21/admin/rpmbuild/make_rpm.py $
# $Author: fritsche_h $
# Created by Christian Ehrlicher, SLSE, 20013-02-19
#
import datetime import datetime
import getopt import getopt
@@ -17,7 +17,7 @@ import time
import ConfigParser import ConfigParser
import fnmatch import fnmatch
# helper functions
loc = os.path.dirname( sys.argv[0] ) loc = os.path.dirname( sys.argv[0] )
loc = os.path.abspath( loc ) loc = os.path.abspath( loc )
exec(compile(open('helpers.py').read(), 'helpers.py', 'exec')) exec(compile(open('helpers.py').read(), 'helpers.py', 'exec'))
@@ -62,7 +62,7 @@ class build(object):
print("") print("")
time.sleep(2) time.sleep(2)
# does a svn export, returns True when it's a checkout or False when it's an update
def svn_export( self, svn_path, dest_dir, svn_revision = "HEAD", svn_user = None, svn_passwd = None ): def svn_export( self, svn_path, dest_dir, svn_revision = "HEAD", svn_user = None, svn_passwd = None ):
removeDirectory( dest_dir ) removeDirectory( dest_dir )
@@ -108,17 +108,17 @@ class build(object):
die( 'Unable to find a valid spec file in %s' % specdir ) die( 'Unable to find a valid spec file in %s' % specdir )
def copy_spec( self, svn_fullpath, dest_dir, spec_fullpath ): def copy_spec( self, svn_fullpath, dest_dir, spec_fullpath ):
# copy spec to build
f = open( spec_fullpath, 'r' ) f = open( spec_fullpath, 'r' )
content = f.read() content = f.read()
f.close() f.close()
# Jenkins Build Tag (wird von Jenkins gesetzt wenn darüber gebaut wird)
jenkins_build_tag = os.getenv( "BUILD_TAG" ) jenkins_build_tag = os.getenv( "BUILD_TAG" )
if jenkins_build_tag == None or len(jenkins_build_tag) == 0: if jenkins_build_tag == None or len(jenkins_build_tag) == 0:
jenkins_build_tag = 'Not build with jenkins job' jenkins_build_tag = 'Not build with jenkins job'
# Versionsinformationen übergeben
cmake_flags = "" cmake_flags = ""
cmake_flags += '-D%s_VERSION_MAJOR:STRING="%s" ' % (self.cmake_version_prefix, self.version_maj) cmake_flags += '-D%s_VERSION_MAJOR:STRING="%s" ' % (self.cmake_version_prefix, self.version_maj)
cmake_flags += '-D%s_VERSION_MINOR:STRING="%s" ' % (self.cmake_version_prefix, self.version_min) cmake_flags += '-D%s_VERSION_MINOR:STRING="%s" ' % (self.cmake_version_prefix, self.version_min)
@@ -134,7 +134,7 @@ class build(object):
if self.cmake_build_flags: if self.cmake_build_flags:
cmake_flags += ' %s ' % self.cmake_build_flags cmake_flags += ' %s ' % self.cmake_build_flags
# und den Buildtype
cmake_flags += '-DCMAKE_BUILD_TYPE="%s" ' % self.buildtype cmake_flags += '-DCMAKE_BUILD_TYPE="%s" ' % self.buildtype
filename = 'project.%s.cfg' % self.project_name filename = 'project.%s.cfg' % self.project_name
@@ -183,8 +183,8 @@ class build(object):
info( "Packing sources in %s to %s" % ( src_dir, xzfilename ) ) info( "Packing sources in %s to %s" % ( src_dir, xzfilename ) )
info( "--------------------------------" ) info( "--------------------------------" )
removeDirectory( xzfilename ) # falls es ein directory ist removeDirectory( xzfilename )
if os.path.exists( xzfilename ): # falls es eine datei ist if os.path.exists( xzfilename ):
os.remove( xzfilename ) os.remove( xzfilename )
if not os.path.exists( dest_dir ): if not os.path.exists( dest_dir ):
os.makedirs( dest_dir ) os.makedirs( dest_dir )
@@ -193,16 +193,16 @@ class build(object):
cmd = "tar cJf %s %s" % ( xzfilename, os.path.split( src_dir )[1] ) cmd = "tar cJf %s %s" % ( xzfilename, os.path.split( src_dir )[1] )
system( cmd, sys.stdout ) and die( "while packing. cmd: %s" % command ) system( cmd, sys.stdout ) and die( "while packing. cmd: %s" % command )
# svn export ${svn} ${base}
# fixup_rde_header ${base} "c"
# fixup_rde_header ${base} "h"
# fixup_rde_header ${base} "cpp"
# fixup_rde_header ${base} "hpp"
# fixup_rde_header ${base} "txt"
# fixup_rde_header ${base} "py"
# cp ${base}/specs/ctc.spec /usr/src/packages/SPECS/
def usage(): def usage():
@@ -258,7 +258,7 @@ def main():
else: else:
b.svn_fullpath = "svn://%s/%s/%s/" % ( svn_server, b.repository, svn_path ) b.svn_fullpath = "svn://%s/%s/%s/" % ( svn_server, b.repository, svn_path )
# b.check_rpm("ctc_EXTFW_%s" % os_str)
b.version_rev = getSvn_Release( b.svn_fullpath ) b.version_rev = getSvn_Release( b.svn_fullpath )
b.version_date = getSvn_Date( b.svn_fullpath ) b.version_date = getSvn_Date( b.svn_fullpath )
@@ -285,7 +285,7 @@ def main():
removeDirectory( svn_destdir ) removeDirectory( svn_destdir )
exec_rpmbuild( specdir, specname ) exec_rpmbuild( specdir, specname )
# move rpms to FOO-1.2-345
dstdir = os.path.join( b.output_dir, "%s-%s-%s" % ( b.project_name, b.repository, full_version ) ) dstdir = os.path.join( b.output_dir, "%s-%s-%s" % ( b.project_name, b.repository, full_version ) )
filter = re.compile( "^.*%s\..*\.rpm$" % full_version ) filter = re.compile( "^.*%s\..*\.rpm$" % full_version )
moved_files = moveFilesToDir( rpmbase_dir, moved_files = moveFilesToDir( rpmbase_dir,
+24 -24
View File
@@ -1,11 +1,11 @@
#!/usr/bin/python #!/usr/bin/python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
#
# $Id: make_rpm15.2.py 1382 2023-10-09 04:11:49Z fritsche_h $
# $HeadURL: svn://192.168.133.21/admin/rpmbuild/make_rpm15.2.py $
# $Author: fritsche_h $
# Created by Christian Ehrlicher, SLSE, 20013-02-19
#
import datetime import datetime
import getopt import getopt
@@ -17,7 +17,7 @@ import time
import ConfigParser import ConfigParser
import fnmatch import fnmatch
# helper functions
loc = os.path.dirname( sys.argv[0] ) loc = os.path.dirname( sys.argv[0] )
loc = os.path.abspath( loc ) loc = os.path.abspath( loc )
exec(compile(open('helpers.py').read(), 'helpers.py', 'exec')) exec(compile(open('helpers.py').read(), 'helpers.py', 'exec'))
@@ -62,7 +62,7 @@ class build(object):
print("") print("")
time.sleep(2) time.sleep(2)
# does a svn export, returns True when it's a checkout or False when it's an update
def svn_export( self, svn_path, dest_dir, svn_revision = "HEAD", svn_user = None, svn_passwd = None ): def svn_export( self, svn_path, dest_dir, svn_revision = "HEAD", svn_user = None, svn_passwd = None ):
removeDirectory( dest_dir ) removeDirectory( dest_dir )
@@ -108,17 +108,17 @@ class build(object):
die( 'Unable to find a valid spec file in %s' % specdir ) die( 'Unable to find a valid spec file in %s' % specdir )
def copy_spec( self, svn_fullpath, dest_dir, spec_fullpath ): def copy_spec( self, svn_fullpath, dest_dir, spec_fullpath ):
# copy spec to build
f = open( spec_fullpath, 'r' ) f = open( spec_fullpath, 'r' )
content = f.read() content = f.read()
f.close() f.close()
# Jenkins Build Tag (wird von Jenkins gesetzt wenn darüber gebaut wird)
jenkins_build_tag = os.getenv( "BUILD_TAG" ) jenkins_build_tag = os.getenv( "BUILD_TAG" )
if jenkins_build_tag == None or len(jenkins_build_tag) == 0: if jenkins_build_tag == None or len(jenkins_build_tag) == 0:
jenkins_build_tag = 'Not build with jenkins job' jenkins_build_tag = 'Not build with jenkins job'
# Versionsinformationen übergeben
cmake_flags = "" cmake_flags = ""
cmake_flags += '-D%s_VERSION_MAJOR:STRING="%s" ' % (self.cmake_version_prefix, self.version_maj) cmake_flags += '-D%s_VERSION_MAJOR:STRING="%s" ' % (self.cmake_version_prefix, self.version_maj)
cmake_flags += '-D%s_VERSION_MINOR:STRING="%s" ' % (self.cmake_version_prefix, self.version_min) cmake_flags += '-D%s_VERSION_MINOR:STRING="%s" ' % (self.cmake_version_prefix, self.version_min)
@@ -132,7 +132,7 @@ class build(object):
if self.cmake_build_flags: if self.cmake_build_flags:
cmake_flags += ' %s ' % self.cmake_build_flags cmake_flags += ' %s ' % self.cmake_build_flags
# und den Buildtype
cmake_flags += '-DCMAKE_BUILD_TYPE="%s" ' % self.buildtype cmake_flags += '-DCMAKE_BUILD_TYPE="%s" ' % self.buildtype
filename = 'project.%s.cfg' % self.project_name filename = 'project.%s.cfg' % self.project_name
@@ -181,8 +181,8 @@ class build(object):
info( "Packing sources in %s to %s" % ( src_dir, xzfilename ) ) info( "Packing sources in %s to %s" % ( src_dir, xzfilename ) )
info( "--------------------------------" ) info( "--------------------------------" )
removeDirectory( xzfilename ) # falls es ein directory ist removeDirectory( xzfilename )
if os.path.exists( xzfilename ): # falls es eine datei ist if os.path.exists( xzfilename ):
os.remove( xzfilename ) os.remove( xzfilename )
if not os.path.exists( dest_dir ): if not os.path.exists( dest_dir ):
os.makedirs( dest_dir ) os.makedirs( dest_dir )
@@ -191,16 +191,16 @@ class build(object):
cmd = "tar cJf %s %s" % ( xzfilename, os.path.split( src_dir )[1] ) cmd = "tar cJf %s %s" % ( xzfilename, os.path.split( src_dir )[1] )
system( cmd, sys.stdout ) and die( "while packing. cmd: %s" % command ) system( cmd, sys.stdout ) and die( "while packing. cmd: %s" % command )
# svn export ${svn} ${base}
# fixup_rde_header ${base} "c"
# fixup_rde_header ${base} "h"
# fixup_rde_header ${base} "cpp"
# fixup_rde_header ${base} "hpp"
# fixup_rde_header ${base} "txt"
# fixup_rde_header ${base} "py"
# cp ${base}/specs/ctc.spec /usr/src/packages/SPECS/
def usage(): def usage():
@@ -256,7 +256,7 @@ def main():
else: else:
b.svn_fullpath = "svn://%s/%s/%s/" % ( svn_server, b.repository, svn_path ) b.svn_fullpath = "svn://%s/%s/%s/" % ( svn_server, b.repository, svn_path )
# b.check_rpm("ctc_EXTFW_%s" % os_str)
b.version_rev = getSvn_Release( b.svn_fullpath ) b.version_rev = getSvn_Release( b.svn_fullpath )
b.version_date = getSvn_Date( b.svn_fullpath ) b.version_date = getSvn_Date( b.svn_fullpath )
@@ -283,7 +283,7 @@ def main():
removeDirectory( svn_destdir ) removeDirectory( svn_destdir )
exec_rpmbuild( specdir, specname ) exec_rpmbuild( specdir, specname )
# move rpms to FOO-1.2-345
dstdir = os.path.join( b.output_dir, "%s-%s-%s" % ( b.project_name, b.repository, full_version ) ) dstdir = os.path.join( b.output_dir, "%s-%s-%s" % ( b.project_name, b.repository, full_version ) )
filter = re.compile( "^.*%s\..*\.rpm$" % full_version ) filter = re.compile( "^.*%s\..*\.rpm$" % full_version )
moved_files = moveFilesToDir( rpmbase_dir, moved_files = moveFilesToDir( rpmbase_dir,
+18 -18
View File
@@ -11,7 +11,7 @@ import time
import ConfigParser import ConfigParser
import fnmatch import fnmatch
# helper functions
loc = os.path.dirname( sys.argv[0] ) loc = os.path.dirname( sys.argv[0] )
loc = os.path.abspath( loc ) loc = os.path.abspath( loc )
exec(compile(open('helpers.py').read(), 'helpers.py', 'exec')) exec(compile(open('helpers.py').read(), 'helpers.py', 'exec'))
@@ -85,17 +85,17 @@ class build(object):
die( 'Unable to find a valid spec file in %s' % specdir ) die( 'Unable to find a valid spec file in %s' % specdir )
def copy_spec( self, dest_dir, spec_fullpath ): def copy_spec( self, dest_dir, spec_fullpath ):
# copy spec to build
f = open( spec_fullpath, 'r' ) f = open( spec_fullpath, 'r' )
content = f.read() content = f.read()
f.close() f.close()
# Jenkins Build Tag (wird von Jenkins gesetzt wenn darüber gebaut wird)
jenkins_build_tag = os.getenv( "BUILD_TAG" ) jenkins_build_tag = os.getenv( "BUILD_TAG" )
if jenkins_build_tag == None or len(jenkins_build_tag) == 0: if jenkins_build_tag == None or len(jenkins_build_tag) == 0:
jenkins_build_tag = 'Not build with jenkins job' jenkins_build_tag = 'Not build with jenkins job'
# Versionsinformationen übergeben
cmake_flags = "" cmake_flags = ""
cmake_flags += '-D%s_VERSION_MAJOR:STRING="%s" ' % (self.cmake_version_prefix, self.version_maj) cmake_flags += '-D%s_VERSION_MAJOR:STRING="%s" ' % (self.cmake_version_prefix, self.version_maj)
cmake_flags += '-D%s_VERSION_MINOR:STRING="%s" ' % (self.cmake_version_prefix, self.version_min) cmake_flags += '-D%s_VERSION_MINOR:STRING="%s" ' % (self.cmake_version_prefix, self.version_min)
@@ -112,7 +112,7 @@ class build(object):
if self.cmake_build_flags: if self.cmake_build_flags:
cmake_flags += ' %s ' % self.cmake_build_flags cmake_flags += ' %s ' % self.cmake_build_flags
# und den Buildtype
cmake_flags += '-DCMAKE_BUILD_TYPE="%s" ' % self.buildtype cmake_flags += '-DCMAKE_BUILD_TYPE="%s" ' % self.buildtype
filename = 'project.%s.cfg' % self.project_name filename = 'project.%s.cfg' % self.project_name
@@ -164,8 +164,8 @@ class build(object):
info( "Packing pack %s" % ( os.path.split( src_dir )[1]) ) info( "Packing pack %s" % ( os.path.split( src_dir )[1]) )
info( "--------------------------------" ) info( "--------------------------------" )
removeDirectory( xzfilename ) # falls es ein directory ist removeDirectory( xzfilename )
if os.path.exists( xzfilename ): # falls es eine datei ist if os.path.exists( xzfilename ):
os.remove( xzfilename ) os.remove( xzfilename )
if not os.path.exists( dest_dir ): if not os.path.exists( dest_dir ):
os.makedirs( dest_dir ) os.makedirs( dest_dir )
@@ -174,16 +174,16 @@ class build(object):
cmd = "tar cJf %s %s" % ( xzfilename, os.path.split( src_dir )[1] ) cmd = "tar cJf %s %s" % ( xzfilename, os.path.split( src_dir )[1] )
system( cmd, sys.stdout ) and die( "while packing. cmd: %s" % command ) system( cmd, sys.stdout ) and die( "while packing. cmd: %s" % command )
# svn export ${svn} ${base}
# fixup_rde_header ${base} "c"
# fixup_rde_header ${base} "h"
# fixup_rde_header ${base} "cpp"
# fixup_rde_header ${base} "hpp"
# fixup_rde_header ${base} "txt"
# fixup_rde_header ${base} "py"
# cp ${base}/specs/ctc.spec /usr/src/packages/SPECS/
def usage(): def usage():
@@ -226,14 +226,14 @@ def main():
except: except:
die( "Invalid version format (maj.min): %s" % a ) die( "Invalid version format (maj.min): %s" % a )
# b.check_rpm("ctc_EXTFW_%s" % os_str)
b.version_date = os.getenv( "VERSION_DATE" ) b.version_date = os.getenv( "VERSION_DATE" )
b.init() b.init()
b.printOptions() b.printOptions()
rpmbase_dir = '/shd/CTC/TOOLS/rpmbuild' rpmbase_dir = '/shd/CTC/TOOLS/rpmbuild'
# project_base_dir = '/builds/projects-domain-live/tds'
project_base_dir = os.getenv( "WORKSPACE" ) project_base_dir = os.getenv( "WORKSPACE" )
specdir = os.path.join( rpmbase_dir, "SPECS" ) specdir = os.path.join( rpmbase_dir, "SPECS" )
if not os.path.exists(specdir): if not os.path.exists(specdir):
@@ -247,7 +247,7 @@ def main():
b.pack_sources( os.path.join(project_base_dir, 'legatus'), os.path.join( rpmbase_dir, "SOURCES" ) ) b.pack_sources( os.path.join(project_base_dir, 'legatus'), os.path.join( rpmbase_dir, "SOURCES" ) )
exec_rpmbuild( specdir, specname ) exec_rpmbuild( specdir, specname )
# move rpms to FOO-1.2-345
dstdir = os.path.join( b.output_dir, "%s-%s-%s" % ( b.project_name, b.repository, full_version ) ) dstdir = os.path.join( b.output_dir, "%s-%s-%s" % ( b.project_name, b.repository, full_version ) )
filter = re.compile( "^.*%s\..*\.rpm$" % full_version ) filter = re.compile( "^.*%s\..*\.rpm$" % full_version )
moved_files = moveFilesToDir( rpmbase_dir, moved_files = moveFilesToDir( rpmbase_dir,
+38 -38
View File
@@ -1,11 +1,11 @@
#!/usr/bin/python #!/usr/bin/python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
#
# $Id: make_rpmSVOnly.py 1382 2023-10-09 04:11:49Z fritsche_h $
# $HeadURL: svn://slssvn/admin/rpmbuild/make_rpmSVOnly.py $
# $Author: fritsche_h $
# Created by Christian Ehrlicher, SLSE, 20013-02-19
#
import datetime import datetime
import getopt import getopt
@@ -17,7 +17,7 @@ import time
import ConfigParser import ConfigParser
import fnmatch import fnmatch
# helper functions
loc = os.path.dirname( sys.argv[0] ) loc = os.path.dirname( sys.argv[0] )
loc = os.path.abspath( loc ) loc = os.path.abspath( loc )
exec(compile(open('helpers.py').read(), 'helpers.py', 'exec')) exec(compile(open('helpers.py').read(), 'helpers.py', 'exec'))
@@ -33,7 +33,7 @@ class build(object):
self.version_rev = 0 self.version_rev = 0
self.cmake_version_prefix = "TDS" self.cmake_version_prefix = "TDS"
self.source_dir_rel = "legatus" self.source_dir_rel = "legatus"
#self.svn_fullpath = None
self.build_hla_rpm = "false" self.build_hla_rpm = "false"
self.build_sv_rpm = "true" self.build_sv_rpm = "true"
self.build_lic_rpm = "false" self.build_lic_rpm = "false"
@@ -68,14 +68,14 @@ class build(object):
print(" Build WS RPM: %s" % self.build_ws_rpm) print(" Build WS RPM: %s" % self.build_ws_rpm)
print(" Build Building RPM: %s" % self.build_bld_rpm) print(" Build Building RPM: %s" % self.build_bld_rpm)
print(" Build AAR RPM: %s" % self.build_aar_rpm) print(" Build AAR RPM: %s" % self.build_aar_rpm)
# print(" SVN Path: %s" % self.svn_fullpath)
print(" Version: %s.%s-%s" % ( self.version_maj, self.version_min, self.version_rev )) print(" Version: %s.%s-%s" % ( self.version_maj, self.version_min, self.version_rev ))
print(" Jenkins build number: %s" % os.getenv( "BUILD_NUMBER" )) print(" Jenkins build number: %s" % os.getenv( "BUILD_NUMBER" ))
print(" Date: %s" % self.version_date) print(" Date: %s" % self.version_date)
print("") print("")
time.sleep(2) time.sleep(2)
# does a svn export, returns True when it's a checkout or False when it's an update
def svn_export( self, svn_path, dest_dir, svn_revision = "HEAD", svn_user = None, svn_passwd = None ): def svn_export( self, svn_path, dest_dir, svn_revision = "HEAD", svn_user = None, svn_passwd = None ):
removeDirectory( dest_dir ) removeDirectory( dest_dir )
@@ -125,17 +125,17 @@ class build(object):
die( 'Unable to find a valid spec file in %s' % specdir ) die( 'Unable to find a valid spec file in %s' % specdir )
def copy_spec( self, dest_dir, spec_fullpath ): def copy_spec( self, dest_dir, spec_fullpath ):
# copy spec to build
f = open( spec_fullpath, 'r' ) f = open( spec_fullpath, 'r' )
content = f.read() content = f.read()
f.close() f.close()
# Jenkins Build Tag (wird von Jenkins gesetzt wenn darüber gebaut wird)
jenkins_build_tag = os.getenv( "BUILD_TAG" ) jenkins_build_tag = os.getenv( "BUILD_TAG" )
if jenkins_build_tag == None or len(jenkins_build_tag) == 0: if jenkins_build_tag == None or len(jenkins_build_tag) == 0:
jenkins_build_tag = 'Not build with jenkins job' jenkins_build_tag = 'Not build with jenkins job'
# Versionsinformationen übergeben
cmake_flags = "" cmake_flags = ""
cmake_flags += '-D%s_VERSION_MAJOR:STRING="%s" ' % (self.cmake_version_prefix, self.version_maj) cmake_flags += '-D%s_VERSION_MAJOR:STRING="%s" ' % (self.cmake_version_prefix, self.version_maj)
cmake_flags += '-D%s_VERSION_MINOR:STRING="%s" ' % (self.cmake_version_prefix, self.version_min) cmake_flags += '-D%s_VERSION_MINOR:STRING="%s" ' % (self.cmake_version_prefix, self.version_min)
@@ -151,13 +151,13 @@ class build(object):
if self.cmake_build_flags: if self.cmake_build_flags:
cmake_flags += ' %s ' % self.cmake_build_flags cmake_flags += ' %s ' % self.cmake_build_flags
# und den Buildtype
cmake_flags += '-DCMAKE_BUILD_TYPE="%s" ' % self.buildtype cmake_flags += '-DCMAKE_BUILD_TYPE="%s" ' % self.buildtype
filename = 'project.%s.cfg' % self.project_name filename = 'project.%s.cfg' % self.project_name
cmake_flags += '-DTDS_PROJECT_CONFIG_FILE=%s ' % filename cmake_flags += '-DTDS_PROJECT_CONFIG_FILE=%s ' % filename
## auto add BuildFlags depending on the modules
if self.build_sv_rpm == "true": if self.build_sv_rpm == "true":
cmake_flags += '-DBUILD_SV=ON ' cmake_flags += '-DBUILD_SV=ON '
if self.build_ws_rpm == "true": if self.build_ws_rpm == "true":
@@ -165,7 +165,7 @@ class build(object):
if self.build_hla_rpm == "true": if self.build_hla_rpm == "true":
cmake_flags += '-DBUILD_HLA=ON -DBUILD_SVC_HLA=ON ' cmake_flags += '-DBUILD_HLA=ON -DBUILD_SVC_HLA=ON '
if self.build_aar_rpm == "true": if self.build_aar_rpm == "true":
cmake_flags += '-DBUILD_AAR=ON ' cmake_flags += '-DBUILD_AAR=ON '
content = content.replace( "@PROJECT@", self.project_name ) content = content.replace( "@PROJECT@", self.project_name )
content = content.replace( "@OS_SYSTEM@", getOS_Name() ) content = content.replace( "@OS_SYSTEM@", getOS_Name() )
@@ -180,9 +180,9 @@ class build(object):
content = content.replace( "@BUILDSVNRPM@", self.build_sv_rpm ) content = content.replace( "@BUILDSVNRPM@", self.build_sv_rpm )
content = content.replace( "@BUILDRPMHLA@", self.build_hla_rpm ) content = content.replace( "@BUILDRPMHLA@", self.build_hla_rpm )
content = content.replace( "@BUILDRPMLIC@", self.build_lic_rpm ) content = content.replace( "@BUILDRPMLIC@", self.build_lic_rpm )
# content = content.replace( "@BUILDRPMWS@", self.build_ws_rpm )
# content = content.replace( "@BUILDRPMBLD@", self.build_bld_rpm )
# content = content.replace( "@BUILDRPMAAR@", self.build_aar_rpm )
if not os.path.exists( dest_dir ): if not os.path.exists( dest_dir ):
@@ -218,8 +218,8 @@ class build(object):
info( "Packing sources in %s to %s" % ( src_dir, xzfilename ) ) info( "Packing sources in %s to %s" % ( src_dir, xzfilename ) )
info( "--------------------------------" ) info( "--------------------------------" )
removeDirectory( xzfilename ) # falls es ein directory ist removeDirectory( xzfilename )
if os.path.exists( xzfilename ): # falls es eine datei ist if os.path.exists( xzfilename ):
os.remove( xzfilename ) os.remove( xzfilename )
if not os.path.exists( dest_dir ): if not os.path.exists( dest_dir ):
os.makedirs( dest_dir ) os.makedirs( dest_dir )
@@ -228,16 +228,16 @@ class build(object):
cmd = "tar cJf %s %s" % ( xzfilename, os.path.split( src_dir )[1] ) cmd = "tar cJf %s %s" % ( xzfilename, os.path.split( src_dir )[1] )
system( cmd, sys.stdout ) and die( "while packing. cmd: %s" % command ) system( cmd, sys.stdout ) and die( "while packing. cmd: %s" % command )
# svn export ${svn} ${base}
# fixup_rde_header ${base} "c"
# fixup_rde_header ${base} "h"
# fixup_rde_header ${base} "cpp"
# fixup_rde_header ${base} "hpp"
# fixup_rde_header ${base} "txt"
# fixup_rde_header ${base} "py"
# cp ${base}/specs/ctc.spec /usr/src/packages/SPECS/
def usage(): def usage():
@@ -296,31 +296,31 @@ def main():
svn_path = a svn_path = a
# b.check_rpm("ctc_EXTFW_%s" % os_str)
#b.version_rev = getSvn_Release( b.svn_fullpath )
b.version_rev = os.getenv( "BUILD_NUMBER" ) b.version_rev = os.getenv( "BUILD_NUMBER" )
# b.version_date = getSvn_Date( b.svn_fullpath )
b.version_date = os.getenv( "VERSION_DATE" ) b.version_date = os.getenv( "VERSION_DATE" )
b.init() b.init()
b.printOptions() b.printOptions()
# rpmbase_dir = os.path.join( os.getenv( "HOME" ), 'rpmbuild' )
rpmbase_dir = '/shd/CTC/TOOLS/rpmbuild' rpmbase_dir = '/shd/CTC/TOOLS/rpmbuild'
# project_base_dir = '/builds/projects-domain-live/tds'
project_base_dir = os.getenv( "PROJECT_BASE_DIR" ) project_base_dir = os.getenv( "PROJECT_BASE_DIR" )
specdir = os.path.join( rpmbase_dir, "SPECS" ) specdir = os.path.join( rpmbase_dir, "SPECS" )
#specdir = os.path.join( rpmbase_dir, "SPECS" )
if not os.path.exists(specdir): if not os.path.exists(specdir):
os.makedirs(specdir) os.makedirs(specdir)
# b.svn_export( b.svn_fullpath, svn_destdir )
b.clean_lts_cc_conf(os.path.join(project_base_dir, 'Lts', 'Projects')) b.clean_lts_cc_conf(os.path.join(project_base_dir, 'Lts', 'Projects'))
#specname = b.specname( os.path.join( svn_destdir, "specs" ) )
specname = b.specname(os.path.join(project_base_dir, 'specs')) specname = b.specname(os.path.join(project_base_dir, 'specs'))
b.copy_spec( specdir, os.path.join(project_base_dir, "specs", specname )) b.copy_spec( specdir, os.path.join(project_base_dir, "specs", specname ))
@@ -330,7 +330,7 @@ def main():
b.pack_sources( project_base_dir, os.path.join( rpmbase_dir, "SOURCES" ) ) b.pack_sources( project_base_dir, os.path.join( rpmbase_dir, "SOURCES" ) )
exec_rpmbuild( specdir, specname ) exec_rpmbuild( specdir, specname )
# move rpms to FOO-1.2-345
dstdir = os.path.join( b.output_dir, "%s-%s-%s" % ( b.project_name, b.repository, full_version ) ) dstdir = os.path.join( b.output_dir, "%s-%s-%s" % ( b.project_name, b.repository, full_version ) )
filter = re.compile( "^.*%s\..*\.rpm$" % full_version ) filter = re.compile( "^.*%s\..*\.rpm$" % full_version )
moved_files = moveFilesToDir( rpmbase_dir, moved_files = moveFilesToDir( rpmbase_dir,
+37 -37
View File
@@ -1,11 +1,11 @@
#!/usr/bin/python #!/usr/bin/python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
#
# $Id: make_rpmSVOnly.py 1382 2023-10-09 04:11:49Z fritsche_h $
# $HeadURL: svn://slssvn/admin/rpmbuild/make_rpmSVOnly.py $
# $Author: fritsche_h $
# Created by Christian Ehrlicher, SLSE, 20013-02-19
#
import datetime import datetime
import getopt import getopt
@@ -17,7 +17,7 @@ import time
import ConfigParser import ConfigParser
import fnmatch import fnmatch
# helper functions
loc = os.path.dirname( sys.argv[0] ) loc = os.path.dirname( sys.argv[0] )
loc = os.path.abspath( loc ) loc = os.path.abspath( loc )
exec(compile(open('helpers.py').read(), 'helpers.py', 'exec')) exec(compile(open('helpers.py').read(), 'helpers.py', 'exec'))
@@ -33,7 +33,7 @@ class build(object):
self.version_rev = 0 self.version_rev = 0
self.cmake_version_prefix = "TDS" self.cmake_version_prefix = "TDS"
self.source_dir_rel = "legatus" self.source_dir_rel = "legatus"
#self.svn_fullpath = None
self.build_hla_rpm = "false" self.build_hla_rpm = "false"
self.build_sv_rpm = "true" self.build_sv_rpm = "true"
self.build_lic_rpm = "false" self.build_lic_rpm = "false"
@@ -68,14 +68,14 @@ class build(object):
print(" Build WS RPM: %s" % self.build_ws_rpm) print(" Build WS RPM: %s" % self.build_ws_rpm)
print(" Build Building RPM: %s" % self.build_bld_rpm) print(" Build Building RPM: %s" % self.build_bld_rpm)
print(" Build AAR RPM: %s" % self.build_aar_rpm) print(" Build AAR RPM: %s" % self.build_aar_rpm)
# print(" SVN Path: %s" % self.svn_fullpath)
print(" Version: %s.%s-%s" % ( self.version_maj, self.version_min, self.version_rev )) print(" Version: %s.%s-%s" % ( self.version_maj, self.version_min, self.version_rev ))
print(" Jenkins build number: %s" % os.getenv( "BUILD_NUMBER" )) print(" Jenkins build number: %s" % os.getenv( "BUILD_NUMBER" ))
print(" Date: %s" % self.version_date) print(" Date: %s" % self.version_date)
print("") print("")
time.sleep(2) time.sleep(2)
# does a svn export, returns True when it's a checkout or False when it's an update
def svn_export( self, svn_path, dest_dir, svn_revision = "HEAD", svn_user = None, svn_passwd = None ): def svn_export( self, svn_path, dest_dir, svn_revision = "HEAD", svn_user = None, svn_passwd = None ):
removeDirectory( dest_dir ) removeDirectory( dest_dir )
@@ -125,17 +125,17 @@ class build(object):
die( 'Unable to find a valid spec file in %s' % specdir ) die( 'Unable to find a valid spec file in %s' % specdir )
def copy_spec( self, dest_dir, spec_fullpath ): def copy_spec( self, dest_dir, spec_fullpath ):
# copy spec to build
f = open( spec_fullpath, 'r' ) f = open( spec_fullpath, 'r' )
content = f.read() content = f.read()
f.close() f.close()
# Jenkins Build Tag (wird von Jenkins gesetzt wenn darüber gebaut wird)
jenkins_build_tag = os.getenv( "BUILD_TAG" ) jenkins_build_tag = os.getenv( "BUILD_TAG" )
if jenkins_build_tag == None or len(jenkins_build_tag) == 0: if jenkins_build_tag == None or len(jenkins_build_tag) == 0:
jenkins_build_tag = 'Not build with jenkins job' jenkins_build_tag = 'Not build with jenkins job'
# Versionsinformationen übergeben
cmake_flags = "" cmake_flags = ""
cmake_flags += '-D%s_VERSION_MAJOR:STRING="%s" ' % (self.cmake_version_prefix, self.version_maj) cmake_flags += '-D%s_VERSION_MAJOR:STRING="%s" ' % (self.cmake_version_prefix, self.version_maj)
cmake_flags += '-D%s_VERSION_MINOR:STRING="%s" ' % (self.cmake_version_prefix, self.version_min) cmake_flags += '-D%s_VERSION_MINOR:STRING="%s" ' % (self.cmake_version_prefix, self.version_min)
@@ -151,13 +151,13 @@ class build(object):
if self.cmake_build_flags: if self.cmake_build_flags:
cmake_flags += ' %s ' % self.cmake_build_flags cmake_flags += ' %s ' % self.cmake_build_flags
# und den Buildtype
cmake_flags += '-DCMAKE_BUILD_TYPE="%s" ' % self.buildtype cmake_flags += '-DCMAKE_BUILD_TYPE="%s" ' % self.buildtype
filename = 'project.%s.cfg' % self.project_name filename = 'project.%s.cfg' % self.project_name
cmake_flags += '-DTDS_PROJECT_CONFIG_FILE=%s ' % filename cmake_flags += '-DTDS_PROJECT_CONFIG_FILE=%s ' % filename
## auto add BuildFlags depending on the modules
if self.build_sv_rpm == "true": if self.build_sv_rpm == "true":
cmake_flags += '-DBUILD_SV=ON ' cmake_flags += '-DBUILD_SV=ON '
if self.build_ws_rpm == "true": if self.build_ws_rpm == "true":
@@ -165,7 +165,7 @@ class build(object):
if self.build_hla_rpm == "true": if self.build_hla_rpm == "true":
cmake_flags += '-DBUILD_HLA=ON -DBUILD_SVC_HLA=ON ' cmake_flags += '-DBUILD_HLA=ON -DBUILD_SVC_HLA=ON '
if self.build_aar_rpm == "true": if self.build_aar_rpm == "true":
cmake_flags += '-DBUILD_AAR=ON ' cmake_flags += '-DBUILD_AAR=ON '
content = content.replace( "@PROJECT@", self.project_name ) content = content.replace( "@PROJECT@", self.project_name )
content = content.replace( "@OS_SYSTEM@", getOS_Name() ) content = content.replace( "@OS_SYSTEM@", getOS_Name() )
@@ -180,9 +180,9 @@ class build(object):
content = content.replace( "@BUILDSVNRPM@", self.build_sv_rpm ) content = content.replace( "@BUILDSVNRPM@", self.build_sv_rpm )
content = content.replace( "@BUILDRPMHLA@", self.build_hla_rpm ) content = content.replace( "@BUILDRPMHLA@", self.build_hla_rpm )
content = content.replace( "@BUILDRPMLIC@", self.build_lic_rpm ) content = content.replace( "@BUILDRPMLIC@", self.build_lic_rpm )
# content = content.replace( "@BUILDRPMWS@", self.build_ws_rpm )
# content = content.replace( "@BUILDRPMBLD@", self.build_bld_rpm )
# content = content.replace( "@BUILDRPMAAR@", self.build_aar_rpm )
if not os.path.exists( dest_dir ): if not os.path.exists( dest_dir ):
@@ -218,8 +218,8 @@ class build(object):
info( "Packing sources in %s to %s" % ( src_dir, xzfilename ) ) info( "Packing sources in %s to %s" % ( src_dir, xzfilename ) )
info( "--------------------------------" ) info( "--------------------------------" )
removeDirectory( xzfilename ) # falls es ein directory ist removeDirectory( xzfilename )
if os.path.exists( xzfilename ): # falls es eine datei ist if os.path.exists( xzfilename ):
os.remove( xzfilename ) os.remove( xzfilename )
if not os.path.exists( dest_dir ): if not os.path.exists( dest_dir ):
os.makedirs( dest_dir ) os.makedirs( dest_dir )
@@ -228,16 +228,16 @@ class build(object):
cmd = "tar cJf %s %s" % ( xzfilename, os.path.split( src_dir )[1] ) cmd = "tar cJf %s %s" % ( xzfilename, os.path.split( src_dir )[1] )
system( cmd, sys.stdout ) and die( "while packing. cmd: %s" % command ) system( cmd, sys.stdout ) and die( "while packing. cmd: %s" % command )
# svn export ${svn} ${base}
# fixup_rde_header ${base} "c"
# fixup_rde_header ${base} "h"
# fixup_rde_header ${base} "cpp"
# fixup_rde_header ${base} "hpp"
# fixup_rde_header ${base} "txt"
# fixup_rde_header ${base} "py"
# cp ${base}/specs/ctc.spec /usr/src/packages/SPECS/
def usage(): def usage():
@@ -296,27 +296,27 @@ def main():
svn_path = a svn_path = a
# b.check_rpm("ctc_EXTFW_%s" % os_str)
#b.version_rev = getSvn_Release( b.svn_fullpath )
b.version_rev = os.getenv( "BUILD_NUMBER" ) b.version_rev = os.getenv( "BUILD_NUMBER" )
# b.version_date = getSvn_Date( b.svn_fullpath )
b.version_date = os.getenv( "VERSION_DATE" ) b.version_date = os.getenv( "VERSION_DATE" )
b.init() b.init()
b.printOptions() b.printOptions()
# rpmbase_dir = os.path.join( os.getenv( "HOME" ), 'rpmbuild' )
rpmbase_dir = '/shd/CTC/TOOLS/rpmbuild' rpmbase_dir = '/shd/CTC/TOOLS/rpmbuild'
# project_base_dir = '/builds/projects-domain-live/tds'
# project_base_dir = os.getenv( "PROJECT_BASE_DIR" )
project_base_dir = os.getenv( "WORKSPACE" ) project_base_dir = os.getenv( "WORKSPACE" )
specdir = os.path.join( rpmbase_dir, "SPECS" ) specdir = os.path.join( rpmbase_dir, "SPECS" )
#specdir = os.path.join( rpmbase_dir, "SPECS" )
if not os.path.exists(specdir): if not os.path.exists(specdir):
os.makedirs(specdir) os.makedirs(specdir)
@@ -331,7 +331,7 @@ def main():
b.pack_sources( os.path.join(project_base_dir, 'legatus'), os.path.join( rpmbase_dir, "SOURCES" ) ) b.pack_sources( os.path.join(project_base_dir, 'legatus'), os.path.join( rpmbase_dir, "SOURCES" ) )
exec_rpmbuild( specdir, specname ) exec_rpmbuild( specdir, specname )
# move rpms to FOO-1.2-345
dstdir = os.path.join( b.output_dir, "%s-%s-%s" % ( b.project_name, b.repository, full_version ) ) dstdir = os.path.join( b.output_dir, "%s-%s-%s" % ( b.project_name, b.repository, full_version ) )
filter = re.compile( "^.*%s\..*\.rpm$" % full_version ) filter = re.compile( "^.*%s\..*\.rpm$" % full_version )
moved_files = moveFilesToDir( rpmbase_dir, moved_files = moveFilesToDir( rpmbase_dir,
+25 -25
View File
@@ -1,11 +1,11 @@
#!/usr/bin/python #!/usr/bin/python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
#
# $Id: make_rpmSVOnly.py 1382 2023-10-09 04:11:49Z fritsche_h $
# $HeadURL: svn://192.168.133.21/admin/rpmbuild/make_rpmSVOnly.py $
# $Author: fritsche_h $
# Created by Christian Ehrlicher, SLSE, 20013-02-19
#
import datetime import datetime
import getopt import getopt
@@ -17,7 +17,7 @@ import time
import ConfigParser import ConfigParser
import fnmatch import fnmatch
# helper functions
loc = os.path.dirname( sys.argv[0] ) loc = os.path.dirname( sys.argv[0] )
loc = os.path.abspath( loc ) loc = os.path.abspath( loc )
exec(compile(open('helpers.py').read(), 'helpers.py', 'exec')) exec(compile(open('helpers.py').read(), 'helpers.py', 'exec'))
@@ -60,7 +60,7 @@ class build(object):
print("") print("")
time.sleep(2) time.sleep(2)
# does a svn export, returns True when it's a checkout or False when it's an update
def svn_export( self, svn_path, dest_dir, svn_revision = "HEAD", svn_user = None, svn_passwd = None ): def svn_export( self, svn_path, dest_dir, svn_revision = "HEAD", svn_user = None, svn_passwd = None ):
removeDirectory( dest_dir ) removeDirectory( dest_dir )
@@ -106,17 +106,17 @@ class build(object):
die( 'Unable to find a valid spec file in %s' % specdir ) die( 'Unable to find a valid spec file in %s' % specdir )
def copy_spec( self, dest_dir, spec_fullpath ): def copy_spec( self, dest_dir, spec_fullpath ):
# copy spec to build
f = open( spec_fullpath, 'r' ) f = open( spec_fullpath, 'r' )
content = f.read() content = f.read()
f.close() f.close()
# Jenkins Build Tag (wird von Jenkins gesetzt wenn darüber gebaut wird)
jenkins_build_tag = os.getenv( "BUILD_TAG" ) jenkins_build_tag = os.getenv( "BUILD_TAG" )
if jenkins_build_tag == None or len(jenkins_build_tag) == 0: if jenkins_build_tag == None or len(jenkins_build_tag) == 0:
jenkins_build_tag = 'Not build with jenkins job' jenkins_build_tag = 'Not build with jenkins job'
# Versionsinformationen übergeben
cmake_flags = "" cmake_flags = ""
cmake_flags += '-D%s_VERSION_MAJOR:STRING="%s" ' % (self.cmake_version_prefix, self.version_maj) cmake_flags += '-D%s_VERSION_MAJOR:STRING="%s" ' % (self.cmake_version_prefix, self.version_maj)
cmake_flags += '-D%s_VERSION_MINOR:STRING="%s" ' % (self.cmake_version_prefix, self.version_min) cmake_flags += '-D%s_VERSION_MINOR:STRING="%s" ' % (self.cmake_version_prefix, self.version_min)
@@ -133,7 +133,7 @@ class build(object):
if self.cmake_build_flags: if self.cmake_build_flags:
cmake_flags += ' %s ' % self.cmake_build_flags cmake_flags += ' %s ' % self.cmake_build_flags
# und den Buildtype
cmake_flags += '-DCMAKE_BUILD_TYPE="%s" ' % self.buildtype cmake_flags += '-DCMAKE_BUILD_TYPE="%s" ' % self.buildtype
filename = 'project.%s.cfg' % self.project_name filename = 'project.%s.cfg' % self.project_name
@@ -186,8 +186,8 @@ class build(object):
info( "--------------------------------" ) info( "--------------------------------" )
removeDirectory( xzfilename ) # falls es ein directory ist removeDirectory( xzfilename )
if os.path.exists( xzfilename ): # falls es eine datei ist if os.path.exists( xzfilename ):
os.remove( xzfilename ) os.remove( xzfilename )
if not os.path.exists( dest_dir ): if not os.path.exists( dest_dir ):
os.makedirs( dest_dir ) os.makedirs( dest_dir )
@@ -197,16 +197,16 @@ class build(object):
system( cmd, sys.stdout ) and die( "while packing. cmd: %s" % command ) system( cmd, sys.stdout ) and die( "while packing. cmd: %s" % command )
# svn export ${svn} ${base}
# fixup_rde_header ${base} "c"
# fixup_rde_header ${base} "h"
# fixup_rde_header ${base} "cpp"
# fixup_rde_header ${base} "hpp"
# fixup_rde_header ${base} "txt"
# fixup_rde_header ${base} "py"
# cp ${base}/specs/ctc.spec /usr/src/packages/SPECS/
def usage(): def usage():
@@ -250,13 +250,13 @@ def main():
except: except:
die( "Invalid version format (maj.min): %s" % a ) die( "Invalid version format (maj.min): %s" % a )
# b.check_rpm("ctc_EXTFW_%s" % os_str)
b.version_date = os.getenv( "VERSION_DATE" ) b.version_date = os.getenv( "VERSION_DATE" )
b.init() b.init()
b.printOptions() b.printOptions()
rpmbase_dir = '/shd/CTC/TOOLS/rpmbuild' rpmbase_dir = '/shd/CTC/TOOLS/rpmbuild'
# project_base_dir = '/builds/projects-domain-live/tds'
project_base_dir = os.getenv( "PROJECT_BASE_DIR" ) project_base_dir = os.getenv( "PROJECT_BASE_DIR" )
specdir = os.path.join( rpmbase_dir, "SPECS" ) specdir = os.path.join( rpmbase_dir, "SPECS" )
if not os.path.exists(specdir): if not os.path.exists(specdir):
@@ -271,7 +271,7 @@ def main():
b.pack_sources( project_base_dir, os.path.join( rpmbase_dir, "SOURCES" ) ) b.pack_sources( project_base_dir, os.path.join( rpmbase_dir, "SOURCES" ) )
exec_rpmbuild( specdir, specname ) exec_rpmbuild( specdir, specname )
# move rpms to FOO-1.2-345
dstdir = os.path.join( b.output_dir, "%s-%s-%s" % ( b.project_name, b.repository, full_version ) ) dstdir = os.path.join( b.output_dir, "%s-%s-%s" % ( b.project_name, b.repository, full_version ) )
filter = re.compile( "^.*%s\..*\.rpm$" % full_version ) filter = re.compile( "^.*%s\..*\.rpm$" % full_version )
moved_files = moveFilesToDir( rpmbase_dir, moved_files = moveFilesToDir( rpmbase_dir,
+11 -11
View File
@@ -1,29 +1,29 @@
#!/usr/bin/python #!/usr/bin/python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
#
# $Id: make_rpm_extfw.py 1344 2017-11-16 14:55:23Z ehrlicher $
# $HeadURL: svn://192.168.133.21/admin/rpmbuild/make_rpm_extfw.py $
# $Author: ehrlicher $
# Created by Christian Ehrlicher, SLSE, 20013-12-06
#
import platform import platform
import getopt import getopt
import os import os
import sys import sys
# helper functions
loc = os.path.dirname( sys.argv[0] ) loc = os.path.dirname( sys.argv[0] )
loc = os.path.abspath( loc ) loc = os.path.abspath( loc )
execfile(os.path.join( loc, 'helpers.py') ) execfile(os.path.join( loc, 'helpers.py') )
def copy_spec( src_filepath, dest_path, version_str, version_rev, project ): def copy_spec( src_filepath, dest_path, version_str, version_rev, project ):
# copy spec to build
f = open( src_filepath, 'r' ) f = open( src_filepath, 'r' )
content = f.read() content = f.read()
f.close() f.close()
# Jenkins Build Tag (wird von Jenkins gesetzt wenn darüber gebaut wird)
jenkins_build_tag = os.getenv( "BUILD_TAG" ) jenkins_build_tag = os.getenv( "BUILD_TAG" )
if jenkins_build_tag == None or len(jenkins_build_tag) == 0: if jenkins_build_tag == None or len(jenkins_build_tag) == 0:
jenkins_build_tag = 'Not build with jenkins job' jenkins_build_tag = 'Not build with jenkins job'
@@ -95,7 +95,7 @@ def main():
usage() usage()
die("Output directory not given" ) die("Output directory not given" )
# Annahme: spec-File liegt in TDS-source/spec, wir wollen TDS-Source
rpmbase_dir = "/usr/src/packages/" rpmbase_dir = "/usr/src/packages/"
try: try:
ver=platform.dist()[1].split('.')[0] ver=platform.dist()[1].split('.')[0]
@@ -137,7 +137,7 @@ def main():
exec_rpmbuild( specdir, os.path.split( spec_file )[1], extfw_builddir_base ) exec_rpmbuild( specdir, os.path.split( spec_file )[1], extfw_builddir_base )
removeDirectory( extfw_builddir_base ) removeDirectory( extfw_builddir_base )
# move rpms to FOO-1.2-345
dstdir = os.path.join( output_dir, "%s-%s-%s" % ( project_name, repository, full_version ) ) dstdir = os.path.join( output_dir, "%s-%s-%s" % ( project_name, repository, full_version ) )
filter = re.compile( "^.*%s\..*\.rpm$" % full_version ) filter = re.compile( "^.*%s\..*\.rpm$" % full_version )
moved_files = moveFilesToDir( rpmbase_dir, moved_files = moveFilesToDir( rpmbase_dir,
+9 -9
View File
@@ -1,11 +1,11 @@
#!/usr/bin/python #!/usr/bin/python
# -*- coding: utf-8 -*- # -*- coding: utf-8 -*-
#
# $Id: make_tag.py 1221 2016-05-26 11:00:07Z ehrlicher $
# $HeadURL: svn://192.168.133.21/admin/rpmbuild/make_tag.py $
# $Author: ehrlicher $
# Created by Christian Ehrlicher, SLSE, 20013-02-19
#
import datetime import datetime
import getopt import getopt
@@ -13,7 +13,7 @@ import os
import subprocess import subprocess
import sys import sys
# helper functions
def verbose(): def verbose():
verb = os.getenv( "EMERGE_VERBOSE" ) verb = os.getenv( "EMERGE_VERBOSE" )
if ( not verb == None and verb.isdigit() and int(verb) > 0 ): if ( not verb == None and verb.isdigit() and int(verb) > 0 ):
@@ -62,7 +62,7 @@ def usage():
print >> sys.stdout, " e.g.: %s -r AVS -s trunk -p tes_uae_ctc -v 4.3" % sys.argv[0] print >> sys.stdout, " e.g.: %s -r AVS -s trunk -p tes_uae_ctc -v 4.3" % sys.argv[0]
def main(): def main():
svn_server = "slssvn" svn_server = "slssvn"
@@ -97,7 +97,7 @@ def main():
try: try:
version_maj = version[0] version_maj = version[0]
version_min = version[1] version_min = version[1]
version = "%s.%s" % ( version_maj, version_min ) version = "%s.%s" % ( version_maj, version_min )
except: except:
die( "Invalid version format (maj.min): %s" % a ) die( "Invalid version format (maj.min): %s" % a )