Bug 175120 - [MAINTAINER] security/zenmap: Fixed su-to-zenmap.sh and zenmap-root.desktop, removed PKGNAMEPREFIX
[MAINTAINER] security/zenmap: Fixed su-to-zenmap.sh and zenmap-root.desktop, ...
Status: Closed FIXED
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s)
Latest
Any Any
: Normal Affects Only Me
Assigned To: Ruslan Makhmatkhanov
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2013-01-08 03:30 UTC by nemysis
Modified: 2013-01-11 20:30 UTC (History)
0 users

See Also:


Attachments
zenmap-6.25_1.patch (1.85 KB, patch)
2013-01-08 03:30 UTC, nemysis
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description nemysis 2013-01-08 03:30:00 UTC
Added file(s):
- files/pc-su
Use excellent script from
    http://trac.pcbsd.org/browser/pcbsd/current/src-sh/pc-su
because old su-to-zenmap.sh is imported from Debian GNU/Linux very complicated,
and must be patched to works in KDE4.

Makefile changed:
Removed because isn't needed, and have had OptionsNG Problems are not changed
-PKGNAMEPREFIX=>${PYTHON_PKGNAMEPREFIX}

+post-extract:
+	@${RM} -f ${WRKSRC}/install_scripts/unix/su-to-zenmap.sh
+	@${CP} -a ${FILESDIR}/pc-su ${WRKSRC}/install_scripts/unix/su-to-zenmap.sh

 post-patch:
+	@${REINPLACE_CMD} -e 's|su-to-zenmap.sh %F|su-to-zenmap.sh ${PORTNAME}|' \
+		${WRKSRC}/install_scripts/unix/zenmap-root.desktop
Changed that PC-BSD script pc-su can works.

Generated and tested manually, tested with port test, sent with FreeBSD Port Tools 0.99_6 (mode: change, diff: ports)

How-To-Repeat: 
portlint -A
looks usual.

port test: clean
Comment 1 Ruslan Makhmatkhanov freebsd_committer 2013-01-11 11:30:28 UTC
Responsible Changed
From-To: freebsd-ports-bugs->rm

I will take it.
Comment 2 dfilter freebsd_committer 2013-01-11 20:22:42 UTC
Author: rm
Date: Fri Jan 11 20:22:28 2013
New Revision: 310248
URL: http://svnweb.freebsd.org/changeset/ports/310248

Log:
  - drop PKGNAMEPREFIX (it's an app, not library)
  - replace su-to-zenmap.sh (su detection script) with more clean solution
    from PC-BSD, that does not require modification to work properlt with kde4
  - bump PORTREVISION
  
  PR:		175120
  Submitted by:	nemysis <nemysis@gmx.ch> (maintainer)

Added:
  head/security/zenmap/files/
  head/security/zenmap/files/pc-su   (contents, props changed)
Modified:
  head/security/zenmap/Makefile

Modified: head/security/zenmap/Makefile
==============================================================================
--- head/security/zenmap/Makefile	Fri Jan 11 20:19:45 2013	(r310247)
+++ head/security/zenmap/Makefile	Fri Jan 11 20:22:28 2013	(r310248)
@@ -3,9 +3,9 @@
 
 PORTNAME=	zenmap
 PORTVERSION=	6.25
+PORTREVISION=	1
 CATEGORIES=	security ipv6
 MASTER_SITES=	http://nmap.org/dist/
-PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}
 DISTNAME=	nmap-${PORTVERSION}
 
 MAINTAINER=	nemysis@gmx.ch
@@ -37,7 +37,13 @@ PLIST_SUB+=	NLS=""
 PLIST_SUB+=	NLS="@comment "
 .endif
 
+post-extract:
+	@${RM} -f ${WRKSRC}/install_scripts/unix/su-to-zenmap.sh
+	@${CP} -a ${FILESDIR}/pc-su ${WRKSRC}/install_scripts/unix/su-to-zenmap.sh
+
 post-patch:
+	@${REINPLACE_CMD} -e 's|su-to-zenmap.sh %F|su-to-zenmap.sh ${PORTNAME}|' \
+		${WRKSRC}/install_scripts/unix/zenmap-root.desktop
 	@${REINPLACE_CMD} \
 		-e '/self.create_uninstaller/s|^|#|' ${WRKSRC}/setup.py
 	@${REINPLACE_CMD} \

Added: head/security/zenmap/files/pc-su
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ head/security/zenmap/files/pc-su	Fri Jan 11 20:22:28 2013	(r310248)
@@ -0,0 +1,34 @@
+#!/bin/sh
+# Wrapper script which finds the right "su" program
+# to use for graphical root execution
+
+if [ `id -r -u` != "0" ] ; then
+        VARS="`echo $@`"
+
+        # Try qsu first, should always be the default
+        which qsu >/dev/null 2>/dev/null
+        if [ $? -eq 0 ] ; then
+           qsu $VARS
+           exit $?
+        fi
+
+        # Now try gksu
+        which gksu >/dev/null 2>/dev/null
+        if [ $? -eq 0 ] ; then
+           gksu -a "$VARS"
+           exit $?
+        fi
+
+        # Lastly we have kdesu
+        which kdesu >/dev/null 2>/dev/null
+        if [ $? -eq 0 ] ; then
+           kdesu -t -c "$VARS"
+           exit $?
+        fi
+
+        # If no utility could be found...
+        echo "No graphical switch-user utility found!"
+        exit 1
+else
+        ${@}
+fi
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 3 Ruslan Makhmatkhanov freebsd_committer 2013-01-11 20:22:56 UTC
State Changed
From-To: open->closed

Committed, thank you!