cnping

Minimal Graphical Ping Tool
git clone https://git.sinitax.com/cnlohr/cnping
Log | Files | Refs | Submodules | README | LICENSE | sfeed.txt

commit 97299fd917d262d037df57698fd32ec3cbf829f8
parent af431dd8731800675af6453d0bfcbaa233397e5d
Author: mrbesen <y.g.2@gmx.de>
Date:   Sun,  4 Dec 2022 15:05:53 +0100

debian packaging

Co-authored-by: Oliver Kästner <git@oliver-kaestner.de>

Diffstat:
M.gitignore | 6++++++
MMakefile | 12++++++------
Adebian/changelog | 5+++++
Adebian/control | 27+++++++++++++++++++++++++++
Adebian/copyright | 78++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Adebian/install | 4++++
Adebian/postinst | 26++++++++++++++++++++++++++
Adebian/rules | 4++++
Adebian/source/format | 1+
Mfreedesktop/com.github.cntools.cnping.desktop | 2+-
10 files changed, 158 insertions(+), 7 deletions(-)

diff --git a/.gitignore b/.gitignore @@ -4,3 +4,9 @@ cnping cnping-mousey searchnet tags + +debian/.debhelper +debian/cnping +debian/cnping.substvars +debian/debhelper-build-stamp +debian/files diff --git a/Makefile b/Makefile @@ -48,12 +48,12 @@ searchnet : ping.o searchnet.o $(CC) $(CFLAGS) -o $@ $^ -lpthread linuxinstall : cnping - sudo rm -f /usr/local/bin/cnping - sudo cp cnping /usr/local/bin/ - sudo cp -r $(ICONSPATH) /usr/local/share/icons - sudo cp freedesktop/${APPNAME}.desktop /usr/local/share/applications - sudo cp freedesktop/${APPNAME}.metainfo.xml /usr/local/share/metainfo - sudo setcap cap_net_raw+ep /usr/local/bin/cnping + rm -f /usr/local/bin/cnping + cp cnping /usr/local/bin/ + cp -r $(ICONSPATH) /usr/local/share/icons + cp freedesktop/${APPNAME}.desktop /usr/local/share/applications + cp freedesktop/${APPNAME}.metainfo.xml /usr/local/share/metainfo + setcap cap_net_raw+ep /usr/local/bin/cnping # sudo chmod +t /usr/local/bin/cnping #One option - set the stuid bit. # sudo install cnping /usr/local/bin/ #Another option - using install. diff --git a/debian/changelog b/debian/changelog @@ -0,0 +1,5 @@ +cnping (1.0.0) unstable; urgency=medium + + * Initial Release. + + -- Charles Lohr <lohr85@gmail.com> Sun, 04 Dec 2022 14:05:43 +0100 diff --git a/debian/control b/debian/control @@ -0,0 +1,27 @@ +Source: cnping +Section: net +Priority: optional +Maintainer: Charles Lohr <lohr85@gmail.com> +Build-Depends: debhelper-compat (= 12), + libglvnd-dev, + libx11-dev, + libxext-dev, + libxinerama-dev, + mesa-common-dev +Standards-Version: 4.6.1 +Homepage: https://github.com/cntools/cnping/ +VCS-Browser: https://github.com/cntools/cnping/ +VCS-Git: https://github.com/cntools/cnping.git + +Package: cnping +Architecture: any +Depends: libcap2-bin, ${misc:Depends}, ${shlibs:Depends} +Description: Minimal Graphical IP Ping Tool + cnping is a minimal graphical real time IP ping tool written in C. + It can send pings via ICMP (regular ping) or HTTP which is useful in case ICMP + is prohibited. Responses are displayed as vertical bars in a graphical window. + Red bars indicate a response was not (yet) received, white bars indicate the + response was received with a height relative to the round trip time. + Additional statistics are displayed as an overlay. + . + cnping uses rawdraw so it is OS independent and very light weight. diff --git a/debian/copyright b/debian/copyright @@ -0,0 +1,78 @@ +Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ +Upstream-Name: cnping +Upstream-Contact: Charles Lohr <lohr85@gmail.com> +Source: https://github.com/cntools/cnping/ + +Files: * +Copyright: 2022 Charles Lohr <lohr85@gmail.com> +License: BSD-3-Clause or MIT + +Files: debian/* +Copyright: 2022 Charles Lohr <lohr85@gmail.com> +License: GPL-3.0+ + +License: GPL-3.0+ + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + . + This package is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + . + You should have received a copy of the GNU General Public License + along with this program. If not, see <https://www.gnu.org/licenses/>. + . + On Debian systems, the complete text of the GNU General + Public License version 3 can be found in "/usr/share/common-licenses/GPL-3". + +License: BSD-3-Clause + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + (1) Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + + (2) Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in + the documentation and/or other materials provided with the + distribution. + + (3)The name of the author may not be used to + endorse or promote products derived from this software without + specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR + IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, + INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + POSSIBILITY OF SUCH DAMAGE. + + +License: MIT + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. diff --git a/debian/install b/debian/install @@ -0,0 +1,4 @@ +cnping /usr/bin/ +freedesktop/com.github.cntools.cnping.desktop /usr/share/applications/ +freedesktop/com.github.cntools.cnping.metainfo.xml /usr/share/metainfo/ +freedesktop/icons/hicolor /usr/share/icons diff --git a/debian/postinst b/debian/postinst @@ -0,0 +1,26 @@ +#!/bin/sh + +set -e + +PROGRAM=$(dpkg-divert --truename /usr/bin/cnping) + +if [ "$1" = configure ]; then + # If we have setcap installed, try setting cap_net_raw+ep, + # which allows us to install our binaries without the setuid + # bit. + if command -v setcap > /dev/null; then + if setcap cap_net_raw+ep $PROGRAM; then + chmod u-s $PROGRAM + else + echo "Setcap failed on $PROGRAM, falling back to setuid" >&2 + chmod u+s $PROGRAM + fi + else + echo "Setcap is not installed, falling back to setuid" >&2 + chmod u+s $PROGRAM + fi +fi + +#DEBHELPER# + +exit 0 diff --git a/debian/rules b/debian/rules @@ -0,0 +1,4 @@ +#!/usr/bin/make -f + +%: + dh $@ diff --git a/debian/source/format b/debian/source/format @@ -0,0 +1 @@ +3.0 (native) diff --git a/freedesktop/com.github.cntools.cnping.desktop b/freedesktop/com.github.cntools.cnping.desktop @@ -1,7 +1,7 @@ [Desktop Entry] Version=1.0 Name=cnping -Comment=Minimal Graphical IPv4 Ping/HTTP Ping Tool +Comment=Minimal Graphical IP Ping/HTTP Ping Tool Type=Application Icon=com.github.cntools.cnping Categories=Network;