2007-03-14 12:34:05 +01:00
|
|
|
#
|
|
|
|
# spec file for package nss-mdns (Version 0.9)
|
|
|
|
#
|
|
|
|
# Copyright (c) 2007 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
|
|
|
# This file and all modifications and additions to the pristine
|
|
|
|
# package are under the same license as the package itself.
|
|
|
|
#
|
|
|
|
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
|
|
|
#
|
|
|
|
|
|
|
|
# norootforbuild
|
|
|
|
|
|
|
|
Name: nss-mdns
|
|
|
|
# lynx is not needed, text version of README is already present
|
|
|
|
#BuildRequires: lynx
|
|
|
|
Version: 0.9
|
2007-09-10 12:46:59 +02:00
|
|
|
Release: 37
|
2007-03-14 12:34:05 +01:00
|
|
|
Group: Productivity/Networking/DNS/Utilities
|
2007-09-10 12:46:59 +02:00
|
|
|
License: LGPL v2 or later
|
2007-03-14 12:34:05 +01:00
|
|
|
URL: http://0pointer.de/lennart/projects/nss-mdns/
|
2007-09-10 12:46:59 +02:00
|
|
|
Summary: Host Name Resolution Via Multicast DNS (Zeroconf) for glibc
|
2007-03-14 12:34:05 +01:00
|
|
|
Source: %{name}-%{version}.tar.bz2
|
2007-04-22 01:00:50 +02:00
|
|
|
Patch: unaligned.diff
|
2007-03-14 12:34:05 +01:00
|
|
|
AutoReqProv: on
|
|
|
|
PreReq: sed grep
|
|
|
|
Requires: avahi
|
|
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
2007-09-10 12:46:59 +02:00
|
|
|
%ifarch x86_64
|
|
|
|
Requires: %{name}-%{version}-32bit
|
|
|
|
%endif
|
2007-03-14 12:34:05 +01:00
|
|
|
|
|
|
|
%description
|
2007-09-10 12:46:59 +02:00
|
|
|
nss-mdns is a plug-in for the GNU Name Service Switch (NSS)
|
|
|
|
functionality of the GNU C Library (glibc) providing a hostname
|
2007-03-14 12:34:05 +01:00
|
|
|
resolution via Multicast DNS (aka Zeroconf, aka Apple Rendezvous, aka
|
2007-09-10 12:46:59 +02:00
|
|
|
Apple Bonjour), and effectively allowing name resolution by common
|
2007-03-14 12:34:05 +01:00
|
|
|
Unix/Linux programs in the ad-hoc mDNS domain .local.
|
|
|
|
|
2007-09-10 12:46:59 +02:00
|
|
|
nss-mdns provides only client functionality, which means that you have
|
2007-03-14 12:34:05 +01:00
|
|
|
to run a mDNS responder daemon seperately from nss-mdns if you want to
|
2007-09-10 12:46:59 +02:00
|
|
|
register the local hostname via mDNS. I recommend Avahi.
|
2007-03-14 12:34:05 +01:00
|
|
|
|
2007-09-10 12:46:59 +02:00
|
|
|
By default, nss-mdns tries to contact a running avahi-daemon to resolve
|
|
|
|
hostnames and addresses and makes use of its superior record cacheing.
|
2007-03-14 12:34:05 +01:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Authors:
|
|
|
|
--------
|
|
|
|
Lennart Poettering <mzaffzqaf@0pointer.de>
|
|
|
|
|
|
|
|
%prep
|
|
|
|
%setup -q
|
2007-04-22 01:00:50 +02:00
|
|
|
%patch
|
2007-03-14 12:34:05 +01:00
|
|
|
|
|
|
|
%build
|
|
|
|
%configure --libdir=/%{_lib}
|
|
|
|
|
|
|
|
%install
|
|
|
|
%makeinstall
|
|
|
|
|
|
|
|
%post
|
|
|
|
/sbin/ldconfig
|
2007-09-10 12:46:59 +02:00
|
|
|
# Perl-fu to add mdns4_minimal to the hosts line of /etc/nsswitch.conf
|
|
|
|
if [ -f /etc/nsswitch.conf ] ; then
|
|
|
|
perl -ibak -pe '
|
|
|
|
sub insert {
|
|
|
|
my @bits = split(" ", shift);
|
|
|
|
|
|
|
|
if (grep { $_ eq "mdns4_minimal" || $_ eq "mdns4"
|
|
|
|
|| $_ eq "mdns6_minimal" || $_ eq "mdns6"
|
|
|
|
|| $_ eq "mdns_minimal" || $_ eq "mdns" } @bits) {
|
|
|
|
return join " ", @bits;
|
|
|
|
}
|
|
|
|
|
|
|
|
return join " ", map {
|
|
|
|
$_ eq "dns" ? ("mdns4_minimal", "[NOTFOUND=return]", $_) : $_
|
|
|
|
} @bits;
|
|
|
|
}
|
|
|
|
s/^(hosts:\s+)(.*)$/$1.insert($2)/e;
|
|
|
|
' /etc/nsswitch.conf
|
2007-03-14 12:34:05 +01:00
|
|
|
fi
|
|
|
|
|
2007-09-10 12:46:59 +02:00
|
|
|
%preun
|
|
|
|
# Perl-fu to remove mdns4_minimal from the hosts line of /etc/nsswitch.conf
|
|
|
|
if [ "$1" -eq 0 -a -f /etc/nsswitch.conf ] ; then
|
|
|
|
perl -ibak -pe '
|
|
|
|
my @remove = (
|
|
|
|
"mdns4_minimal [NOTFOUND=return]",
|
|
|
|
"mdns4_minimal",
|
|
|
|
"mdns4",
|
|
|
|
"mdns6_minimal [NOTFOUND=return]",
|
|
|
|
"mdns6_minimal",
|
|
|
|
"mdns6",
|
|
|
|
"mdns_minimal [NOTFOUND=return]",
|
|
|
|
"mdns_minimal",
|
|
|
|
"mdns",
|
|
|
|
);
|
|
|
|
sub remove {
|
|
|
|
my $s = shift;
|
|
|
|
foreach my $bit (@remove) {
|
|
|
|
$s =~ s/\s+\Q$bit\E//g;
|
|
|
|
}
|
|
|
|
return $s;
|
|
|
|
}
|
|
|
|
s/^(hosts:\s+)(.*)$/$1.remove($2)/e;
|
|
|
|
' /etc/nsswitch.conf
|
2007-03-14 12:34:05 +01:00
|
|
|
fi
|
|
|
|
|
|
|
|
%postun
|
|
|
|
/sbin/ldconfig
|
|
|
|
# Build a regexp removing all no more provided libraries.
|
|
|
|
# If there are no known libraries installed, remove also related "[NOTFOUND=return]"
|
|
|
|
REMOVE_REGEXP=
|
|
|
|
REAL_REMOVE=true
|
|
|
|
for NSS_NAME in mdns mdns4 mdns4_minimal mdns_minimal mdns6 mdns6_minimal ; do
|
|
|
|
if test -f %{_lib}/libnss_$NSS_NAME.so.2 ; then
|
|
|
|
REAL_REMOVE=false
|
|
|
|
else
|
|
|
|
REMOVE_REGEXP="${REMOVE_REGEXP}
|
|
|
|
s/\\([[:space:]][[:space:]]*\\)$NSS_NAME\\([[:space:]][[:space:]]*\\)/\\1/g;
|
|
|
|
s/\\([[:space:]][[:space:]]*\\)$NSS_NAME\$//g;"
|
|
|
|
fi
|
|
|
|
done
|
|
|
|
if $REAL_REMOVE ; then
|
|
|
|
REMOVE_REGEXP="s/\\(mdns[46]*_minimal\\)[[:space:]][[:space:]]*\\[NOTFOUND=return\\]/\\1/;$REMOVE_REGEXP"
|
|
|
|
fi
|
|
|
|
sed -i "/^hosts:/{$REMOVE_REGEXP}" etc/nsswitch.conf
|
|
|
|
|
|
|
|
%files
|
|
|
|
%defattr(-,root,root)
|
|
|
|
%doc LICENSE README doc/*.html doc/*.css
|
|
|
|
/%{_lib}/libnss_mdns.so.2
|
|
|
|
/%{_lib}/libnss_mdns4.so.2
|
|
|
|
/%{_lib}/libnss_mdns4_minimal.so.2
|
|
|
|
/%{_lib}/libnss_mdns6.so.2
|
|
|
|
/%{_lib}/libnss_mdns6_minimal.so.2
|
|
|
|
/%{_lib}/libnss_mdns_minimal.so.2
|
|
|
|
|
|
|
|
%clean
|
|
|
|
rm -rf $RPM_BUILD_ROOT
|
|
|
|
|
|
|
|
%changelog
|
2007-09-10 12:46:59 +02:00
|
|
|
* Thu Sep 06 2007 - mauro@suse.de
|
|
|
|
- Sync the spec with the scripts in the comment #6 of bnc #287583
|
|
|
|
* Thu Sep 06 2007 - mauro@suse.de
|
|
|
|
- The 64 bit version of nss-mdns will require the -32 version to
|
|
|
|
bugfix bnc #287383.
|
2007-04-22 01:00:50 +02:00
|
|
|
* Sat Apr 21 2007 - schwab@suse.de
|
|
|
|
- Fix unaligned access.
|
2007-03-14 12:34:05 +01:00
|
|
|
* Tue Feb 20 2007 - sbrabec@suse.cz
|
|
|
|
- New SuSE package, version 0.9.
|