--- admin/PlamoBuild.template.common.without_comment 2016-06-15 20:51:13.000000000 +0900 +++ plamo/01_minimum/network.txz/old/wpa_supplicant-20170110/PlamoBuild.wpa_supplicant-2.5 2017-01-10 10:50:21.000000000 +0900 @@ -1,15 +1,17 @@ #!/bin/sh ###################################################################### -url="" -pkgbase= -vers= +url="http://hostap.epitest.fi/releases/wpa_supplicant-2.5.tar.gz" +pkgbase=wpa_supplicant +vers=2.5 arch=`uname -m` build=P1 src=$pkgbase-$vers patchfiles="" OPT_CONFIG="" -DOCS="README" +DOCS="`echo wpa_supplicant/{README-HS20,eap_testing.txt,README-Windows.txt}` + `echo wpa_supplicant/{ChangeLog,README-WPS,todo.txt,README-P2P,README}` + CONTRIBUTIONS COPYING README" ###################################################################### fscheck() { @@ -233,8 +235,40 @@ esac done done + cd $B + cp -p wpa_supplicant/{defconfig,.config} + cat <<- "EOF" | patch wpa_supplicant/.config + 44c44 + < #CONFIG_LIBNL32=y + --- + > CONFIG_LIBNL32=y + 151c151 + < #CONFIG_WPS=y + --- + > CONFIG_WPS=y + 203c203 + < #CONFIG_READLINE=y + --- + > CONFIG_READLINE=y + 331c331 + < #CONFIG_CTRL_IFACE_DBUS=y + --- + > CONFIG_CTRL_IFACE_DBUS=y + 335c335 + < #CONFIG_CTRL_IFACE_DBUS_NEW=y + --- + > CONFIG_CTRL_IFACE_DBUS_NEW=y + 338c338 + < #CONFIG_CTRL_IFACE_DBUS_INTRO=y + --- + > CONFIG_CTRL_IFACE_DBUS_INTRO=y + 365c365 + < #CONFIG_DEBUG_FILE=y + --- + > CONFIG_DEBUG_FILE=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 +284,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 + #make wpa_gui-qt4 fi if [ $opt_package -eq 1 ] ; then if [ `id -u` -ne 0 ] ; then @@ -267,11 +302,90 @@ 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 + make install DESTDIR=$P BINDIR=/usr/sbin 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 -m 644 $wpadir/doc/docbook/eapol_test.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.new + 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 +408,30 @@ 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 + 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 + mv etc/wpa_supplicant.conf.new /tmp + if [ -f etc/wpa_supplicant.conf ] ; then + mv /tmp/wpa_supplicant.conf.new etc/wpa_supplicant.conf.dist + else + mv /tmp/wpa_supplicant.conf.new 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.new + 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