Skip to content

Commit

Permalink
Support deb package auto-build
Browse files Browse the repository at this point in the history
To make a deb package, 'make deb' is enough!

Signed-off-by: Jade.Cheng <[email protected]>
Signed-off-by: zhenwei pi <[email protected]>
  • Loading branch information
Jade.Cheng committed Feb 19, 2021
1 parent 8914d16 commit 8765ea0
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 5 deletions.
6 changes: 6 additions & 0 deletions DEBIAN/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
tcpping (1.0.0) unstable; urgency=low

* Initial release

-- Jade Cheng <[email protected]>

10 changes: 10 additions & 0 deletions DEBIAN/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Source: tcpping
Priority: optional
Maintainer: Jade Cheng <[email protected]>
Build-Depends: libnet1, pcap
Standards-Version: 1.0.0
Version: 1.0.0
Package: tcpping
Architecture: amd64
Description: This is a unstable package for make a deb file for tcpping
Source files are from https://github.com/jwyllie83/tcpping
25 changes: 20 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
PREFIX ?=
PACKAGE=tcpping_1.0

all: tcpping manpage

uninstall: remove
Expand All @@ -8,13 +11,25 @@ tcpping: tcpping.c
manpage: tcpping.1.xml
xmltoman tcpping.1.xml | gzip > tcpping.1.gz

install:
install -m 4755 ./tcpping /usr/bin/tcpping
mkdir -p /usr/share/man/man1
install -m 644 ./tcpping.1.gz /usr/share/man/man1/tcpping.1.gz
install: all
mkdir -p $(PREFIX)/usr/bin
install -m 4755 ./tcpping $(PREFIX)/usr/bin
mkdir -p $(PREFIX)/usr/share/man/man1
install -m 644 ./tcpping.1.gz $(PREFIX)/usr/share/man/man1/tcpping.1.gz

deb: all
mkdir -p $(PACKAGE)
cp -r DEBIAN $(PACKAGE)/DEBIAN
mkdir -p $(PACKAGE)/usr/bin
install -m 4755 ./tcpping $(PACKAGE)/usr/bin
mkdir -p $(PACKAGE)/usr/share/man/man1
install -m 644 ./tcpping.1.gz $(PACKAGE)/usr/share/man/man1/tcpping.1.gz
cp LICENSE $(PACKAGE)/DEBIAN/copyright
dpkg-deb -b $(PACKAGE) $(PACKAGE).deb

remove:
rm -f /usr/bin/tcpping
rm -f $(PREFIX)/usr/bin/tcpping
rm -f $(PREFIX)/usr/share/man/man1/tcpping.1.gz

clean:
rm -f ./tcpping ./tcpping.1.gz
3 changes: 3 additions & 0 deletions README.txt
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ Build with the following:

make

Build a debian package:
make deb

--- Setuid and tcpping ------------------------------------------------------

If you don't want to use root access to use it every time, you can setuid the
Expand Down

0 comments on commit 8765ea0

Please sign in to comment.