Browse code

set dist flag, fix bindutils spec

ppadmavilasom authored on 2015/08/08 04:26:34
Showing 8 changed files
... ...
@@ -1,10 +1,10 @@
1 1
 Summary:	Domain Name System software
2 2
 Name:		bindutils
3 3
 Version:	9.10.1
4
-Release:	P1%{?dist}
4
+Release:	1%{?dist}
5 5
 License:	ISC
6 6
 URL:		http://www.isc.org/downloads/bind/
7
-Source0:	ftp://ftp.isc.org/isc/bind9/9.10.1-P1/bind-%{version}-%{release}.tar.gz
7
+Source0:	ftp://ftp.isc.org/isc/bind9/9.10.1-P1/bind-%{version}.tar.gz
8 8
 %define sha1 bind=24a81ba458a762c27be47461301fcf336cfb1d43
9 9
 Group:		Development/Tools
10 10
 Vendor:		VMware, Inc.
... ...
@@ -16,7 +16,7 @@ BIND is open source software that implements the Domain Name System (DNS) protoc
16 16
 for the Internet. It is a reference implementation of those protocols, but it is 
17 17
 also production-grade software, suitable for use in high-volume and high-reliability applications.
18 18
 %prep
19
-%setup -qn bind-%{version}-%{release}
19
+%setup -qn bind-%{version}
20 20
 %build
21 21
 ./configure \
22 22
 	--prefix=%{_prefix}
... ...
@@ -25,6 +25,7 @@ class PackageUtils(object):
25 25
         self.rpmbuildBinary = "rpmbuild"
26 26
         self.rpmbuildBuildallOption = "-ba --clean"
27 27
         self.rpmbuildNocheckOption = "--nocheck"
28
+        self.rpmbuildDistOption = '--define \\\"dist %s\\\"' % constants.dist
28 29
         self.queryRpmPackageOptions = "-qa"
29 30
         self.forceRpmPackageOptions = "--force"
30 31
         self.adjustGCCSpecScript="adjust-gcc-specs.sh"
... ...
@@ -152,7 +153,7 @@ class PackageUtils(object):
152 152
 
153 153
     def buildRPM(self,specFile,logFile,chrootCmd):
154 154
         
155
-        rpmBuildcmd= self.rpmbuildBinary+" "+self.rpmbuildBuildallOption+" "+self.rpmbuildNocheckOption
155
+        rpmBuildcmd= self.rpmbuildBinary+" "+self.rpmbuildBuildallOption+" "+self.rpmbuildNocheckOption +" "+self.rpmbuildDistOption
156 156
         rpmBuildcmd+=" "+specFile
157 157
         
158 158
         cmdUtils = CommandUtils()
... ...
@@ -178,7 +179,7 @@ class PackageUtils(object):
178 178
         cmdUtils = CommandUtils()
179 179
         version = constants.specData.getVersion(package)
180 180
         release = constants.specData.getRelease(package)
181
-        listFoundRPMFiles = cmdUtils.findFile(package+"-"+version+"-"+release+"*.rpm",constants.rpmPath)
181
+        listFoundRPMFiles = cmdUtils.findFile(package+"-"+version+"-"+release+".*.rpm",constants.rpmPath)
182 182
         if len(listFoundRPMFiles) == 1 :
183 183
             return listFoundRPMFiles[0]
184 184
         if len(listFoundRPMFiles) == 0 :
... ...
@@ -1,3 +1,4 @@
1
+import constants
1 2
 
2 3
 class rpmMacro(object):
3 4
 
... ...
@@ -31,7 +32,7 @@ class Package(object):
31 31
         self.version=""
32 32
         self.release=""
33 33
         self.buildarch="x86_64"
34
-        self.distribution=""
34
+        self.distribution=constants.constants.dist
35 35
         self.basePkgName=""
36 36
         
37 37
         self.sources=[]
... ...
@@ -31,7 +31,7 @@ class ToolChainUtils(object):
31 31
     def prepareBuildRoot(self,chrootID):
32 32
         self.logger.info("Preparing build environment")
33 33
         cmdUtils = CommandUtils()
34
-        prepareChrootCmd=self.prepareBuildRootCmd+" "+chrootID+" "+constants.specPath+" "+constants.rpmPath+" "+constants.logPath
34
+        prepareChrootCmd=self.prepareBuildRootCmd+" "+chrootID+" "+constants.specPath+" "+constants.rpmPath+" "+constants.logPath + " " + constants.dist
35 35
         logFile=constants.logPath+"/prepareBuildRoot.log"
