summaryrefslogtreecommitdiffstats
path: root/lib/ext2fs/tdb/build-tdb
blob: 1cc18f7e8f383b38c84a6c35256b490062a6e0f5 (plain)
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 file creates a stand-alone TDB based on a set of sources from 
# Samba

#BASE_DIR=/usr/projects/samba/samba-4.0.0tp4/source/lib/tdb
BASE_DIR=/usr/projects/samba/tdb

rm -rf .pc

FILES="error.c lock.c io.c transaction.c freelist.c \
	freelistcheck.c traverse.c dump.c tdb.c open.c"

(cd $BASE_DIR/common; svn info ) > .svninfo
echo "/*" > tdb.c
grep ^URL .svninfo >> tdb.c
grep "^Last Changed Rev" .svninfo | sed -e 's/Last Changed //' >> tdb.c
grep "^Last Changed Date" .svninfo >> tdb.c
echo "*/" >> tdb.c

cat $BASE_DIR/common/tdb_private.h >> tdb.c
for i in $FILES; do
	if [ `tail -n 1 tdb.c | wc -c` -gt 1 ]; then
		printf "\n" >> tdb.c
	fi
	echo "/* file: $i */" >> tdb.c
	sed -e '1,/#include "tdb_private.h"/d' < $BASE_DIR/common/$i >> tdb.c
done

cp $BASE_DIR/include/tdb.h .
cp $BASE_DIR/tools/tdbtool.c .

quilt push -a