nss_wrapper/nss_wrapper.spec
2014-02-13 12:00:21 +00:00

96 lines
2.6 KiB
RPMSpec

#
# spec file for package nss_wrapper
#
# Copyright (c) 2014 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/
#
Name: nss_wrapper
Version: 1.0.1
Release: 0
Summary: A wrapper for the user, group and hosts NSS API
License: BSD-3-Clause
Group: Development/Libraries/C and C++
Url: http://cwrap.org/
Source0: https://ftp.samba.org/pub/cwrap/%{name}-%{version}.tar.gz
BuildRequires: cmake
BuildRequires: libcmocka-devel
BuildRequires: netcfg
%description
There are projects which provide daemons needing to be able to create, modify
and delete Unix users. Or just switch user ids to interact with the system e.g.
a user space file server. To be able to test that you need the privilege to
modify the passwd and groups file. With nss_wrapper it is possible to define
your own passwd and groups file which will be used by software to act correctly
while under test.
If you have a client and server under test they normally use functions to
resolve network names to addresses (dns) or vice versa. The nss_wrappers allow
you to create a hosts file to setup name resolution for the addresses you use
with socket_wrapper.
To use it set the following environment variables:
LD_PRELOAD=libuid_wrapper.so
NSS_WRAPPER_PASSWD=/path/to/passwd
NSS_WRAPPER_GROUP=/path/to/group
NSS_WRAPPER_HOSTS=/path/to/host
This package doesn't have a devel package cause this project is for
development/testing.
%prep
%setup -q
%build
%cmake \
-DUNIT_TESTING=ON \
%{_builddir}/%{name}-%{version}
%__make %{?jobs:-j%jobs} VERBOSE=1
%install
pushd build
%makeinstall
popd
%check
pushd build
%__make test
popd
%clean
%__rm -rf %{buildroot}
%post -p /sbin/ldconfig
%postun -p /sbin/ldconfig
%files
%defattr(-,root,root)
%doc AUTHORS README ChangeLog COPYING
%{_bindir}/nss_wrapper.pl
%{_libdir}/libnss_wrapper.so*
%dir %{_libdir}/cmake
%{_libdir}/cmake/nss_wrapper-config-version.cmake
%{_libdir}/cmake/nss_wrapper-config.cmake
%dir %{_libdir}/pkgconfig
%{_libdir}/pkgconfig/nss_wrapper.pc
%changelog