~ubuntu-branches/ubuntu/utopic/libhbalinux/utopic

« back to all changes in this revision

Viewing changes to build.sh

  • Committer: Bazaar Package Importer
  • Author(s): Chuck Short
  • Date: 2010-01-26 09:40:50 UTC
  • Revision ID: james.westby@ubuntu.com-20100126094050-owyzl1xibq4ebblh
Tags: upstream-1.0.8
ImportĀ upstreamĀ versionĀ 1.0.8

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
# This script parses the package name and version out of configure.ac,
 
3
# uses them to assemble the names of the distribution tar.gz and source rpm,
 
4
# then calls make to generate those files.
 
5
# Any arguments will be passed on to configure when building the tarball.
 
6
 
 
7
AC_INIT=`grep AC_INIT configure.ac`
 
8
PACKAGE=`echo ${AC_INIT} | awk 'BEGIN { FS="[][]" }; { print $2 };'`
 
9
VERSION=`echo ${AC_INIT} | awk 'BEGIN { FS="[][]" }; { print $4 };'`
 
10
 
 
11
tgz=${PACKAGE}-${VERSION}.tar.gz
 
12
srpm=${PACKAGE}-${VERSION}-1.src.rpm
 
13
 
 
14
rm -f ${tgz} ${srpm}
 
15
 
 
16
make -f - <<EOF
 
17
.PHONY = all
 
18
all: ${tgz} ${srpm}
 
19
 
 
20
configure: configure.ac Makefile.am
 
21
        autoreconf --install -s
 
22
 
 
23
${tgz}: configure
 
24
        ./configure ${@}
 
25
        make dist
 
26
 
 
27
${srpm}: ${tgz} ${PACKAGE}.spec
 
28
        rpmbuild --eval "%undefine dist"        \
 
29
                --define "_sourcedir ${PWD}"    \
 
30
                --define "_specdir ${PWD}"      \
 
31
                --define "_srcrpmdir ${PWD}"    \
 
32
                -bs ${PACKAGE}.spec
 
33
EOF
 
34