| 1 |
# PKGBUILD for Zenmap targeting MinGW and MSYS2, for use in packaging Zenmap for Windows. |
| 2 |
# Expected invocation: makepkg-mingw -RdfL |
| 3 |
# -R: repackage, do not download source |
| 4 |
# -d: do not verify dependencies (Python 3 is the only build dependency) |
| 5 |
# -f: force, overwrite existing package. |
| 6 |
# -L: log progress to file |
| 7 |
_realname=zenmap |
| 8 |
pkgbase=mingw-w64-python-${_realname} |
| 9 |
pkgname=("${MINGW_PACKAGE_PREFIX}-python-${_realname}") |
| 10 |
provides=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}") |
| 11 |
conflicts=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}") |
| 12 |
replaces=("${MINGW_PACKAGE_PREFIX}-python3-${_realname}") |
| 13 |
NMAP_DIR=$(realpath "../../..") |
| 14 |
pkgver=$(echo NMAP_VERSION | ${CC} -E -imacros "${NMAP_DIR}/nmap.h" - | sed -n '$s/[" ]//g;$p') |
| 15 |
pkgrel=1 |
| 16 |
pkgdesc="Graphical Nmap frontend and results viewer" |
| 17 |
url="https://nmap.org/zenmap/" |
| 18 |
arch=("any") |
| 19 |
license=("NPSL") |
| 20 |
#source=("https://nmap.org/dist/nmap-${pkgver}.tar.bz2") |
| 21 |
#sha256sums=("SKIP") |
| 22 |
mingw_arch=('mingw64') |
| 23 |
depends=("${MINGW_PACKAGE_PREFIX}-python" "${MINGW_PACKAGE_PREFIX}-python-gobject") |
| 24 |
makedepends=("${MINGW_PACKAGE_PREFIX}-python-build" |
| 25 |
"${MINGW_PACKAGE_PREFIX}-python-installer" |
| 26 |
"${MINGW_PACKAGE_PREFIX}-python-setuptools" |
| 27 |
"${MINGW_PACKAGE_PREFIX}-python-wheel") |
| 28 |
|
| 29 |
build() { |
| 30 |
cd "${NMAP_DIR}/zenmap" |
| 31 |
${MINGW_PREFIX}/bin/python -m build --wheel --skip-dependency-check --no-isolation |
| 32 |
} |
| 33 |
|
| 34 |
package() { |
| 35 |
cd "${NMAP_DIR}/zenmap" |
| 36 |
whlver=$(${MINGW_PREFIX}/bin/python -c 'import zenmapCore.Version as V; print(V.VERSION.lower())') |
| 37 |
|
| 38 |
MSYS2_ARG_CONV_EXCL="--prefix=" \ |
| 39 |
${MINGW_PREFIX}/bin/python -m installer --prefix=${MINGW_PREFIX} \ |
| 40 |
--destdir="${pkgdir}" dist/zenmap-${whlver}*.whl |
| 41 |
|
| 42 |
install -Dm644 install_scripts/unix/zenmap.desktop "${pkgdir}${MINGW_PREFIX}/share/applications/zenmap.desktop" |
| 43 |
} |