1c72fcc34Sopenharmony_ci#!/bin/bash
2c72fcc34Sopenharmony_ci
3c72fcc34Sopenharmony_cisource=.
4c72fcc34Sopenharmony_civersion=`cat $source/../version`
5c72fcc34Sopenharmony_cipackage=$source/../alsa-utils-$version.tar.bz2
6c72fcc34Sopenharmony_cipackagedir=/usr/src/redhat
7c72fcc34Sopenharmony_cixrpmbuild=rpm
8c72fcc34Sopenharmony_cirpmbuild --usage 2> /dev/null > /dev/null && xrpmbuild=rpmbuild
9c72fcc34Sopenharmony_ci
10c72fcc34Sopenharmony_ci# SuSE path
11c72fcc34Sopenharmony_ciif [ -d /usr/src/packages ]; then
12c72fcc34Sopenharmony_ci  packagedir=/usr/src/packages
13c72fcc34Sopenharmony_cifi
14c72fcc34Sopenharmony_ci
15c72fcc34Sopenharmony_cimake -C .. clean
16c72fcc34Sopenharmony_cimake -C .. dist
17c72fcc34Sopenharmony_ci
18c72fcc34Sopenharmony_ciif [ ! -r $package ]; then
19c72fcc34Sopenharmony_ci  echo "Error: wrong package: $package"
20c72fcc34Sopenharmony_ci  exit 1
21c72fcc34Sopenharmony_cifi
22c72fcc34Sopenharmony_ci
23c72fcc34Sopenharmony_cicp -fv $package ${packagedir}/SOURCES
24c72fcc34Sopenharmony_ci
25c72fcc34Sopenharmony_ciif [ ! -r $source/buildrpm ]; then
26c72fcc34Sopenharmony_ci  echo "Error: invalid directory: $source"
27c72fcc34Sopenharmony_ci  exit 1
28c72fcc34Sopenharmony_cifi
29c72fcc34Sopenharmony_ci
30c72fcc34Sopenharmony_ciif [ ! -d ${packagedir} ]; then
31c72fcc34Sopenharmony_ci  echo "Error: ${packagedir} directory not found"
32c72fcc34Sopenharmony_ci  exit 1
33c72fcc34Sopenharmony_cifi
34c72fcc34Sopenharmony_ci
35c72fcc34Sopenharmony_ciif [ ! -r $source/alsadriver.spec ]; then
36c72fcc34Sopenharmony_ci  cd $source/..
37c72fcc34Sopenharmony_ci  ./configure
38c72fcc34Sopenharmony_ci  cd utils
39c72fcc34Sopenharmony_cifi
40c72fcc34Sopenharmony_ci
41c72fcc34Sopenharmony_cicp -fv $source/alsa-utils.spec ${packagedir}/SPECS
42c72fcc34Sopenharmony_cicd ${packagedir}/SPECS
43c72fcc34Sopenharmony_ci$xrpmbuild -ba alsa-utils.spec
44c72fcc34Sopenharmony_cicd ${packagedir}
45