From ab60afe8c0fbd65e8bece6def1add1e26e488175aca8ac52a81bd97bd99c325e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lars=20M=C3=BCller?= Date: Thu, 13 Feb 2014 12:00:21 +0000 Subject: [PATCH] Accepting request 222159 from home:gladiac This is a special library for creating testing environments. OBS-URL: https://build.opensuse.org/request/show/222159 OBS-URL: https://build.opensuse.org/package/show/devel:tools/nss_wrapper?expand=0&rev=1 --- .gitattributes | 23 ++++++++++ .gitignore | 1 + nss_wrapper-1.0.1.tar.gz | 3 ++ nss_wrapper.changes | 5 +++ nss_wrapper.rpmlintrc | 9 ++++ nss_wrapper.spec | 95 ++++++++++++++++++++++++++++++++++++++++ 6 files changed, 136 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 nss_wrapper-1.0.1.tar.gz create mode 100644 nss_wrapper.changes create mode 100644 nss_wrapper.rpmlintrc create mode 100644 nss_wrapper.spec diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000..9b03811 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,23 @@ +## Default LFS +*.7z filter=lfs diff=lfs merge=lfs -text +*.bsp filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.gem filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.jar filter=lfs diff=lfs merge=lfs -text +*.lz filter=lfs diff=lfs merge=lfs -text +*.lzma filter=lfs diff=lfs merge=lfs -text +*.obscpio filter=lfs diff=lfs merge=lfs -text +*.oxt filter=lfs diff=lfs merge=lfs -text +*.pdf filter=lfs diff=lfs merge=lfs -text +*.png filter=lfs diff=lfs merge=lfs -text +*.rpm filter=lfs diff=lfs merge=lfs -text +*.tbz filter=lfs diff=lfs merge=lfs -text +*.tbz2 filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.ttf filter=lfs diff=lfs merge=lfs -text +*.txz filter=lfs diff=lfs merge=lfs -text +*.whl filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..57affb6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +.osc diff --git a/nss_wrapper-1.0.1.tar.gz b/nss_wrapper-1.0.1.tar.gz new file mode 100644 index 0000000..b7a1b35 --- /dev/null +++ b/nss_wrapper-1.0.1.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:c46498e1119bfc4bf8f7ce6db4b1bcff969043ab2ce04c54fdec29a2bf9034f2 +size 35957 diff --git a/nss_wrapper.changes b/nss_wrapper.changes new file mode 100644 index 0000000..636c07e --- /dev/null +++ b/nss_wrapper.changes @@ -0,0 +1,5 @@ +------------------------------------------------------------------- +Thu Feb 13 10:09:46 UTC 2014 - asn@cryptomilk.org + +- Initial package. + diff --git a/nss_wrapper.rpmlintrc b/nss_wrapper.rpmlintrc new file mode 100644 index 0000000..46c642d --- /dev/null +++ b/nss_wrapper.rpmlintrc @@ -0,0 +1,9 @@ +# This is a special library only for testing purposes. You cannot link this +# library. It is only inteded to be used with LD_PRELOAD. This package is +# the devel package. +# +# Learn more at http://cwrap.org +# +addFilter("shlib-policy-name-error") +addFilter("shared-lib-calls-exit") +addFilter("devel-file-in-non-devel-package") diff --git a/nss_wrapper.spec b/nss_wrapper.spec new file mode 100644 index 0000000..5d9f931 --- /dev/null +++ b/nss_wrapper.spec @@ -0,0 +1,95 @@ +# +# 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