aboutsummaryrefslogtreecommitdiffstats
path: root/build_gpl_release
blob: 78b2514b979ca1377046f0a7e2094281e65d7294 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
#!/bin/sh

# Path to the Windows cross compiler (mingw)
WINCROSS=/opt/xmingw/bin
WINLOCAL=/home/jm/H-win/local
QT4HOSTBIN=/q/jm/qt4/bin

set -e

if [ -z "$1" ]; then
    echo "build_gpl_release <version>"
    exit 1
fi

TMP=tmp.build_gpl_release
RELDIR=`pwd`/Release
VER=$1
NOW=`date +%Y-%m-%d`
DIR=hostap-$VER

REMOVE="build_gpl_release todo.lst Prism2-HW.txt"
REMOVE_DIRS="testing www"

if [ -r $TMP ]; then
    echo "Temporary directory '$TMP' exists. Remove it before running this."
    exit 1
fi

mkdir $TMP
cd $TMP

cvs export -D now -d "$DIR" hostap

cd "$DIR"
if [ -n "$REMOVE" ]; then
    rm $REMOVE
fi
if [ -n "$REMOVE_DIRS" ]; then
    rm -r $REMOVE_DIRS
fi

CONF=driver/modules/hostap_config.h
sed "s/\(^#define PRISM2_VERSION \"\)CVS/\1$VER - $NOW/" < $CONF > $CONF.tmp &&
    mv $CONF.tmp $CONF

echo "Version: $VER - $NOW"

DATE=`head -n 3 ChangeLog | tail -n 1 | sed "s/ .*//"`

if [ "$DATE" != "$NOW" ]; then
    echo "NOTE! Date mismatch in ChangeLog: $DATE != $NOW"
fi

cd ..
mkdir -p $RELDIR

# New style tarballs
mv $DIR/wpa_supplicant wpa_supplicant-$VER
cp $DIR/COPYING wpa_supplicant-$VER
cp $DIR/hostapd/{eloop*.[ch],common.[ch],md5.[ch],rc4.[ch],sha1.[ch],aes_wrap.[ch],aes.c,radius.[ch],radius_client.[ch],config_types.h,os*[ch],includes.h,build_config.h,wpa_common.h,state_machine.h} wpa_supplicant-$VER
cp $DIR/utils/wireless_copy.h wpa_supplicant-$VER
cd wpa_supplicant-$VER
cat Makefile | sed "s%../hostapd/%%g" > Makefile.tmp
mv -f Makefile.tmp Makefile
cd doc/docbook
make man
rm -f manpage.links manpage.refs
cd ../../..
tar czf $RELDIR/wpa_supplicant-$VER.tar.gz wpa_supplicant-$VER

mv $DIR/hostapd hostapd-$VER
cp wpa_supplicant-$VER/l2_packet*.[ch] hostapd-$VER
cp wpa_supplicant-$VER/{,eap_}defs.h hostapd-$VER
cp wpa_supplicant-$VER/{tls.h,tls_openssl.c,tls_none.c} hostapd-$VER
cp wpa_supplicant-$VER/ms_funcs.[ch] hostapd-$VER
cp wpa_supplicant-$VER/crypto.[ch] hostapd-$VER
cp wpa_supplicant-$VER/eap_ttls.h hostapd-$VER
cp wpa_supplicant-$VER/eap_sim_common.[ch] hostapd-$VER
cp wpa_supplicant-$VER/eap_pax_common.[ch] hostapd-$VER
cp wpa_supplicant-$VER/eap_psk_common.[ch] hostapd-$VER
cp wpa_supplicant-$VER/version.h hostapd-$VER
cp wpa_supplicant-$VER/wpa_ctrl.[ch] hostapd-$VER
cp $DIR/COPYING hostapd-$VER
cp $DIR/driver/modules/hostap_common.h hostapd-$VER
cp $DIR/utils/wireless_copy.h hostapd-$VER
cd hostapd-$VER
cat Makefile | sed "s%\(DIR_WPA_SUPPLICANT=\).*%\1.%" |
	sed "s%\(DIR_HOSTAP=\).*%\1.%g" > Makefile.tmp
