From 85647bf6552d097f39beea4fadf013e66844d89ba138187466b4d5ec0ec23960 Mon Sep 17 00:00:00 2001 From: Martin Pluskal Date: Mon, 18 Jan 2016 09:12:42 +0000 Subject: [PATCH] Accepting request 354484 from home:gladiac Add pam_wrapper from https://cwrap.org to devel:tools like the others ... OBS-URL: https://build.opensuse.org/request/show/354484 OBS-URL: https://build.opensuse.org/package/show/devel:tools/pam_wrapper?expand=0&rev=1 --- .gitattributes | 23 ++++ .gitignore | 1 + pam_wrapper-1.0.0-fix_obs_build.patch | 91 ++++++++++++++ pam_wrapper-1.0.0.tar.gz | 3 + pam_wrapper-rpmlintrc | 11 ++ pam_wrapper.changes | 5 + pam_wrapper.spec | 170 ++++++++++++++++++++++++++ 7 files changed, 304 insertions(+) create mode 100644 .gitattributes create mode 100644 .gitignore create mode 100644 pam_wrapper-1.0.0-fix_obs_build.patch create mode 100644 pam_wrapper-1.0.0.tar.gz create mode 100644 pam_wrapper-rpmlintrc create mode 100644 pam_wrapper.changes create mode 100644 pam_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/pam_wrapper-1.0.0-fix_obs_build.patch b/pam_wrapper-1.0.0-fix_obs_build.patch new file mode 100644 index 0000000..96b5600 --- /dev/null +++ b/pam_wrapper-1.0.0-fix_obs_build.patch @@ -0,0 +1,91 @@ +From 8b401834e1b33ba9dda530a1e9cd76beb54aec91 Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Thu, 14 Jan 2016 13:46:01 +0100 +Subject: [PATCH 1/3] cmake: Do not require a C++ compiler + +Signed-off-by: Andreas Schneider +--- + src/modules/CMakeLists.txt | 2 +- + src/python/CMakeLists.txt | 2 +- + 2 files changed, 2 insertions(+), 2 deletions(-) + +diff --git a/src/modules/CMakeLists.txt b/src/modules/CMakeLists.txt +index 93ce522..8e13a0b 100644 +--- a/src/modules/CMakeLists.txt ++++ b/src/modules/CMakeLists.txt +@@ -1,4 +1,4 @@ +-project(pam_wrapper-modules) ++project(pam_wrapper-modules C) + + set(PAM_MODULES pam_matrix pam_get_items pam_set_items) + +diff --git a/src/python/CMakeLists.txt b/src/python/CMakeLists.txt +index 108daae..2906d3e 100644 +--- a/src/python/CMakeLists.txt ++++ b/src/python/CMakeLists.txt +@@ -1,4 +1,4 @@ +-project(pypamtest) ++project(pypamtest C) + + include_directories(${CMAKE_BINARY_DIR}) + include_directories(${pam_wrapper-headers_DIR}) +-- +2.7.0 + + +From 8b41fc2429cfabdc3213b5baaa9fe5911936dc9f Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Thu, 14 Jan 2016 17:04:07 +0100 +Subject: [PATCH 2/3] cmake: Link python module against the python library + +Signed-off-by: Andreas Schneider +--- + src/python/CMakeLists.txt | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/python/CMakeLists.txt b/src/python/CMakeLists.txt +index 2906d3e..cbee2a6 100644 +--- a/src/python/CMakeLists.txt ++++ b/src/python/CMakeLists.txt +@@ -5,7 +5,7 @@ include_directories(${pam_wrapper-headers_DIR}) + include_directories(${PYTHON_INCLUDE_DIR}) + + python_add_module(pypamtest pypamtest.c) +-target_link_libraries(pypamtest pamtest) ++target_link_libraries(pypamtest pamtest ${PYTHON_LIBRARY}) + + install( + TARGETS +-- +2.7.0 + + +From 13ee3e87a0f4f96c5593f5c14db9c80c07ef4b95 Mon Sep 17 00:00:00 2001 +From: Andreas Schneider +Date: Thu, 14 Jan 2016 17:04:33 +0100 +Subject: [PATCH 3/3] pwrap: Return EPROTONOSUPPORT in audit_open() + +I don't know why but returning EINVAL doesn't work. It treats it as +success and tries to write to it. + +Signed-off-by: Andreas Schneider +--- + src/pam_wrapper.c | 2 +- + 1 file changed, 1 insertion(+), 1 deletion(-) + +diff --git a/src/pam_wrapper.c b/src/pam_wrapper.c +index 0c451d1..a388b29 100644 +--- a/src/pam_wrapper.c ++++ b/src/pam_wrapper.c +@@ -1523,7 +1523,7 @@ int audit_open(void) + * Tell the application that the kernel doesn't + * have audit compiled in. + */ +- errno = EINVAL; ++ errno = EPROTONOSUPPORT; + return -1; + } + +-- +2.7.0 + diff --git a/pam_wrapper-1.0.0.tar.gz b/pam_wrapper-1.0.0.tar.gz new file mode 100644 index 0000000..4457a97 --- /dev/null +++ b/pam_wrapper-1.0.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:0ee08bd5fd4443c64df7f96c794338176c34c053473b4fcd3e701802083d9d3f +size 84585 diff --git a/pam_wrapper-rpmlintrc b/pam_wrapper-rpmlintrc new file mode 100644 index 0000000..99a8915 --- /dev/null +++ b/pam_wrapper-rpmlintrc @@ -0,0 +1,11 @@ +# 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("shlib-fixed-dependency") +addFilter("shlib-policy-missing-suffix") +addFilter("devel-file-in-non-devel-package") diff --git a/pam_wrapper.changes b/pam_wrapper.changes new file mode 100644 index 0000000..2bad0f0 --- /dev/null +++ b/pam_wrapper.changes @@ -0,0 +1,5 @@ +------------------------------------------------------------------- +Thu Jan 14 16:13:36 UTC 2016 - asn@cryptomilk.org + +- Initial package + diff --git a/pam_wrapper.spec b/pam_wrapper.spec new file mode 100644 index 0000000..1f6ec35 --- /dev/null +++ b/pam_wrapper.spec @@ -0,0 +1,170 @@ +# +# spec file for package pam_wrapper +# +# Copyright (c) 2015 SUSE LINUX 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/ +# + + +############################# NOTE ################################## +# +# This is a special library. You are not able to link this library. +# Do NOT create library package or a devel package! +# +############################# NOTE ################################## + +Name: pam_wrapper +Version: 1.0.0 +Release: 0 + +Summary: A tool to test PAM applications and PAM modules +License: GPL-3.0+ +Group: Development/Libraries/C and C++ +Url: http://cwrap.org/ + +Source0: https://ftp.samba.org/pub/cwrap/%{name}-%{version}.tar.gz +Source1: %{name}-rpmlintrc + +Patch0: pam_wrapper-1.0.0-fix_obs_build.patch + +BuildRequires: cmake +BuildRequires: doxygen +BuildRequires: libcmocka-devel +BuildRequires: pam-devel +BuildRequires: python-devel +BuildRequires: pkg-config + +Recommends: pkg-config +Recommends: cmake + +%description +This component of cwrap allows you to either test your PAM (Linux-PAM +and OpenPAM) application or module. + +For testing PAM applications, simple PAM module called pam_matrix is +included. If you plan to test a PAM module you can use the pamtest library, +which simplifies testing of modules. You can combine it with the cmocka +unit testing framework or you can use the provided Python bindings to +write tests for your module in Python. + +This package doesn't have a devel package because this project is for +development/testing. + +%package -n libpamtest0 +Summary: A tool to test PAM applications and PAM modules +License: GPL-3.0+ +Requires: pam_wrapper = %{version}-%{release} + +%description -n libpamtest0 +If you plan to test a PAM module you can use this library, which simplifies +testing of modules. + +%package -n libpamtest-devel +Summary: A tool to test PAM applications and PAM modules +License: GPL-3.0+ +Requires: pam_wrapper = %{version}-%{release} +Requires: libpamtest0 = %{version}-%{release} + +Recommends: pkg-config +Recommends: cmake + +%description -n libpamtest-devel +If you plan to develop tests for a PAM module you can use this library, +which simplifies testing of modules. This subpackage includes the header +files for libpamtest + +%package -n libpamtest-devel-doc +Summary: The libpamtest API documentation +License: GPL-3.0+ + +%description -n libpamtest-devel-doc +Documentation for libpamtest development. + +%package -n python-libpamtest +Summary: A python wrapper for libpamtest +License: GPL-3.0+ +Requires: pam_wrapper = %{version}-%{release} +Requires: libpamtest0 = %{version}-%{release} + +%description -n python-libpamtest +If you plan to develop python tests for a PAM module you can use this +library, which simplifies testing of modules. This subpackage includes +the header files for libpamtest + +%prep +%setup -q + +%patch0 -p1 -b .pam_wrapper-1.0.0-fix_obs_build.patch + +%build +%cmake \ + -DUNIT_TESTING=ON + +make %{?_smp_mflags} VERBOSE=1 + +%install +%cmake_install + +%check +pushd build +make %{?_smp_mflags} test || cat $(find Testing -name "*.log") +make %{?_smp_mflags} doc +popd + +%post -p /sbin/ldconfig + +%postun -p /sbin/ldconfig + +%post -n libpamtest0 -p /sbin/ldconfig + +%postun -n libpamtest0 -p /sbin/ldconfig + +%files +%defattr(-,root,root) +%doc AUTHORS README ChangeLog COPYING +%{_libdir}/libpam_wrapper.so* +%{_libdir}/pkgconfig/pam_wrapper.pc +%dir %{_libdir}/cmake/pam_wrapper +%{_libdir}/cmake/pam_wrapper/pam_wrapper-config-version.cmake +%{_libdir}/cmake/pam_wrapper/pam_wrapper-config.cmake +%dir %{_libdir}/pam_wrapper +%{_libdir}/pam_wrapper/pam_matrix.so +%{_libdir}/pam_wrapper/pam_get_items.so +%{_libdir}/pam_wrapper/pam_set_items.so +%{_mandir}/man1/pam_wrapper.1* +%{_mandir}/man8/pam_matrix.8* +%{_mandir}/man8/pam_get_items.8* +%{_mandir}/man8/pam_set_items.8* + +%files -n libpamtest0 +%defattr(-,root,root,-) +%{_libdir}/libpamtest.so.* + +%files -n libpamtest-devel +%defattr(-,root,root,-) +%{_libdir}/libpamtest.so +%{_libdir}/pkgconfig/libpamtest.pc +%dir %{_libdir}/cmake/libpamtest +%{_libdir}/cmake/libpamtest/libpamtest-config-version.cmake +%{_libdir}/cmake/libpamtest/libpamtest-config.cmake +%{_includedir}/libpamtest.h + +%files -n libpamtest-devel-doc +%defattr(-,root,root) +%doc build/doc/html + +%files -n python-libpamtest +%defattr(-,root,root,-) +%{python_sitearch}/pypamtest.so + +%changelog