Skip to content

Commit 65c2911

Browse files
author
GONG Jie
committed
Make all the rpm packages have the exactly same version and release numbers
1 parent 72ae599 commit 65c2911

File tree

22 files changed

+145
-189
lines changed

22 files changed

+145
-189
lines changed

Release

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
snap000000000000

buildcore.sh

Lines changed: 60 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
# - On AIX: Install openssl and openssh installp pkgs and run updtvpkg. Install from http://www.perzl.org/aix/ :
99
# apr, apr-util, bash, bzip2, db4, expat, gdbm, gettext, glib2, gmp, info, libidn, neon, openssl (won't
1010
# conflict with the installp version - but i don't think you need this), pcre, perl-DBD-SQLite, perl-DBI,
11-
# popt, python, readline, rsynce, sqlite, subversion, unixODBC, zlib.
11+
# popt, python, readline, rsynce, sqlite, subversion, unixODBC, zlib.
1212
# Install wget from http://www-03.ibm.com/systems/power/software/aix/linux/toolbox/alpha.html
1313
# - Run this script from the xcat-core directory. It will create the other directories that are needed.
1414
#
@@ -24,7 +24,7 @@
2424
# (but the tarball file name will be like a released tarball, not a snap build). When you are ready to
2525
# release this build, use PROMOTE=1 without PREGA
2626
# BUILDALL=1 - build all rpms, whether they changed or not. Should be used for snap builds that are in prep for a release.
27-
# UP=0 or UP=1 - override the default upload behavior
27+
# UP=0 or UP=1 - override the default upload behavior
2828
# GITUP=<filename> - control which rpms get built by specifying a coregitup file
2929
# EMBED=<embedded-environment> - the environment for which a minimal version of xcat should be built, e.g. zvm or flex
3030
# VERBOSE=1 - to see lots of verbose output
@@ -39,10 +39,10 @@ UPLOADUSER=litingt
3939
USER=xcat
4040
SERVER=xcat.org
4141
FILES_PATH="files"
42-
FRS=/var/www/${SERVER}/${FILES_PATH}
42+
FRS="/var/www/${SERVER}/${FILES_PATH}"
4343
RELEASE=github.com/xcat2/xcat-core/releases
4444

45-
YUMDIR=$FRS
45+
YUMDIR="${FRS}"
4646
YUMREPOURL="http://${SERVER}/${FILES_PATH}/xcat/repos/yum"
4747

4848
if [ "$1" = "-h" ] || [ "$1" = "-help" ] || [ "$1" = "--help" ]; then
@@ -71,8 +71,8 @@ ALLBUILD="perl-xCAT xCAT-client xCAT-server xCAT-test xCAT-buildkit xCAT xCATsn
7171
ZVMBUILD="perl-xCAT xCAT-server xCAT-UI"
7272
ZVMLINK="xCAT-client xCAT xCATsn"
7373
# xCAT and xCATsn have PCM specific configuration - conserver-xcat, syslinux-xcat
74-
# xCAT-server has PCM specific configuration - RESTAPI(perl-JSON)
75-
# xCAT-client has PCM specific configuration - getxcatdocs(perl-JSON)
74+
# xCAT-server has PCM specific configuration - RESTAPI(perl-JSON)
75+
# xCAT-client has PCM specific configuration - getxcatdocs(perl-JSON)
7676
PCMBUILD="xCAT xCAT-server xCAT-client xCATsn"
7777
PCMLINK="perl-xCAT xCAT-buildkit xCAT-genesis-scripts-x86_64 xCAT-genesis-scripts-ppc64 xCAT-vlan xCAT-probe"
7878
# Note: for FSM, the FlexCAT rpm is built separately from gsa/git
@@ -103,7 +103,7 @@ OSNAME=$(uname)
103103

104104
if [ "$OSNAME" != "AIX" ]; then
105105
GSA=http://pokgsa.ibm.com/projects/x/xcat/build/linux
106-
106+
107107
if [ "$(id -u)" == "0" ]; then
108108
# Get a lock, so can not do 2 builds at once
109109
exec 8>/var/lock/xcatbld-$REL.lock
@@ -186,10 +186,11 @@ function setversionvars {
186186
BUILD_TIME=`date`
187187
BUILD_MACHINE=`hostname`
188188
COMMIT_ID=`git rev-parse --short HEAD`
189+
XCAT_RELEASE="snap$(date '+%Y%m%d%H%M')"
190+
echo "$XCAT_RELEASE" >Release
189191
}
190192

