Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debian package #5

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
0.1
Empty file added AUTHORS
Empty file.
Empty file added COPYING
Empty file.
1 change: 1 addition & 0 deletions ChangeLog
22 changes: 22 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
cfgdir = $(datadir)/vyatta-cfg/templates
opdir = $(datadir)/vyatta-op/templates
curverdir = $(sysconfdir)/config-migrate/current
bin_sudo_usersdir = $(bindir)/sudo-users

vprefix = /opt/vyatta
vsbindir = $(vprefix)/sbin

sbin_SCRIPTS =
sbin_SCRIPTS += scripts/eap_proxy.py
sbin_SCRIPTS += scripts/vyatta-service-eap-proxy-update.sh

bin_sudo_users_SCRIPTS =

curver_DATA =

cpiop = find . ! -regex '\(.*~\|.*\.bak\|.*\.swp\|.*\#.*\#\)' -print0 | \
cpio -0pd

install-exec-hook:
mkdir -p $(DESTDIR)$(cfgdir)
cd templates-cfg; $(cpiop) $(DESTDIR)$(cfgdir)
Empty file added NEWS
Empty file.
3 changes: 3 additions & 0 deletions README
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This package has eap-proxy configuration templates and scripts.

See README.md for details.
32 changes: 32 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Process this file with autoconf to produce a configure script.
AC_PREREQ(2.59)

m4_define([VERSION_ID], [m4_esyscmd([
if test -f .version ; then
head -n 1 .version | tr -d \\n
else
echo -n 2.4
fi])])
AC_INIT([vyatta-eap-proxy], VERSION_ID)

test -n "$VYATTA_VERSION" || VYATTA_VERSION=$PACKAGE_VERSION

AC_CONFIG_AUX_DIR([config])
AM_INIT_AUTOMAKE([gnu no-dist-gzip dist-bzip2 subdir-objects])
AC_PREFIX_DEFAULT([/opt/vyatta])

AC_ARG_ENABLE([nostrip],
AC_HELP_STRING([--enable-nostrip],
[include -nostrip option during packaging]),
[NOSTRIP=-nostrip], [NOSTRIP=])

AC_CONFIG_FILES([Makefile])

AC_SUBST(NOSTRIP)

AC_PROG_CC
AC_PROG_CXX
AM_PROG_AS
AM_PROG_CC_C_O
AC_OUTPUT

7 changes: 0 additions & 7 deletions copy_to_router.sh

This file was deleted.

6 changes: 6 additions & 0 deletions debian/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
The Debian Package vyatta-eap-proxy
----------------------------

This package has EAP proxy configuration templates and scripts.

-- John Doe <[email protected]> Sat, 1 Oct 2017 17:53:53 -0700
11 changes: 11 additions & 0 deletions debian/autogen.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/sh


rm -rf config
rm -f aclocal.m4 config.guess config.statusconfig.sub configure INSTALL

autoreconf --force --install

rm -f config.sub config.guess
ln -s /usr/share/misc/config.sub .
ln -s /usr/share/misc/config.guess .
6 changes: 6 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
vyatta-eap-proxy (0.1.0) unstable; urgency=low

* Initial release.

-- John Doe <[email protected]> Sat, 1 Oct 2017 17:53:53 -0700

1 change: 1 addition & 0 deletions debian/compat
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5
13 changes: 13 additions & 0 deletions debian/control
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Source: vyatta-eap-proxy
Section: contrib/net
Priority: extra
Maintainer: John Doe <[email protected]>
Standards-Version: 3.9.6
Build-Depends: debhelper (>= 5), autotools-dev, autoconf

Package: vyatta-eap-proxy
Architecture: all
Depends: vyatta-cfg-system, vyatta-cfg
Replaces: vyatta-eap-proxy
Description: EAP proxy
Proxy EAP packets between two interfaces
Empty file added debian/copyright
Empty file.
2 changes: 2 additions & 0 deletions debian/docs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
NEWS
README
2 changes: 2 additions & 0 deletions debian/lintian
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
vyatta-eap-proxy: file-in-unusual-dir
vyatta-eap-proxy: dir-or-file-in-opt
105 changes: 105 additions & 0 deletions debian/rules
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
#!/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


# These are used for cross-compiling and for saving the configure script
# from having to guess our platform (since we know it already)
DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)
PACKAGE=vyatta-eap-proxy
PKGDIR=$(CURDIR)/debian/$(PACKAGE)

CFLAGS = -Wall -g

configure = ./configure
configure += --host=$(DEB_HOST_GNU_TYPE)
configure += --build=$(DEB_BUILD_GNU_TYPE)
configure += --prefix=/opt/vyatta
configure += --mandir=\$${prefix}/share/man
configure += --infodir=\$${prefix}/share/info
configure += CFLAGS="$(CFLAGS)"
configure += LDFLAGS="-Wl,-z,defs"

ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS)))
CFLAGS += -O0
else
CFLAGS += -O2
endif

configure: configure.ac Makefile.am
chmod +x debian/autogen.sh
debian/autogen.sh

config.status: configure
dh_testdir
rm -f config.cache
$(configure)

build: build-stamp

build-stamp: config.status
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 distclean ; fi
rm -f build-stamp
rm -f config.status config.sub config.guess config.log
rm -f aclocal.m4 configure Makefile.in Makefile INSTALL
rm -rf config
dh_clean

install: build
dh_testdir
dh_testroot
dh_clean -k
dh_installdirs

$(MAKE) DESTDIR=$(PKGDIR) install

install -D --mode=0644 debian/lintian $(PKGDIR)/usr/share/lintian/overrides/$(PACKAGE)

