make the xserver package even smaller
[openwrt/svn-archive/archive.git] / XOrg / generate.sh
1 #!/bin/sh
2 for d in `find . -name packages`; do
3 cd `dirname $d`
4 echo "Entering "`dirname $d`
5 for p in `cat packages`; do
6 _NAME=${p%%|*}
7 NAME=${_NAME%-*}
8 BASE_NAME=${NAME%%-*}
9 _VER=${_NAME##*-}
10 VER=${_VER%%|*}
11 DEP=`echo ${p##*|} | sed "s/+/ +/g"`
12 echo generating Makefile for ${NAME}-${VER} with deps : ${DEP}
13 rm -rf ${NAME}
14 mkdir ${NAME}
15 sed "s/@VER@/${VER}/g" template.mk | sed "s/@DEP@/${DEP}/g" | sed "s/@NAME@/${NAME}/g" | sed "s/@BASE_NAME@/${BASE_NAME}/g" > ${NAME}/Makefile
16 if [ -d `pwd`/patches/${NAME} ]; then
17 mkdir ${NAME}/patches
18 cp -r `pwd`/patches/${NAME}/* ${NAME}/patches/
19 fi
20 done
21 cd - > /dev/null
22 done