-
Notifications
You must be signed in to change notification settings - Fork 1
/
droid-hal-prjconf.inc
45 lines (36 loc) · 1.01 KB
/
droid-hal-prjconf.inc
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
38
39
40
41
42
43
44
Name: droid-hal-prjconf-%{device}
Summary: Project configs for %{device} Droid HAL adaptation for OBS
Version: 0
Release: 1
Group: Configs
License: BSD-3-Clause
Source0: %{name}-%{version}.tar.bz2
Provides: project-config
%description
%{summary}.
%prep
%setup -q -n %{name}-%{version}
%install
CONFDIR=prjconf
SUBMODULE=droid-hal-prjconf
SRC_GENERIC=$SUBMODULE/$CONFDIR
SRC_SPECIFIC=$CONFDIR
DESTDIR=$RPM_BUILD_ROOT/%{_datadir}/$CONFDIR
DEST=$DESTDIR/prjconf.xml
rm -rf %{buildroot}
mkdir -p $DESTDIR
if [ grep -q "^Macros:" $SRC_GENERIC/prjconf.xml $SRC_SPECIFIC/prjconf.xml ]; then
echo "prjconf.xml must not contain Macros section. Put them to macros.xml"
exit -1
fi
cp -f $SRC_GENERIC/prjconf.xml $DEST
if [ -e $SRC_SPECIFIC/prjconf.xml ]; then
cat $SRC_SPECIFIC/prjconf.xml >> $DEST
fi
if [ -e $SRC_SPECIFIC/macros.xml ]; then
echo "Macros:" >> $DEST
cat $SRC_SPECIFIC/macros.xml | grep -v "^Macros:" >> $DEST
fi
%files
%defattr(-,root,root,-)
%{_datadir}/prjconf/*.xml