178 lines
5.3 KiB
RPMSpec
178 lines
5.3 KiB
RPMSpec
#
|
|
# spec file for package nss-mdns (Version 0.10)
|
|
#
|
|
# Copyright (c) 2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
|
#
|
|
# All modifications and additions to the file contributed by third parties
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
# upon. The license for this file, and modifications and additions to the
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
# license for the pristine package is not an Open Source License, in which
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
# published by the Open Source Initiative.
|
|
|
|
# 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.10
|
|
Release: 39
|
|
Group: Productivity/Networking/DNS/Utilities
|
|
License: LGPL v2.1 or later
|
|
Url: http://0pointer.de/lennart/projects/nss-mdns/
|
|
Summary: Host Name Resolution Via Multicast DNS (Zeroconf) for glibc
|
|
Source: %{name}-%{version}.tar.bz2
|
|
Patch: unaligned.diff
|
|
AutoReqProv: on
|
|
PreReq: sed grep
|
|
Requires: avahi
|
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|
|
|
%description
|
|
nss-mdns is a plug-in for the GNU Name Service Switch (NSS)
|
|
functionality of the GNU C Library (glibc) providing a hostname
|
|
resolution via Multicast DNS (aka Zeroconf, aka Apple Rendezvous, aka
|
|
Apple Bonjour), and effectively allowing name resolution by common
|
|
Unix/Linux programs in the ad-hoc mDNS domain .local.
|
|
|
|
nss-mdns provides only client functionality, which means that you have
|
|
to run a mDNS responder daemon seperately from nss-mdns if you want to
|
|
register the local hostname via mDNS. I recommend Avahi.
|
|
|
|
By default, nss-mdns tries to contact a running avahi-daemon to resolve
|
|
hostnames and addresses and makes use of its superior record cacheing.
|
|
|
|
|
|
|
|
Authors:
|
|
--------
|
|
Lennart Poettering <mzaffzqaf@0pointer.de>
|
|
|
|
%prep
|
|
%setup -q
|
|
%patch
|
|
|
|
%build
|
|
%configure --libdir=/%{_lib}
|
|
|
|
%install
|
|
%makeinstall
|
|
|
|
%post
|
|
/sbin/ldconfig
|
|
# 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
|
|
fi
|
|
|
|
%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
|
|
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
|
|
* Mon Oct 13 2008 ro@suse.de
|
|
- simplify and correct baselibs.conf
|
|
* Wed May 28 2008 olh@suse.de
|
|
- change the recommends for XXbit packages to a supplements
|
|
add a Conflicts: != version to the XXbit packages, to give a hint
|
|
during manual package upgrades (bnc#336678)
|
|
* Tue Apr 22 2008 coolo@suse.de
|
|
- degrading the requires to recommends. It's very well possible
|
|
to install a system with just 64bit
|
|
* Thu Apr 10 2008 ro@suse.de
|
|
- added baselibs.conf file to build xxbit packages
|
|
for multilib support
|
|
* Thu Apr 03 2008 hpj@suse.de
|
|
- Upgraded to version 0.10:
|
|
* Ported to FreeBSD.
|
|
* Alignment fixes for SPARC.
|
|
* Tue Sep 11 2007 ro@suse.de
|
|
- modify last change:
|
|
- require 32bit variant on x86_64 and s390x
|
|
- require 64bit variant on ppc
|
|
* Mon Sep 10 2007 sbrabec@suse.cz
|
|
- Fixed invalid dependency for bi-arch (#309193).
|
|
* Fri Sep 07 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 #287583.
|
|
* Sat Apr 21 2007 schwab@suse.de
|
|
- Fix unaligned access.
|
|
* Tue Feb 20 2007 sbrabec@suse.cz
|
|
- New SuSE package, version 0.9.
|