--- admin/PlamoBuild.template.common.without_comment 2016-06-15 20:51:13.000000000 +0900 +++ plamo/01_minimum/network.txz/old/wpa_supplicant-20160929/PlamoBuild.wpa_supplicant-2.0 2016-09-29 14:41:35.000000000 +0900 @@ -1,15 +1,18 @@ #!/bin/sh ###################################################################### -url="" -pkgbase= -vers= +url="http://hostap.epitest.fi/releases/wpa_supplicant-2.0.tar.gz" +pkgbase=wpa_supplicant +vers=2.0 arch=`uname -m` -build=P1 +build=P2 src=$pkgbase-$vers patchfiles="" OPT_CONFIG="" -DOCS="README" +DOCS="README + `echo wpa_supplicant/{README-HS20,eap_testing.txt,todo.txt,ChangeLog}` + `echo wpa_supplicant/README{-P2P,,-WPS,-Windows.txt}` + COPYING" ###################################################################### fscheck() { @@ -233,8 +236,45 @@ esac done done + cd $B + cp -p wpa_supplicant/Makefile{,.orig} + sed '/^export/s@/local\(.*\)/$@\1@g' wpa_supplicant/Makefile.orig \ + > wpa_supplicant/Makefile + cp -p wpa_supplicant/{defconfig,.config} + cat <<- "EOF" | patch wpa_supplicant/.config + 10a11 + > CFLAGS += -I/usr/include/libnl3 + 199c200 + < #CONFIG_WPS=y + --- + > CONFIG_WPS=y + 245c246 + < #CONFIG_READLINE=y + --- + > CONFIG_READLINE=y + 376c377 + < #CONFIG_CTRL_IFACE_DBUS=y + --- + > CONFIG_CTRL_IFACE_DBUS=y + 380c381 + < #CONFIG_CTRL_IFACE_DBUS_NEW=y + --- + > CONFIG_CTRL_IFACE_DBUS_NEW=y + 383c384 + < #CONFIG_CTRL_IFACE_DBUS_INTRO=y + --- + > CONFIG_CTRL_IFACE_DBUS_INTRO=y + 410c411 + < #CONFIG_DEBUG_FILE=y + --- + > CONFIG_DEBUG_FILE=y + 523a525,527 + > + > CONFIG_IPV6=y + > CONFIG_LIBNL32=y + EOF for i in `seq 0 $((${#B[@]} - 1))` ; do - cd ${B[$i]} + cd ${B[$i]}/wpa_supplicant if [ -f Makefile ] ; then make clean fi @@ -250,11 +290,12 @@ fi if [ $opt_build -eq 1 ] ; then for i in `seq 0 $((${#B[@]} - 1))` ; do - cd ${B[$i]} + cd ${B[$i]}/wpa_supplicant if [ -f Makefile ] ; then make fi done + ( cd wpa_gui-qt4 ; qmake ; make ) fi if [ $opt_package -eq 1 ] ; then if [ `id -u` -ne 0 ] ; then @@ -267,11 +308,89 @@ if [ -d $C ] ; then rm -rf $C ; fi ; mkdir -p $C touch $W/i.st ; sleep 1 for i in `seq 0 $((${#B[@]} - 1))` ; do - cd ${B[$i]} + cd ${B[$i]}/wpa_supplicant if [ -f Makefile ] ; then make install DESTDIR=$P fi done + wpadir=$B/wpa_supplicant + install $wpadir/wpa_gui-qt4/wpa_gui $P/usr/sbin + cat <<- "EOF" > $P/usr/sbin/wpa_action.sh + #!/bin/sh + + IFNAME=$1 + CMD=$2 + + if [ "$CMD" == "CONNECTED" ] ; then + dhclient $IFNAME + fi + + if [ "$CMD" == "DISCONNECTED" ] ; then + ifconfig $IFNAME down + fi + EOF + chmod 755 $P/usr/sbin/wpa_action.sh + install -d $P/usr/share/dbus-1/system-services + install -m 644 $wpadir/dbus/fi.*.service $P/usr/share/dbus-1/system-services + install -d $P/etc/dbus-1/system.d + install -m 644 $wpadir/dbus/*.conf $P/etc/dbus-1/system.d/wpa_supplicant.conf + install -d $mandir/man5 + install -m 644 $wpadir/doc/docbook/wpa_supplicant.conf.5 $mandir/man5 + install -d $mandir/man8 + install -m 644 $wpadir/doc/docbook/wpa_supplicant.8 $mandir/man8 + install -m 644 $wpadir/doc/docbook/wpa_cli.8 $mandir/man8 + install -m 644 $wpadir/doc/docbook/wpa_passphrase.8 $mandir/man8 + install -m 644 $wpadir/doc/docbook/wpa_priv.8 $mandir/man8 + install -m 644 $wpadir/doc/docbook/wpa_gui.8 $mandir/man8 + install -m 644 $wpadir/doc/docbook/wpa_background.8 $mandir/man8 + install -d $P/etc/rc.d/init.d + cat <<- "EOF" > $P/etc/rc.d/init.d/wpa_supplicant + #!/bin/sh + + IFNAME=`iwconfig 2> /dev/null | grep "IEEE 802.11" | awk '{print $1}'` + + start() { + if [ -x /usr/sbin/wpa_supplicant ] ; then + wpa_supplicant -B -c /etc/wpa_supplicant.conf -i $IFNAME + fi + if [ -x /usr/sbin/wpa_cli ] ; then + wpa_cli -a /usr/sbin/wpa_action.sh -B + fi + } + + stop() { + killall wpa_supplicant + } + + case "$1" in + start) + start + ;; + stop) + stop + ;; + restart) + stop + sleep 3 + start + ;; + *) + echo $"Usage: $0 {start|stop|restart}" + exit 1 + ;; + esac + exit 0 + EOF + chmod 644 $P/etc/rc.d/init.d/wpa_supplicant + cat <<- "EOF" | unexpand > $P/etc/wpa_supplicant.conf.dist + ctrl_interface=/var/run/wpa_supplicant + ctrl_interface_group=wheel + network={ + ssid="replace SSID" + key_mgmt=WPA-PSK + psk="very secret passphrase" + } + EOF touch $W/i.et cd $W find $P ! -type l -newer i.st ! -newer i.et \ @@ -294,10 +413,32 @@ fi ( cd $docdir ; find ${src[$i]} -type d -exec touch -r $W/{} {} \; ) done + cp -a $S/wpa_supplicant/examples $docdir/$src/wpa_supplicant + chmod -R g-w $docdir/$src/wpa_supplicant/examples + chown -R root.root $docdir/$src/wpa_supplicant/examples + mv $docdir/$src/wpa_supplicant/{examples,README-{WPS,Windows.txt}.gz} $C + mv $C/{examples,README-{WPS,Windows.txt}.gz} $docdir/$src/wpa_supplicant + touch -r $S $docdir/$src/wpa_supplicant convert - tar cvpf $pkg.tar -C $P `cd $P ; find usr/bin | tail -n+2` - tar rvpf $pkg.tar -C $P `cd $P ; find usr/share/man/man1 | tail -n+2` + install -d $P/install + cat <<- "EOF" > $P/install/doinst.sh + if [ -f etc/wpa_supplicant.conf ] ; then + rm etc/wpa_supplicant.conf.dist + else + mv etc/wpa_supplicant.conf.dist /tmp + mv /tmp/wpa_supplicant.conf.dist etc/wpa_supplicant.conf + fi + EOF + touch -t `date '+%m%d0900'` $P/install/doinst.sh + tar cvpf $pkg.tar -C $P `cd $P ; find usr/sbin | tail -n+2` + tar rvpf $pkg.tar -C $P `cd $P ; find usr/share/dbus-1/system-services | tail -n+2` + tar rvpf $pkg.tar -C $P etc/dbus-1/system.d/wpa_supplicant.conf + tar rvpf $pkg.tar -C $P etc/rc.d/init.d/wpa_supplicant + tar rvpf $pkg.tar -C $P etc/wpa_supplicant.conf.dist + tar rvpf $pkg.tar -C $P `cd $P ; find usr/share/man/man5 | tail -n+2` + tar rvpf $pkg.tar -C $P `cd $P ; find usr/share/man/man8 | tail -n+2` tar rvpf $pkg.tar -C $P usr/share/doc/$src + tar rvpf $pkg.tar -C $P install/doinst.sh touch -t `date '+%m%d0900'` $pkg.tar ; xz $pkg.tar ; touch $pkg.tar.xz mv $pkg.tar.xz $pkg.txz read -p "Do you want to keep work files? [y/N] " ans