commit 5280fa826fdbb35c375db288d975e1a6634de9f2 Author: fun_yang Date: Fri Nov 29 15:51:24 2019 +0800 package init diff --git a/nss_wrapper-1.1.3.tar.gz b/nss_wrapper-1.1.3.tar.gz new file mode 100644 index 0000000..eb9a27e Binary files /dev/null and b/nss_wrapper-1.1.3.tar.gz differ diff --git a/nss_wrapper.spec b/nss_wrapper.spec new file mode 100644 index 0000000..fd1c00d --- /dev/null +++ b/nss_wrapper.spec @@ -0,0 +1,75 @@ +Name: nss_wrapper +Version: 1.1.3 +Release: 2 +License: BSD +Summary: A wrapper for the user, group and hosts NSS API +Url: https://cwrap.org/ +Source0: https://ftp.samba.org/pub/cwrap/%{name}-%{version}.tar.gz + +BuildRequires: cmake libcmocka-devel +Requires: cmake pkgconfig + +%description +Some projects provide daemons that need to be able to create, +modify, and delete Unix users. Or just switch user ID to interact +with the system e.g.User space file server. To be able to test whether +the user needs to modify the privileges of the passwd and groups files. +Use nss_wrapper to define your own passwd and groups files, and nss_wrapper +will use them to perform the correct operation in the test. +If you have clients and servers to test, you usually use functions to resolve +network names to addresses (dns) and vice versa. nss_wrappers allows +you to create a hosts file to set name resolution for addresses used +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. + +%package help +Summary: Introduce how to use nss_wrapper + +%description help +User's Manual for nss_wrapper + +%prep +%autosetup -n %{name}-%{version} -p1 + +%build +mkdir build +cd build +%cmake -DUNIT_TESTING=ON %{_builddir}/%{name}-%{version} +%make_build VERBOSE=1 + +%install +cd build +%make_install + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%check +cd build +make test + +%files +%doc AUTHORS COPYING +%{_bindir}/nss_wrapper.pl +%{_libdir}/libnss_wrapper.so* +%dir %{_libdir}/cmake/nss_wrapper +%{_libdir}/cmake/nss_wrapper/*.cmake +%{_libdir}/pkgconfig/nss_wrapper.pc + +%files help +%doc README ChangeLog +%{_mandir}/man1/nss_wrapper.1* + +%changelog +* Thu Nov 28 2019 yangjian - 1.1.3-2 +- Package init