File: make-srpm.sh

package info (click to toggle)
certmonger 0.75.14-3
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 8,540 kB
  • ctags: 2,176
  • sloc: ansic: 41,340; sh: 9,551; makefile: 528; python: 207; xml: 190; sed: 16
file content (37 lines) | stat: -rw-r--r-- 1,107 bytes parent folder | download | duplicates (4)
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
35
36
37
#!/bin/bash
#
# Set $FORCE_VERSION to force the version.
# Set $FORCE_RELEASE to force the release.
#
tmpdir=`mktemp -d`
if test -z "$tmpdir" ; then
	echo Need mktemp.
	exit 1
fi
trap 'rm -fr "$tmpdir"' EXIT

CHECKOUTDIR=$PWD
pushd "$tmpdir" > /dev/null
git clone -q "$CHECKOUTDIR" cm
cd cm
qs() {
	rpm -q --define 'debug_package 0' --specfile "$tmpdir"/cm/certmonger.spec "$@"
}
VERSION=${FORCE_VERSION:-`qs --qf '%{version}'`}
RELEASE=${FORCE_RELEASE:-`qs --qf '%{release}'`}
sed -e "s|^Version:.*|Version: $VERSION|g" \
    -e "s|^Release:.*|Release: $RELEASE|g" \
	"$tmpdir"/cm/certmonger.spec > "$tmpdir"/certmonger.spec
autoreconf -i -f && \
configure_dist_target_only=true \
./configure --disable-maintainer-mode --disable-systemd --disable-sysvinit \
	--without-idn --without-openssl --without-gmp \
	--disable-ec --disable-dsa \
	"$@" && \
make dist VERSION="$VERSION" PACKAGE_VERSION="$VERSION" && \
rpmbuild --define "_topdir $tmpdir"/cm \
	 --define "_srcrpmdir $tmpdir"/cm \
	 --define "_sourcedir $tmpdir"/cm \
	-bs "$tmpdir"/certmonger.spec && \
cp -v *.src.rpm $CHECKOUTDIR
popd > /dev/null