191-
192-
if [ "$PROMOTE" != 1 ]; then # very long if statement to not do builds if we are promoting
193+
if [ "$PROMOTE" != 1 ]; then # very long if statement to not do builds if we are promoting ### @LINE460 ###
193194
# we are doing a snap build
194195
CORE="core-snap"
195196
if [ "$OSNAME" = "AIX" ]; then
@@ -217,14 +218,14 @@ else
217218
#echo "source=$source"
218219
fi
219220

220-
#
221-
# If no pre-defined update file is provided, do a "git pull" to try and detect
221+
#
222+
# If no pre-defined update file is provided, do a "git pull" to try and detect
222223
# if anything has changed in the source directories
223-
#
224+
#
224225
SOMETHINGCHANGED=0
225226
if [ "$GIT" = "1" ]; then
226-
#
227-
# To enable local sandbox build, GITPULL is disabled by default.
227+
#
228+
# To enable local sandbox build, GITPULL is disabled by default.
228229
#
229230
if [ "$GITPULL" = "1" ] || [ ${PWD} == *"autobuild"* ]; then
230231
# TODO: This is really not necessary since the autobuild scripts
@@ -339,7 +340,7 @@ if [ "$OSNAME" != "AIX" ]; then
339340
fi
340341

341342
# Build the xCAT and xCATsn rpms for all platforms
342-
for rpmname in xCAT xCATsn; do
343+
for rpmname in xCAT xCATsn; do
343344
if [[ " $EMBEDBUILD " != *\ $rpmname\ * ]]; then continue; fi
344345
if [ $SOMETHINGCHANGED == 1 -o "$BUILDALL" == 1 ]; then # used to be: if $GREP -E "^[UAD] +$rpmname/" $GITUP; then
345346
UPLOAD=1
@@ -402,48 +403,49 @@ fi
402403

403404
# Prepare the RPMs for pkging and upload
404405
WGET_CMD="wget"
405-
if [ ! -z ${LOG} ]; then
406+
if [ ! -z ${LOG} ]; then
406407
WGET_CMD="wget -o ${LOG}"
407408
fi
408409

