File: rpmbuild.sh

package info (click to toggle)
ipmctl 02.00.00.3852%2Bds-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 54,512 kB
  • sloc: ansic: 618,625; asm: 12,841; cpp: 110; python: 81; sh: 49; makefile: 22
file content (34 lines) | stat: -rwxr-xr-x 1,078 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash

if [ "$#" -le 0 ]; then
	echo "./rpmbuild.sh xx.xx.xx.xxxx purley | whitley"
	exit 3
fi

BUILDNUM=$1
SOURCEDIR=$PWD

# remove all rpmbuild
rm -rf $SOURCEDIR/output/rpmbuild

# Make directories
mkdir -p $SOURCEDIR/output/rpmbuild
mkdir -p $SOURCEDIR/output/rpmbuild/BUILDROOT
mkdir -p $SOURCEDIR/output/rpmbuild/SOURCES
mkdir -p $SOURCEDIR/output/rpmbuild/RPMS
mkdir -p $SOURCEDIR/output/rpmbuild/SRPMS
mkdir -p $SOURCEDIR/output/rpmbuild/SPECS
mkdir -p $SOURCEDIR/output/rpmbuild/ipmctl-$BUILDNUM

# Copy spec file
cp install/linux/rel-release/ipmctl.spec.in $SOURCEDIR/output/rpmbuild/SPECS/ipmctl.spec


# Update the spec file with build version
sed -i "s/^%define build_version .*/%define build_version $BUILDNUM/g" $SOURCEDIR/output/rpmbuild/SPECS/ipmctl.spec

# Archive the directory
tar --exclude-vcs --exclude="*output" --exclude="*.swp*" --transform="s,^.,ipmctl-$BUILDNUM," -zcf $SOURCEDIR/output/rpmbuild/SOURCES/ipmctl-$BUILDNUM.tar.gz .

# rpmbuild
rpmbuild -ba $SOURCEDIR/output/rpmbuild/SPECS/ipmctl.spec --define "_topdir $SOURCEDIR/output/rpmbuild"