diff options
author | Christian Poessinger <christian@poessinger.com> | 2017-12-30 18:02:49 +0100 |
---|---|---|
committer | Christian Poessinger <christian@poessinger.com> | 2017-12-30 18:08:45 +0100 |
commit | 22cb537289b0fdacab9206ec64e811763677c0e2 (patch) | |
tree | 3600cc8e49ca88bfdd860812f713cc1619d726b5 | |
parent | 33ef225f5b1d90c23915d0fa6fc49d2d783d4fe6 (diff) | |
download | udp-broadcast-relay-22cb537289b0fdacab9206ec64e811763677c0e2.tar.gz udp-broadcast-relay-22cb537289b0fdacab9206ec64e811763677c0e2.zip |
Add support for Debian Packaging and systemd
-rw-r--r-- | .gitignore | 8 | ||||
-rw-r--r-- | Makefile | 17 | ||||
-rw-r--r-- | debian/changelog | 5 | ||||
-rw-r--r-- | debian/compat | 1 | ||||
-rw-r--r-- | debian/control | 27 | ||||
-rw-r--r-- | debian/copyright | 16 | ||||
-rwxr-xr-x | debian/rules | 68 | ||||
-rw-r--r-- | udp-broadcast-relay.c (renamed from main.c) | 0 | ||||
-rw-r--r-- | udp-broadcast-relay.default | 2 | ||||
-rw-r--r-- | udp-broadcast-relay.service | 15 |
10 files changed, 156 insertions, 3 deletions
diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..3203ad9 --- /dev/null +++ b/.gitignore @@ -0,0 +1,8 @@ +*.o +_version +udp-broadcast-relay +udp-broadcast-relay-*.zip +build-stamp + +debian/files +debian/udp-broadcast-relay.* @@ -1,5 +1,16 @@ -udp-broadcast-relay: main.c - gcc -g main.c -o udp-broadcast-relay +udp-broadcast-relay: udp-broadcast-relay.c + gcc -O0 udp-broadcast-relay.c -o udp-broadcast-relay clean: - rm -f udp-broadcast-relay + -$(RM) *.o + -$(RM) udp-broadcast-relay + -$(RM) build-stamp + -$(RM) -rf debian/udp-broadcast-relay + +install: + install -d $(DESTDIR)/usr/sbin + install -d $(DESTDIR)/lib/systemd/system + install -d $(DESTDIR)/etc/default + install -m 0755 udp-broadcast-relay $(DESTDIR)/usr/sbin + install -m 0644 udp-broadcast-relay.service $(DESTDIR)/lib/systemd/system + install -m 0644 udp-broadcast-relay.default $(DESTDIR)/etc/default/udp-broadcast-relay diff --git a/debian/changelog b/debian/changelog new file mode 100644 index 0000000..67ef58c --- /dev/null +++ b/debian/changelog @@ -0,0 +1,5 @@ +udp-broadcast-relay (0.1+vyos2+current0) unstable; urgency=medium + + * Initial support for Debian Packaging w/ VyOS + + -- Christian Poessinger <christian@poessinger.com> Sat, 30 Dec 2017 18:00:55 +0100 diff --git a/debian/compat b/debian/compat new file mode 100644 index 0000000..7ed6ff8 --- /dev/null +++ b/debian/compat @@ -0,0 +1 @@ +5 diff --git a/debian/control b/debian/control new file mode 100644 index 0000000..5f8780c --- /dev/null +++ b/debian/control @@ -0,0 +1,27 @@ +Source: udp-broadcast-relay +Section: net +Priority: optional +Maintainer: Christian Poessinger <christian@poessinger.com> +Build-Depends: debhelper (>= 5), + pkg-config, + dh-systemd (>= 1.5) +Standards-Version: 3.9.6 +Vcs-Git: http://github.com/c-po/udp-broadcast-relay +Homepage: http://github.com/c-po/udp-broadcast-relay + +Package: udp-broadcast-relay +Architecture: linux-any +Depends: ${shlibs:Depends}, ${misc:Depends} +Description: UDP Broadcast Packet Relay + This program listens for packets on a specified UDP broadcast port. When + a packet is received, it sends that packet to all specified interfaces + but the one it came from as though it originated from the original + sender. + . + The primary purpose of this is to allow games on machines on separated + local networks (Ethernet, WLAN) that use udp broadcasts to find each + other to do so. + . + It also works on ppp links, so you can log in from windows boxes (e.g. + using pptp) and play LAN-based games together. Currently, you have to + care about upcoming or downgoing interfaces yourself. diff --git a/debian/copyright b/debian/copyright new file mode 100644 index 0000000..f95cb53 --- /dev/null +++ b/debian/copyright @@ -0,0 +1,16 @@ +Copyright (C) 2011 Darell Tan + +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 2 +of the License, or (at your option) any later version. + +This program 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, write to the Free Software +Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + diff --git a/debian/rules b/debian/rules new file mode 100755 index 0000000..721cc26 --- /dev/null +++ b/debian/rules @@ -0,0 +1,68 @@ +#!/usr/bin/make -f +# -*- makefile -*- +# Sample debian/rules that uses debhelper. +# This file was originally written by Joey Hess and Craig Small. +# As a special exception, when this file is copied by dh-make into a +# dh-make output file, you may use that output file without restriction. +# This special exception was added by Craig Small in version 0.37 of dh-make. + +# Uncomment this to turn on verbose mode. +#export DH_VERBOSE=1 + +PACKAGE=udp-broadcast-relay +PKGDIR=$(CURDIR)/debian/$(PACKAGE) + +build: build-stamp + +build-stamp: + dh_testdir + $(MAKE) + touch $@ + +clean: clean-patched + +# Clean everything up, including everything auto-generated +# at build time that needs not to be kept around in the Debian diff +clean-patched: + dh_testdir + dh_testroot + if test -f Makefile ; then $(MAKE) clean ; fi + rm -f build-stamp + rm -f etc/default/vyatta + rm -rf config + dh_clean + +install: build + dh_testdir + dh_testroot + dh_prep + dh_installdirs + + $(MAKE) install DESTDIR=$(PKGDIR) + +# Build architecture-independent files here. +binary-indep: build install + rm -f debian/files + dh_testdir + dh_testroot + dh_install + dh_installdebconf + dh_installinit + dh_compress + dh_fixperms + dh_installdeb + if [ -f "../.VYOS_DEV_BUILD" ]; then \ + dh_gencontrol -- -v999.dev; \ + else \ + dh_gencontrol; \ + fi + dh_md5sums + dh_builddeb + +# Build architecture-dependent files here. +binary-arch: build install +# This is an architecture independent package +# so; we have nothing to do by default. + +binary: binary-indep +.PHONY: build clean binary-indep binary install diff --git a/main.c b/udp-broadcast-relay.c index f3df27b..f3df27b 100644 --- a/main.c +++ b/udp-broadcast-relay.c diff --git a/udp-broadcast-relay.default b/udp-broadcast-relay.default new file mode 100644 index 0000000..de17af3 --- /dev/null +++ b/udp-broadcast-relay.default @@ -0,0 +1,2 @@ +# Uncomment to start UDP bcast relay on the listed interfaces +#DAEMON_ARGS="1 1900 eth0 eth1 eth2" diff --git a/udp-broadcast-relay.service b/udp-broadcast-relay.service new file mode 100644 index 0000000..e172e5d --- /dev/null +++ b/udp-broadcast-relay.service @@ -0,0 +1,15 @@ +[Unit] +Description=UDP-bcast-relay +After=network.target +RequiresMountsFor=/run + +[Service] +Type=notify +NotifyAccess=main +EnvironmentFile=-/etc/default/udp-broadcast-relay +ExecStart=/usr/sbin/udp-broadcast-relay $DAEMON_ARGS +Restart=on-failure +Type=forking + +[Install] +WantedBy=multi-user.target |