409410
# get gpg keys in place
410411
if [ "$OSNAME" != "AIX" ]; then
411412
if [ -z "$RPMSIGN" -o "$RPMSIGN" == "1" ]; then
412-
mkdir -p $HOME/.gnupg
413-
for i in pubring.gpg secring.gpg trustdb.gpg; do
414-
if [ ! -f $HOME/.gnupg/$i ] || [ `wc -c $HOME/.gnupg/$i|cut -f 1 -d' '` == 0 ]; then
415-
rm -f $HOME/.gnupg/$i
416-
${WGET_CMD} -P $HOME/.gnupg $GSA/keys/$i
417-
chmod 600 $HOME/.gnupg/$i
413+
mkdir -p $HOME/.gnupg
414+
for i in pubring.gpg secring.gpg trustdb.gpg; do
415+
if [ ! -f $HOME/.gnupg/$i ] ||
416+
[ `wc -c $HOME/.gnupg/$i|cut -f 1 -d' '` == 0 ]; then
417+
rm -f $HOME/.gnupg/$i
418+
${WGET_CMD} -P $HOME/.gnupg $GSA/keys/$i
419+
chmod 600 $HOME/.gnupg/$i
420+
fi
421+
done
422+
# tell rpm to use gpg to sign
423+
MACROS=$HOME/.rpmmacros
424+
if ! $GREP '%_signature gpg' $MACROS 2>/dev/null; then
425+
echo '%_signature gpg' >> $MACROS
418426
fi
419-
done
420-
# tell rpm to use gpg to sign
421-
MACROS=$HOME/.rpmmacros
422-
if ! $GREP '%_signature gpg' $MACROS 2>/dev/null; then
423-
echo '%_signature gpg' >> $MACROS
424-
fi
425-
if ! $GREP '%_gpg_name' $MACROS 2>/dev/null; then
426-
echo '%_gpg_name xCAT Security Key' >> $MACROS
427-
fi
428-
echo "Signing RPMs..."
429-
build-utils/rpmsign.exp `find $DESTDIR -type f -name '*.rpm'` | grep -v -E '(already contains identical signature|was already signed|rpm --quiet --resign|WARNING: standard input reopened)'
430-
build-utils/rpmsign.exp $SRCDIR/*rpm | grep -v -E '(already contains identical signature|was already signed|rpm --quiet --resign|WARNING: standard input reopened)'
431-
createrepo --checksum sha $DESTDIR # specifying checksum so the repo will work on rhel5
432-
createrepo --checksum sha $SRCDIR
433-
rm -f $SRCDIR/repodata/repomd.xml.asc
434-
rm -f $DESTDIR/repodata/repomd.xml.asc
435-
gpg -a --detach-sign $DESTDIR/repodata/repomd.xml
436-
gpg -a --detach-sign $SRCDIR/repodata/repomd.xml
437-
if [ ! -f $DESTDIR/repodata/repomd.xml.key ]; then
438-
${WGET_CMD} -q -P $DESTDIR/repodata $GSA/keys/repomd.xml.key
439-
fi
440-
if [ ! -f $SRCDIR/repodata/repomd.xml.key ]; then
441-
${WGET_CMD} -P $SRCDIR/repodata $GSA/keys/repomd.xml.key
427+
if ! $GREP '%_gpg_name' $MACROS 2>/dev/null; then
428+
echo '%_gpg_name xCAT Security Key' >> $MACROS
429+
fi
430+
echo "Signing RPMs..."
431+
build-utils/rpmsign.exp `find $DESTDIR -type f -name '*.rpm'` | grep -v -E '(already contains identical signature|was already signed|rpm --quiet --resign|WARNING: standard input reopened)'
432+
build-utils/rpmsign.exp $SRCDIR/*rpm | grep -v -E '(already contains identical signature|was already signed|rpm --quiet --resign|WARNING: standard input reopened)'
433+
createrepo --checksum sha $DESTDIR # specifying checksum so the repo will work on rhel5
434+
createrepo --checksum sha $SRCDIR
435+
rm -f $SRCDIR/repodata/repomd.xml.asc
436+
rm -f $DESTDIR/repodata/repomd.xml.asc
437+
gpg -a --detach-sign $DESTDIR/repodata/repomd.xml
438+
gpg -a --detach-sign $SRCDIR/repodata/repomd.xml
439+
if [ ! -f $DESTDIR/repodata/repomd.xml.key ]; then
440+
${WGET_CMD} -q -P $DESTDIR/repodata $GSA/keys/repomd.xml.key
441+
fi
442+
if [ ! -f $SRCDIR/repodata/repomd.xml.key ]; then
443+
${WGET_CMD} -P $SRCDIR/repodata $GSA/keys/repomd.xml.key
444+
fi
445+
else
446+
createrepo --checksum sha $DESTDIR
447+
createrepo --checksum sha $SRCDIR
442448
fi
443-
else
444-
createrepo --checksum sha $DESTDIR
445-
createrepo --checksum sha $SRCDIR
446-
fi
447449
fi
448450

449451
# set group and permissions correctly on the built rpms
@@ -455,7 +457,7 @@ chmod -R g+w $DESTDIR
455457
chgrp -R $SYSGRP $SRCDIR
456458
chmod -R g+w $SRCDIR
457459

458-
else # end of very long if-not-promote
460+
else # end of very long if-not-promote ### @LINE193 ###
459461
# we are only promoting (not building)
460462
setversionvars
461463
setbranch
@@ -490,18 +492,18 @@ EOF
490492
#!/bin/sh
491493
cd `dirname $0`
492494
REPOFILE=`basename xCAT-*.repo`
493-
if [[ $REPOFILE == "xCAT-*.repo" ]]; then
495+
if [ $REPOFILE = "xCAT-*.repo" ]; then
494496
echo "ERROR: For xcat-dep, please execute $0 in the correct <os>/<arch> subdirectory"
495497
exit 1
496498
fi
497499
#
498500
# default to RHEL yum, if doesn't exist try Zypper
499501
#
500502
DIRECTORY="/etc/yum.repos.d"
501-
if [[ ! -d ${DIRECTORY} ]]; then
502-
DIRECTORY="/etc/zypp/repos.d"
503+
if [ ! -d "$DIRECTORY" ]; then
504+
DIRECTORY="/etc/zypp/repos.d"
503505
fi
504-
sed -e 's|baseurl=.*|baseurl=file://'"`pwd`"'|' $REPOFILE | sed -e 's|gpgkey=.*|gpgkey=file://'"`pwd`"'/repodata/repomd.xml.key|' > ${DIRECTORY}/$REPOFILE
506+
sed -e 's|baseurl=.*|baseurl=file://'"`pwd`"'|' $REPOFILE | sed -e 's|gpgkey=.*|gpgkey=file://'"`pwd`"'/repodata/repomd.xml.key|' > "$DIRECTORY/$REPOFILE"
505507
cd -
506508
EOF2
507509
chmod 775 mklocalrepo.sh
@@ -521,6 +523,7 @@ fi
521523
#
522524
BUILDINFO=$XCATCORE/buildinfo
523525
echo "VERSION=$VER" > $BUILDINFO
526+
echo "RELEASE=$XCAT_RELEASE" >> $BUILDINFO
524527
echo "BUILD_TIME=$BUILD_TIME" >> $BUILDINFO
525528
echo "BUILD_MACHINE=$BUILD_MACHINE" >> $BUILDINFO
526529
echo "COMMIT_ID=$COMMIT_ID" >> $BUILDINFO
@@ -545,7 +548,7 @@ if [ -n "$UP" ] && [ "$UP" == 0 ]; then
545548
fi
546549
#else we will continue
547550

548-
# Upload the individual RPMs to xcat.org
551+
# Upload the individual RPMs to xcat.org
549552
if [ "$OSNAME" = "AIX" ]; then
550553
YUM=aix
551554
else
@@ -561,13 +564,13 @@ if [ "$REL" = "devel" -o "$PREGA" != 1 ]; then
561564
do : ; done
562565
fi
563566

564-
# Upload the individual source RPMs to xcat.org
567+
# Upload the individual source RPMs to xcat.org
565568
i=0
566569
echo "Uploading src RPMs from $SRCD to $YUMDIR/$YUM/$REL$EMBEDDIR/ ..."
567570
while [ $((i+=1)) -le 5 ] && ! rsync -urLv --delete $SRCD $USER@$SERVER:$YUMDIR/$YUM/$REL$EMBEDDIR/
568571
do : ; done
569572

570-
# Upload the tarball to xcat.org
573+
# Upload the tarball to xcat.org
571574
if [ "$PROMOTE" = 1 -a "$REL" != "devel" -a "$PREGA" != 1 ]; then
572575
# upload tarball to FRS area
573576
i=0

perl-xCAT/perl-xCAT.spec

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Summary: xCAT perl libraries
22
Name: perl-xCAT
33
Version: %{?version:%{version}}%{!?version:%(cat Version)}
4-
Release: %{?release:%{release}}%{!?release:snap%(date +"%Y%m%d%H%M")}
4+
Release: %{?release:%{release}}%{!?release:%(cat Release)}
55
Epoch: 4
66
License: EPL
77
Group: System Environment/Libraries
@@ -17,8 +17,6 @@ BuildArch: noarch
1717
#Requires: perl-SOAP-Lite
1818
%endif
1919

20-
Provides: perl-xCAT = %{epoch}:%{version}
21-
2220
%description
2321
Provides perl xCAT libraries for core functionality. Required for all xCAT installations.
2422
Includes xCAT::Table, xCAT::NodeRange, among others.

xCAT-IBMhpc/xCAT-IBMhpc.spec

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Summary: Install and configuration utilities for IBM HPC products in an xCAT cluster
22
Name: xCAT-IBMhpc
33
Version: %{?version:%{version}}%{!?version:%(cat Version)}
4-
Release: %{?release:%{release}}%{!?release:snap%(date +"%Y%m%d%H%M")}
4+
Release: %{?release:%{release}}%{!?release:%(cat Release)}
55
Epoch: 4
66
License: EPL
77
Group: Applications/System
@@ -20,7 +20,7 @@ AutoReqProv: no
2020
# also need to fix Requires for AIX
2121
%ifos linux
2222
BuildArch: noarch
23-
#Requires:
23+
#Requires:
2424
%endif
2525

2626
Requires: perl-xCAT >= %{epoch}:%{version}
@@ -85,7 +85,3 @@ fi
8585
%post
8686

8787
%preun
88-
89-
90-
91-

xCAT-OpenStack-baremetal/xCAT-OpenStack-baremetal.spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Summary: Executables and data of the xCAT baremetal driver for OpenStack
22
Name: xCAT-OpenStack-baremetal
33
Version: %{?version:%{version}}%{!?version:%(cat Version)}
4-
Release: %{?release:%{release}}%{!?release:snap%(date +"%Y%m%d%H%M")}
4+
Release: %{?release:%{release}}%{!?release:%(cat Release)}
55
Epoch: 4
66
License: IBM
77
Group: Applications/System

xCAT-OpenStack/xCAT-OpenStack.spec

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
Summary: Meta-Metapackage for a common, default xCAT management node setup with OpenStack
1+
Summary: Meta-Metapackage for a common, default xCAT management node setup with OpenStack
22
Name: xCAT-OpenStack
33
Version: %{?version:%{version}}%{!?version:%(cat Version)}
4-
Release: %{?release:%{release}}%{!?release:snap%(date +"%Y%m%d%H%M")}
4+
Release: %{?release:%{release}}%{!?release:%(cat Release)}
55
License: EPL
66
Group: Applications/System
77
Vendor: IBM Corp.
@@ -16,8 +16,8 @@ Provides: xCAT-OpenStack = %{version}
1616
Requires: xCAT
1717

1818
%description
19-
xCAT-OpenStack is an xCAT management node package intended for at-scale
20-
management with OpenStack, including hardware management and software
19+
xCAT-OpenStack is an xCAT management node package intended for at-scale
20+
management with OpenStack, including hardware management and software
2121
management.
2222

2323
%prep
@@ -28,7 +28,6 @@ management.
2828
# Then convert the pods to man pages and html pages.
2929
./db2man
3030

31-
3231
%install
3332
mkdir -p $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_schema
3433
mkdir -p $RPM_BUILD_ROOT/%{prefix}/lib/perl/xCAT_plugin
@@ -89,9 +88,8 @@ rm -rf $RPM_BUILD_ROOT
8988
%ifos linux
9089
if [ -f "/proc/cmdline" ]; then # prevent running it during install into chroot image
9190
if [ -f $RPM_INSTALL_PREFIX0/sbin/xcatd ]; then
92-
/etc/init.d/xcatd restart
91+
/etc/init.d/xcatd restart
9392
fi
9493
fi
9594
%endif
9695
exit 0
97-

xCAT-SoftLayer/xCAT-SoftLayer.spec

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Summary: Utilities to make xCAT work in a SoftLayer environment
22
Name: xCAT-SoftLayer
33
Version: %{?version:%{version}}%{!?version:%(cat Version)}
4-
Release: %{?release:%{release}}%{!?release:snap%(date +"%Y%m%d%H%M")}
4+
Release: %{?release:%{release}}%{!?release:%(cat Release)}
55
Epoch: 4
66
License: EPL
77
Group: Applications/System

xCAT-UI/xCAT-UI.spec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
Summary: Web Client for xCAT 2
22
Name: xCAT-UI
33
Version: %{?version:%{version}}%{!?version:%(cat Version)}
4-
Release: %{?release:%{release}}%{!?release:snap%(date +"%Y%m%d%H%M")}
4+
Release: %{?release:%{release}}%{!?release:%(cat Release)}
55
License: EPL
66
Group: Applications/System
7-
URL: http://xcat.org
7+
URL: https://xcat.org/
88
Packager: IBM
9-
Vendor: IBM
9+
Vendor: IBM Corp.
1010

1111
Source: xCAT-UI-%{version}.tar.gz
1212
BuildRoot: /var/tmp/%{name}-%{version}-%{release}-root

0 commit comments

Comments
 (0)