packages: Use $(CP) instead of $(INSTALL_BIN) for binaries.
[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%-X11*}
8 BASE_NAME=${NAME%%-*}
9 _VER=${_NAME##*-X}
10 VER=X${_VER%%|*}
11 DEP=`echo ${p##*|} | sed "s/+/ +/g"`
12 echo generating Makefile for ${NAME}-${VER} with deps : ${DEP}
13 rm -rf ${NAME}
14 if [ "$1" == "gen" ]; then
15 mkdir ${NAME}
16 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
17 if [ -d `pwd`/patches/${NAME} ]; then
18 mkdir ${NAME}/patches
19 cp -r `pwd`/patches/${NAME}/* ${NAME}/patches/
20 fi
21 fi
22 done
23 cd - > /dev/null
24 done