# Build architecture-independent files here.
binary-indep: build install
rm -f debian/files
dh_testdir
dh_testroot
dh_installchangelogs ChangeLog
dh_installdocs
dh_install
dh_installdebconf
dh_link
dh_strip
dh_compress
dh_fixperms
dh_installdeb
if [ -f "../.VYATTA_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 binary-arch
.PHONY: build clean binary-indep binary-arch binary install
11 changes: 0 additions & 11 deletions eap_proxy.sh

This file was deleted.

File renamed without changes.
File renamed without changes.
28 changes: 28 additions & 0 deletions scripts/vyatta-service-eap-proxy-update.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash
BIN_PATH="/opt/vyatta/sbin/eap_proxy.py"
PIDFILE="/var/run/eap_proxy.pid"
CONFIG_OPTIONS=(\
"ping-gateway" \
"ignore-when-wan-up" \
"ignore-start" \
"ignore-logoff" \
"restart-dhcp" \
"set-mac" \
)
DAEMON_OPTIONS=(--daemon --pidfile "$PIDFILE" --syslog)

/sbin/start-stop-daemon --stop --retry 30 --pidfile "$PIDFILE" --oknodo --quiet

if [[ "$COMMIT_ACTION" != "DELETE" ]]; then
if_wan=$(cli-shell-api returnValue service eap-proxy wan-interface)
if_router=$(cli-shell-api returnValue service eap-proxy router-interface)

options=()
for option in "${CONFIG_OPTIONS[@]}"; do
if [[ "$(cli-shell-api returnValue service eap-proxy "$option")" == "enable" ]]; then
options+=("--$option")
fi
done
/sbin/start-stop-daemon --start --pidfile "$PIDFILE" --exec "$BIN_PATH" -- \
"$if_wan" "$if_router" "${options[@]}" "${DAEMON_OPTIONS[@]}"
fi
7 changes: 7 additions & 0 deletions templates-cfg/service/eap-proxy/ignore-logoff/node.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
type: txt
default: "enable"
help: Enable/disable ignoring EAPOL-Logoff from router
allowed: echo enable disable
syntax:expression: $VAR(@) in "enable", "disable"; "ignore-logoff setting must be enable or disable"
val_help: enable; Always ignore EAPOL-Logoff from router (default)
val_help: disable; Don't ignore EAPOL-Logoff from router
7 changes: 7 additions & 0 deletions templates-cfg/service/eap-proxy/ignore-start/node.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
type: txt
default: "disable"
help: Enable/disable ignoring EAPOL-Start from router
allowed: echo enable disable
syntax:expression: $VAR(@) in "enable", "disable"; "ignore-start setting must be enable or disable"
val_help: enable; Always ignore EAPOL-Start from router
val_help: disable; Don't ignore EAPOL-Start from router (default)
7 changes: 7 additions & 0 deletions templates-cfg/service/eap-proxy/ignore-when-wan-up/node.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
type: txt
default: "enable"
help: Enable/disable ignoring router packets when WAN is up (see ping-gateway)
allowed: echo enable disable
syntax:expression: $VAR(@) in "enable", "disable"; "ignore-when-wan-up setting must be enable or disable"
val_help: enable; Ignore router packets when WAN is up (default)
val_help: disable; Keep proxying router packets when WAN is up
4 changes: 4 additions & 0 deletions templates-cfg/service/eap-proxy/node.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
priority: 999
help: EAP proxy settings
end:
sudo /opt/vyatta/sbin/vyatta-service-eap-proxy-update.sh
7 changes: 7 additions & 0 deletions templates-cfg/service/eap-proxy/ping-gateway/node.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
type: txt
default: "enable"
help: Enable/disable pinging gateway to check if WAN is up (in addition to having an IP)
allowed: echo enable disable
syntax:expression: $VAR(@) in "enable", "disable"; "ping-gateway setting must be enable or disable"
val_help: enable; Ping gateway and check whether wan-interface.0 has an IP to check if WAN is up (default)
val_help: disable; Only check whether wan-interface.0 has an IP to check if WAN is up
7 changes: 7 additions & 0 deletions templates-cfg/service/eap-proxy/restart-dhcp/node.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
type: txt
default: "enable"
help: Enable/disable restarting dhclient on wan-interface.0 if WAN is not up after receiving EAP-Success on wan-interface (see ping-gateway)
allowed: echo enable disable
syntax:expression: $VAR(@) in "enable", "disable"; "restart-dhcp setting must be enable or disable"
val_help: enable; Restart dhclient on wan-interface.0 if WAN is not up after receiving EAP-Success on wan-interface (default)
val_help: disable; Do not restart dhclient on wan-interface.0 if WAN is not up after receiving EAP-Success on wan-interface
3 changes: 3 additions & 0 deletions templates-cfg/service/eap-proxy/router-interface/node.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type: txt
help: Interface name of the AT&T router
default: "eth2"
7 changes: 7 additions & 0 deletions templates-cfg/service/eap-proxy/set-mac/node.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
type: txt
default: "disable"
help: Enable/disable setting wan-interface.0's MAC address to router's MAC address
allowed: echo enable disable
syntax:expression: $VAR(@) in "enable", "disable"; "set-mac setting must be enable or disable"
val_help: enable; Set wan-interface.0's MAC address to router's MAC address
val_help: disable; Do not set wan-interface.0's MAC address to router's MAC address (default)
3 changes: 3 additions & 0 deletions templates-cfg/service/eap-proxy/wan-interface/node.def
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
type: txt
help: Interface name of the AT&T ONT/WAN
default: "eth0"