36 36
         returnVal=cmdUtils.runCommandInShell(prepareChrootCmd,logFile)
37 37
         if not returnVal:
... ...
@@ -28,6 +28,7 @@ def main():
28 28
     parser.add_option("-t",  "--threads", dest="buildThreads",  default=1, type="int", help="Numbeer of working threads")
29 29
     parser.add_option("-m",  "--tool-chain-stage", dest="toolChainStage",  default="None")
30 30
     parser.add_option("-c",  "--pullsources-config", dest="pullsourcesConfig",  default="pullsources.conf")
31
+    parser.add_option("-d",  "--dist", dest="dist",  default="phTP2")
31 32
 
32 33
     (options,  args) = parser.parse_args()
33 34
     cmdUtils=CommandUtils()
... ...
@@ -5,6 +5,7 @@ class constants(object):
5 5
     sourcePath=""
6 6
     rpmPath=""
7 7
     logPath=""
8
+    dist=""
8 9
     topDirPath=""
9 10
     specData=None
10 11
     buildRootPath="/mnt"
... ...
@@ -48,6 +49,7 @@ class constants(object):
48 48
     
49 49
     @staticmethod
50 50
     def initialize(options):
51
+        constants.dist = options.dist
51 52
         constants.specPath = options.specPath
52 53
         constants.sourcePath = options.sourcePath
53 54
         constants.rpmPath = options.rpmPath
... ...
@@ -21,6 +21,7 @@ BUILDROOT=$1
21 21
 SPEC_PATH=$2
22 22
 RPM_PATH=$3
23 23
 LOG_PATH=$4
24
+DIST=$5
24 25
 PARENT=/usr/src/photon
25 26
 
26 27
 LOGFILE="$(date +%Y-%m-%d).log"
... ...
@@ -58,7 +59,7 @@ if [ -z ${RPMPKG} ] ; then
58 58
 FSSPEC="$(find -L $SPEC_PATH -name 'filesystem.spec' -print)"
59 59
 test -z ${RPMPKG} || fail "Unable to find filesystem.spec file in $SPEC_PATH"
60 60
 #run_command "	Extracting filesystem spec" "cp ${FSSPEC} ${BUILDROOT}/${PARENT}/SPECS" "$LOG_PATH/filesystem.log"
61
-run_command "Building filesystem rpm" "rpmbuild -ba --nocheck --define \"_topdir ${BUILDROOT}/${PARENT}\" --define \"_dbpath ${BUILDROOT}/var/lib/rpm\" ${FSSPEC}" "$LOG_PATH/filesystem.log"
61
+run_command "Building filesystem rpm" "rpmbuild -ba --nocheck --define \"_topdir ${BUILDROOT}/${PARENT}\" --define \"_dbpath ${BUILDROOT}/var/lib/rpm\" --define \"dist ${DIST}\" ${FSSPEC}" "$LOG_PATH/filesystem.log"
62 62
 #run_command "	Building filesystem rpm " "rpmbuild -ba --nocheck --root ${BUILDROOT} --define '_topdir ${PARENT}' --define '_dbpath /var/lib/rpm' ${BUILDROOT}${PARENT}/SPECS/filesystem.spec" "$LOG_PATH/filesystem.log"
63 63
 run_command "	Extracting filesystem rpm" "cp ${BUILDROOT}/${PARENT}/RPMS/x86_64/filesystem*.rpm ${RPM_PATH}/x86_64/" "$LOG_PATH/filesystem.log"
64 64
 fi
... ...
@@ -12,7 +12,7 @@ autogen-5.18.5.tar.gz - cd24a7944d646f6aaea5c7ed13018de38c45b3da
12 12
 automake-1.14.1.tar.xz - 2ced676f6b792a95c5919243f81790b1172c7f5b
13 13
 bash-4.3.tar.gz - 45ac3c5727e7262334f4dfadecdf601b39434e84
14 14
 bc-1.06.95.tar.bz2 - 18717e0543b1dda779a71e6a812f11b8261a705a
15
-bind-9.10.1-P1.tar.gz - 24a81ba458a762c27be47461301fcf336cfb1d43
15
+bind-9.10.1.tar.gz - 93c7c6ac7d621f9dc1eaee9a0221bbaac89f1105
16 16
 binutils-2.25.tar.bz2 - b46cc90ebaba7ffcf6c6d996d60738881b14e50d
17 17
 bison-3.0.2.tar.xz - aeb1e3544007124009e5203afe86a5676580d444
18 18
 blfs-bootscripts-20140919.tar.bz2 - 762b68f79f84463a6b1dabb69e9dbdc2c43f32d8