diff --git a/.gitignore b/.gitignore index 824c89f..d85b6ff 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ pcapmirror debian/debhelper-build-stamp debian/pcapmirror.substvars +*.gz diff --git a/Makefile b/Makefile index 3484fd8..e2addc7 100644 --- a/Makefile +++ b/Makefile @@ -22,7 +22,7 @@ TARGET = pcapmirror PREFIX = /usr # Default rule -all: $(TARGET) +all: $(TARGET) man # Create executable $(TARGET): $(OBJS) @@ -32,6 +32,9 @@ $(TARGET): $(OBJS) %.o: %.c $(CC) $(CFLAGS) -c $< -o $@ +man: + gzip -9 -c pcapmirror.8 > pcapmirror.8.gz + # Clean up object files and executable clean: rm -f -f $(OBJS) $(TARGET) @@ -39,11 +42,14 @@ clean: # Install the executable install: $(TARGET) mkdir -p $(DESTDIR)$(PREFIX)/bin - install -D $(TARGET) $(DESTDIR)$(PREFIX)/bin/$(TARGET) + install -D $(TARGET) $(DESTDIR)$(PREFIX)/bin/$(TARGET) + install -D $(TARGET).8 $(DESTDIR)$(PREFIX)/share/man/man8/$(TARGET).8 + # Uninstall the executable uninstall: rm -f $(TARGET) $(DESTDIR)$(PREFIX)/bin/$(TARGET) + rm -f $(TARGET).8 $(DESTDIR)$(PREFIX)/share/man/man8/$(TARGET).8 # Run the executable (example) run: $(TARGET) diff --git a/debian/install b/debian/install index 6fdfec3..0173d9d 100644 --- a/debian/install +++ b/debian/install @@ -1 +1,2 @@ -pcapmirror /usr/bin \ No newline at end of file +pcapmirror /usr/bin +pcapmirror.8.gz /usr/share/man/man8/pcapmirror.8.gz \ No newline at end of file diff --git a/pcapmirror.spec b/pcapmirror.spec index 5160fa3..d2def87 100644 --- a/pcapmirror.spec +++ b/pcapmirror.spec @@ -20,9 +20,11 @@ pcapmirror is a command-line tool for capturing and mirroring network traffic us %files %{_bindir}/pcapmirror +%{_mandir}/man1/pcapmirror.8.gz %license LICENSE %doc README.md + %changelog * Sat Mar 22 2025 Matthias Cramer 0.2-1 - Initial release of pcapmirror