# Maintainer: Stephan Eisvogel pkgname=hostapd-custom _pkgname=hostapd #_pkgcommit="#commit=4feb46ddb4489ce13e6f2fa2e051a185ee569aa8" _pkgcommit="#branch=main" pkgver=20240126.9e9afd956 pkgrel=1 pkgdesc="IEEE 802.11 AP, IEEE 802.1X/WPA/WPA2/EAP/RADIUS Authenticator" arch=(x86_64) url="https://w1.fi/hostapd/" license=(BSD) depends=(glibc libnl openssl sqlite) backup=("etc/${_pkgname}/${_pkgname}."{accept,conf,deny,eap_user,radius_clients,vlan,wpa_psk}) options=(emptydirs) groups=(custom) conflicts=(hostapd) provides=(hostapd) source=(git+https://w1.fi/hostap.git${_pkgcommit} config hostapd.service hostapd@.service 0001-noscan.patch 0002-logspam.patch ) sha256sums=('SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' 'SKIP' ) pkgver() { cd "${srcdir}/hostap" git log -1 --format='%cd.%h' --date=short | tr -d - } prepare() { cd "${srcdir}/hostap" # apply patches local i; for i in "${source[@]}"; do case $i in *.patch) msg2 "Applying patch $i" patch -p1 -i "$srcdir/$i" ;; esac done # fix include locations in main configuration file sed -e 's|/etc/hostapd|/etc/hostapd/hostapd|g' \ -e 's|/var/run|/run|g' \ -e 's|radius_attr.sqlite|/var/lib/hostapd/radius_attr.sqlite|g' \ -e 's|hostapd.cred|/var/lib/hostapd/hostapd.cred|g' \ -e 's|hostapd.ap_settings|/var/lib/hostapd/hostapd.ap_settings|g' \ -e 's|hostapd_wps_pin_requests|hostapd/wps_pin_requests|g' \ -i "${_pkgname}/${_pkgname}.conf" # extract license cat "${_pkgname}/README" |head -n47 |tail -n5 > LICENSE # link build configuration into place: # an up-to-date version of the build configuration can be found in # hostapd/defconfig and should be diffed with the packaged one before every # build ln -sv "${srcdir}/config" "${_pkgname}/.config" } build() { cd "${srcdir}/hostap/hostapd" make } package() { cd "${srcdir}/hostap" make -C "${_pkgname}" install DESTDIR="${pkgdir}" BINDIR="/usr/bin" # systemd service install -vDm 644 "../${_pkgname}.service" -t "$pkgdir/usr/lib/systemd/system/" install -vDm 644 "../${_pkgname}@.service" -t "$pkgdir/usr/lib/systemd/system/" # license install -vDm 644 LICENSE -t "$pkgdir/usr/share/licenses/$_pkgname/" # config install -vDm 640 "${_pkgname}/${_pkgname}."{accept,conf,deny,eap_user,radius_clients,vlan,wpa_psk} -t "${pkgdir}/etc/${_pkgname}" mv "${pkgdir}/etc/${_pkgname}/${_pkgname}.conf" "${pkgdir}/etc/${_pkgname}/${_pkgname}.conf.example" # docs install -vDm 644 "${_pkgname}/"{hostapd.sim_db,wired.conf,hlr_auc_gw.{txt,milenage_db}} "${_pkgname}/"{README*,ChangeLog} -t "${pkgdir}/usr/share/doc/${_pkgname}" # man pages install -vDm 644 "${_pkgname}/${_pkgname}.8" -t "$pkgdir/usr/share/man/man8/" install -vDm 644 "${_pkgname}/${_pkgname}_cli.1" -t "$pkgdir/usr/share/man/man1/" # state dir install -vdm 750 "${pkgdir}/var/lib/${_pkgname}" }