#!/bin/bash ## src2pkg script for: wpa_supplicant ## Auto-generated by src2pkg-2.6 ## src2pkg - Copyright 2005-2011 Gilbert Ashley SOURCE_NAME='wpa_supplicant-0.6.9.tar.bz2' ALT_NAME='wpa-supplicant' # Use ALT_NAME to override guessed value VERSION='0.6.9' # Use ALT_VERSION to override guessed value # ARCH='' # BUILD='1' # PRE_FIX='usr' # Any extra options go here: # EXTRA_CONFIGS="" # this is for 0.6.9 CONFIG_SUBDIR='wpa_supplicant' # MAKE_COMMAND='make wpa_supplicant wpa_passphrase wpa_cli' # use a patch to MAkefile instead # PATCHLIST="wpa-supplicant-no-eap.diff" DOCLIST="ChangeLog COPYING README examples wpa_supplicant.conf.sample" # disable items that go with the qt gui AUTO_ICON=NO AUTO_DESKTOP=NO # Optional function replaces configure_source, compile_source, fake_install # To use, uncomment and write/paste CODE between the {} brackets. # build() { CODE } # Get the functions and configs . /usr/libexec/src2pkg/FUNCTIONS ; # Execute the named packaging steps: pre_process find_source make_dirs unpack_source fix_source_perms # Create the configuration file for wpa_supplicant: cat $CWD/wpa_supplicant-0.6.9.defconfig > $SRC_DIR/wpa_supplicant/.config ( cd $SRC_DIR && { if [[ -d /usr/include/madwifi ]] ; then echo "Adding madwifi driver (Atheros) support" cat <<-EOT >> .config CONFIG_DRIVER_MADWIFI=y CFLAGS += -I/usr/include/madwifi EOT fi if [[ -d /usr/include/hermes ]] ; then echo "Adding hermes driver (Agere) support" cat <<-EOT >> .config CONFIG_DRIVER_HERMES=y CFLAGS += -I/usr/include/hermes EOT fi if [[ -d /usr/include/broadcom ]] ; then echo "Adding broadcom driver support" cat <<-EOT >> .config CONFIG_DRIVER_BROADCOM=y CFLAGS += -I/usr/include/broadcom EOT fi } ) configure_source # compile_source # If used, the 'build' function replaces these 3 fake_install # mv $PKG_DIR/usr/sbin $PKG_DIR/sbin # Install a deafult configuration file mkdir -p $PKG_DIR/etc cat <<-_EOT_ > $PKG_DIR/etc/wpa_supplicant.conf.new # See /usr/doc/${PRGNAM}-${VERSION}/wpa_supplicant.conf.sample # for many more options that you can use in this file. # This line enables the use of wpa_cli which is used by rc.wireless # if possible (to check for successful association) ctrl_interface=/var/run/wpa_supplicant # By default, only root (group 0) may use wpa_cli ctrl_interface_group=0 eapol_version=1 ap_scan=1 fast_reauth=1 # WPA protected network, supply your own ESSID and WPAPSK here: network={ scan_ssid=0 ssid="your_essid_here" proto=WPA key_mgmt=WPA-PSK pairwise=CCMP TKIP group=CCMP TKIP WEP104 WEP40 psk=your_psk_here } # Plaintext connection (no WPA, no IEEE 802.1X), # nice for hotel/airport types of WiFi network. # You'll need a recent version of wireless-tools for this! network={ ssid="any" key_mgmt=NONE priority=2 } _EOT_ # This should only be read/write by root: chmod 600 $PKG_DIR/etc/wpa_supplicant.conf.new mv $SRC_DIR/$CONFIG_SUBDIR/wpa_supplicant.conf $SRC_DIR/$CONFIG_SUBDIR/wpa_supplicant.conf.sample mkdir -p $MAN_DIR/man8 ( cd $SRC_DIR/wpa_supplicant/doc/docbook && cp *.8 $MAN_DIR/man8 ) fix_pkg_perms strip_bins create_docs cp $CWD/README $DOC_DIR/README.howto compress_man_pages make_description make_doinst make_package post_process ## See the documentation for more help and examples. Below are some of # the most common Extras and Options for easy cut-and-paste use. # DOCLIST='' PATCHLIST='' INSTALL_TYPE='' # CONFIG_COMMAND='' MAKE_COMMAND='' INSTALL_LINE='' # When editing src2pkg scripts to add custom code, use these variables # to refer to the current directory, the sources or the package tree: # $CWD (current directory), $SRC_DIR (sources), $PKG_DIR (package tree) # Other commonly-used directories include: $DOC_DIR (document directory) # $MAN_DIR (man-page directory) $DATA_DIR (shared-data directory)