mv -f Makefile.tmp Makefile
cd ..
tar czf $RELDIR/hostapd-$VER.tar.gz hostapd-$VER

mv $DIR/utils hostap-utils-$VER
cp $DIR/COPYING hostap-utils-$VER
cp $DIR/driver/modules/hostap_common.h hostap-utils-$VER
tar czf $RELDIR/hostap-utils-$VER.tar.gz hostap-utils-$VER

PDIR=hostap-driver-$VER
mkdir $PDIR
mv $DIR/{README,COPYING,ChangeLog,Makefile,driver,kernel-patches,pcmcia-cs-patches} $PDIR
tar czf $RELDIR/$PDIR.tar.gz $PDIR

cd ..
rm -r $TMP

if [ -d $WINCROSS ]; then
    pushd $RELDIR

    PDIR=wpa_supplicant-$VER
    WDIR=wpa_supplicant-windows-bin-$VER
    tar xzf $PDIR.tar.gz
    mkdir "$WDIR"
    cd "$PDIR"
    cat > .config <<EOF
CONFIG_DRIVER_NDIS=y
CONFIG_NATIVE_WINDOWS=y

CFLAGS += -I/opt/xmingw/i386-mingw32msvc/include/ddk
CC=i386-mingw32msvc-gcc
STRIP=i386-mingw32msvc-strip
PLATFORMSDKLIB=$WINLOCAL/lib
CONFIG_NDIS_EVENTS_INTEGRATED=y

CFLAGS += -I$WINLOCAL/include
LIBS += -L$WINLOCAL/lib
LIBS_w += -L$WINLOCAL/lib
LIBS_p += -L$WINLOCAL/lib

CONFIG_EAP_SIM=y
CONFIG_EAP_LEAP=y
CONFIG_EAP_TLS=y

CONFIG_CTRL_IFACE=y
CONFIG_EAP_FAST=y
CONFIG_EAP_MSCHAPV2=y
CONFIG_EAP_TTLS=y
CONFIG_EAP_PEAP=y
CONFIG_EAP_MD5=y
CONFIG_EAP_GTC=y
CONFIG_EAP_OTP=y
CONFIG_EAP_PAX=y
CONFIG_PKCS12=y

CONFIG_L2_PACKET=winpcap
CONFIG_MAIN=main_winsvc
CONFIG_BACKEND=winreg
CONFIG_ELOOP=eloop_win
EOF

    # First, build the Windows service & registry version and rename it
    PATH=$PATH:$WINCROSS make windows-bin
    mv wpa_supplicant.exe wpasvc.exe

    # Then, build "the standard" wpa_supplicant.exe
    cat >> .config <<EOF
CONFIG_MAIN=main
CONFIG_BACKEND=file
EOF

    PATH=$PATH:$WINCROSS make windows-bin

    for i in COPYING README README-Windows.txt wpa_supplicant.conf; do
	unix2dos < $i > ../"$WDIR"/$i
    done
    mv *.exe ../"$WDIR"
    cp win_example.reg ../"$WDIR"

    cd wpa_gui-qt4
    PATH=$QT4HOSTBIN:$PATH:$WINCROSS ./setup-mingw-cross-compiling
    PATH=$QT4HOSTBIN:$PATH:$WINCROSS make
    cp release/wpa_gui.exe ../../"$WDIR"
    cd ..

    cd ..
    rm -rf "$PDIR"
    zip "$WDIR.zip" "$WDIR"/*
    rm -rf "$WDIR"

    popd
fi

ls -l $RELDIR/*$VER*


exit 0

Issues:

hostap-utils:

prism2_srec:
	include ../hostapd/common.h
	include ../driver/modules/hostap_wlan.h