4 pkgdesc="speed2fritz is a script collection for flashing Speedport-routers with a custom firmware"
5 url="http://www.ip-phone-forum.de/showthread.php?t=172137"
8 depends=('kdiff3' 'lynx' 'inetutils' 'wget')
9 makedepends=('svn' 'ncurses' 'automake')
12 svn co https://freetzlinux.svn.sourceforge.net/svnroot/freetzlinux/trunk/speed-to-fritz speed-to-fritz
13 cd $srcdir/speed-to-fritz
14 export K_ONLY=1 # if set to 1 only build kconfig if set to 0 all tools are rebult first
17 ! [ -f ./incl_var ] && touch ./incl_var
18 ! grep -q 'REUSECONF="y"' ./incl_var && [ -f "./Firmware.conf" ] && rm -fr ./Firmware.conf &&\
19 echo "You are starting with clean configuration, all settings made last time are removed!" &&\
22 if ! [ -f "./Firmware.conf" ]; then
23 echo "#!/bin/bash" > ./Firmware.conf
24 echo "# Automatically generated make config: don't edit" >> ./Firmware.conf
25 chmod 755 "./Firmware.conf"
27 cat << 'EOF' > "./incl_var"
32 export HWRevision="101.1.1.0"
34 export IPADDRESS="192.168.178.1"
35 export CONFIG_jffs2_size="32"
38 export SKRIPT_DATE="00 --- ATTENTION, you are starting the setuptool for the first time! ---"
39 export AVM_VERSION="04.57"
40 export TCOM_VERSION="04.56"
42 export CLASS="Speedport"
43 export TCOM_SUBVERSION="0"
44 export AVM_SUBVERSION="0"
45 export firmwareconf_file_name="Firmware.conf"
47 chmod 755 "./incl_var"
49 export HOMEDIR="`pwd`"
50 # exract packed ./conf directory
51 ! [ -d "./conf" ] && [ -e "./conf.tar" ] && tar xf ./conf.tar -C . ./conf && echo "-- ./conf.tar extracted"
52 # add ready made configs to menu
54 #set last used revision in Config.in
55 SVN_REV="$(svnversion . )" && let "SVN_REV=$(echo ${SVN_REV##*:} | tr -d '[:alpha:]')" && sed -i -e "s|default \"....\" # dont edit this line|default \"$SVN_REV\" # dont edit this line|" ./Config.in
56 cp Makefile Makefile.bak
57 sed -i '/all:/d' Makefile
59 mv Makefile.bak Makefile
62 mkdir -p $pkgdir/opt/speed2fritz
63 mkdir -p $pkgdir/usr/bin
64 cp -r $srcdir/speed-to-fritz/* $pkgdir/opt/speed2fritz
65 echo -e '#!/bin/bash\ncd /opt/speed2fritz\n#!/bin/bash\nif [[ $EUID -ne 0 ]]; then\necho "This script must be run as root" 1>&2\nexit 1\nfi\n./start' > $pkgdir/usr/bin/speed2fritz
66 chmod a+x $pkgdir/usr/bin/speed2fritz