debian/0000755000000000000000000000000012153106526007167 5ustar debian/source/0000755000000000000000000000000011346442237010474 5ustar debian/source/format0000644000000000000000000000001411346442237011702 0ustar 3.0 (quilt) debian/changelog0000644000000000000000000000216512153106526011045 0ustar libnss-gw-name (0.3-2) unstable; urgency=low * Upload to unstable -- Joachim Breitner Mon, 03 Jun 2013 14:34:24 +0200 libnss-gw-name (0.3-1) experimental; urgency=low * Port to libnl-3.x (Closes: #688166) * Bump Standards-Version -- Joachim Breitner Thu, 20 Sep 2012 13:21:17 +0200 libnss-gw-name (0.2.1-1) unstable; urgency=low * Fix typo in Homepage, thx to Tomas Pospisek for noticing (Closes: #574893) * Build with Multi-Arch support -- Joachim Breitner Tue, 28 Jun 2011 12:28:12 +0200 libnss-gw-name (0.2-1) unstable; urgency=low * Actually release the previous change as a new upstream version. -- Joachim Breitner Sat, 20 Mar 2010 12:05:12 +0100 libnss-gw-name (0.1-2) unstable; urgency=low * Resolve “gateway.localhost” instead of “gateway.current” (Closes: #574561) -- Joachim Breitner Sat, 20 Mar 2010 11:00:46 +0100 libnss-gw-name (0.1-1) unstable; urgency=low * Initial release (Closes: #573605) -- Joachim Breitner Fri, 12 Mar 2010 22:05:33 +0100 debian/lintian-overrides0000644000000000000000000000010211602311641012533 0ustar libnss-gw-name: package-name-doesnt-match-sonames libnss-gw-name2 debian/postrm0000644000000000000000000000133611346446105010444 0ustar #!/bin/sh set -e #DEBHELPER# if [ "$1" = "remove" ]; then ldconfig fi # This code was taken from nss-mdns: log() { echo "$*" } remove_nss_entry() { log "Checking NSS setup..." # abort if /etc/nsswitch.conf does not exist if ! [ -e /etc/nsswitch.conf ]; then log "Could not find /etc/nsswitch.conf." return fi perl -i -pe ' my @remove=( "gw_name", ); sub remove { my $s=shift; foreach my $bit (@remove) { $s=~s/\s+\Q$bit\E//g; } return $s; } s/^(hosts:)(.*)/$1.remove($2)/e; ' /etc/nsswitch.conf } action="$1" if [ "$action" = remove ]; then remove_nss_entry fi debian/mktarball.sh0000755000000000000000000000036411351116603011476 0ustar #!/bin/bash if [ -z "$1" ] then echo "Usage: $0 upstream-version" exit 1 fi git archive \ --prefix "libnss-gw-name-$1/" \ --format tar \ HEAD | tar --delete "libnss-gw-name-$1/debian" | gzip -9 > "../libnss-gw-name_$1.orig.tar.gz" \ debian/rules0000755000000000000000000000264111602311424010243 0ustar #!/usr/bin/make -f # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 DEB_HOST_ARCH := $(shell dpkg-architecture -qDEB_HOST_ARCH) DEB_HOST_MULTIARCH ?= $(shell dpkg-architecture -qDEB_HOST_MULTIARCH) CFLAGS = -Wall -g -Wextra -Wmissing-prototypes -Wstrict-prototypes -Wpointer-arith ifneq (,$(filter noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 else CFLAGS += -O2 endif ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) MAKEFLAGS += -j$(patsubst parallel=%,%,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) endif build-arch: build-arch-stamp build-indep: build: build-arch-stamp build-arch-stamp: dh_testdir $(MAKE) CFLAGS="$(CFLAGS)" touch build-arch-stamp clean: dh_testdir dh_testroot rm -f build-arch*-stamp $(MAKE) clean rm -f *.o *.so *.so.* dh_clean # Build architecture-independent files here. binary-indep: build-indep # We have nothing to do LIBNAME = libnss_gw_name.so.2 # Build architecture-dependent files here. binary-arch: build-arch dh_testdir dh_testroot dh_prep dh_installdirs $(MAKE) install libprefix=\$${prefix}/lib/$(DEB_HOST_MULTIARCH) DESTDIR=$(CURDIR)/debian/libnss-gw-name dh_lintian dh_installchangelogs dh_installdocs dh_link dh_strip dh_makeshlibs dh_shlibdeps dh_compress dh_fixperms dh_installdeb dh_gencontrol dh_md5sums dh_builddeb binary: binary-indep binary-arch .PHONY: build build-arch build-indep clean binary-indep binary-arch binary debian/control0000644000000000000000000000152012026577003010571 0ustar Source: libnss-gw-name Section: admin Priority: extra Maintainer: Joachim Breitner Build-Depends: debhelper (>= 8.1.3), pkg-config, libnl-3-dev, libnl-route-3-dev, Standards-Version: 3.9.3 Homepage: http://www.joachim-breitner.de/projects#libnss-gw-name VCS-Git: git://git.nomeata.de/libnss-gw-name.git VCS-Browser: http://git.nomeata.de/?p=libnss-gw-name.git Package: libnss-gw-name Architecture: linux-any Multi-Arch: same Depends: ${shlibs:Depends}, ${misc:Depends} Pre-Depends: ${misc:Pre-Depends} Description: nss module that names the current gateway’s IP address This Name Service Switch (NSS) module resolves the name “gateway.localhost” to the IP of the current default gateways of the system. This allows easy access to router configuration and to check if connectivity problems are local or not. debian/postinst0000644000000000000000000000272511602313644011002 0ustar #!/bin/sh set -e #DEBHELPER# if [ "$1" = "configure" ]; then ldconfig fi # This code was taken from nss-mdns: log() { echo "$*" } # try to insert gw_name entries to the "hosts" line in /etc/nsswitch.conf to # automatically enable libnss-gw-name support; do not change the configuration if the # "hosts" line already references some gw_name lookups insert_nss_entry() { log "Checking NSS setup..." # abort if /etc/nsswitch.conf does not exist if ! [ -e /etc/nsswitch.conf ]; then log "Could not find /etc/nsswitch.conf." return fi perl -i -pe ' sub insert { # this also splits on tab my @bits=split(" ", shift); # do not break configuration if the "hosts" line already references # gw_name if (grep { $_ eq "gw_name"} @bits) { return join " ", @bits; } # change "files" into "files gw_name" return join " ", map { $_ eq "files" ? ("$_","gw_name") : $_ } @bits; } s/^(hosts:\s+)(.*)/$1.insert($2)/e; ' /etc/nsswitch.conf } action="$1" if [ configure = "$action" ]; then if [ -z "$2" ]; then log "First installation detected..." # first install: setup the recommended configuration (unless # nsswitch.conf already contains gw_name entries) insert_nss_entry else # upgrade version="$2" # Nothing to do here yet fi fi debian/compat0000644000000000000000000000000211602311063010355 0ustar 8 debian/copyright0000644000000000000000000000222511346444652011133 0ustar This is libnss-gw-name, written and maintained by Joachim Breitner . Copyright © 2010 Joachim Breitner This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License version 2 as published by the Free Software Foundation. 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 with the Debian GNU/Linux distribution in file /usr/share/common-licenses/GPL-2; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA The Makefile and debian/rules file is derived from the respective files in libnss-extrausers, © 2001,2002,2009 Bernhard R. Link, under the same license. The debian/postinst, debian/postrm files were adapted from the files found in the nss-mdsn package, created by Jeff Waugh. Some code was derived from the nss-mdns package, © 2004, Lennart Poettering.