File: build.sh

package info (click to toggle)
fcoe-utils 1.0.31+git20160622.5dfd3e4-5
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 1,060 kB
  • sloc: ansic: 11,919; sh: 1,298; makefile: 81
file content (34 lines) | stat: -rwxr-xr-x 897 bytes parent folder | download | duplicates (6)
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/sh
# This script parses the package name and version out of configure.ac,
# uses them to assemble the names of the distribution tar.gz and source rpm,
# then calls make to generate those files.
# Any arguments will be passed on to configure when building the tarball.

AC_INIT=`grep AC_INIT configure.ac`
PACKAGE=`echo ${AC_INIT} | awk 'BEGIN { FS="[][]" }; { print $2 };'`
VERSION=`echo ${AC_INIT} | awk 'BEGIN { FS="[][]" }; { print $4 };'`

tgz=${PACKAGE}-${VERSION}.tar.gz
srpm=${PACKAGE}-${VERSION}-1.src.rpm

rm -f ${tgz} ${srpm}

make -f - <<EOF
.PHONY = all
all: ${tgz} ${srpm}

configure: configure.ac Makefile.am
	autoreconf --install -s

${tgz}: configure
	./configure ${@}
	make dist

${srpm}: ${tgz} ${PACKAGE}.spec
	rpmbuild --eval "%undefine dist"	\
		--define "_sourcedir ${PWD}"	\
		--define "_specdir ${PWD}" 	\
		--define "_srcrpmdir ${PWD}"	\
		-bs ${PACKAGE}.spec
EOF