Makefile and specfile changes for SuSE.
[shibboleth/cpp-opensaml.git] / opensaml.spec.in
index aad9ff0..d590e8f 100644 (file)
@@ -1,7 +1,7 @@
 Name:          opensaml
-Summary:       Open source SAML library
 Version:       @-VERSION-@
 Release:       1
+Summary:    OpenSAML SAML library
 Group:         System Environment/Libraries
 Vendor:                Internet2
 License:       Apache 2.0
@@ -10,42 +10,79 @@ Source0:    %{name}-%{version}.tar.gz
 BuildRoot:     %{_tmppath}/%{name}-%{version}-root
 %if 0%{?suse_version} > 1030
 BuildRequires:  libXerces-c-devel >= 2.8.0
+BuildRequires:  libxml-security-c-devel >= 1.4.0
+BuildRequires:  libxmltooling-devel >= 1.2
+%{?_with_log4cpp:BuildRequires: liblog4cpp-devel >= 1.0}
+%{!?_with_log4cpp:BuildRequires: liblog4shib-devel}
 %else
 BuildRequires:  xerces%{?xercesver}-c-devel >= 2.8.0
-%endif
 BuildRequires:  xml-security-c-devel >= 1.4.0
-BuildRequires: xmltooling-devel >= 1.2
+BuildRequires:  xmltooling-devel >= 1.2
 %{?_with_log4cpp:BuildRequires: log4cpp-devel >= 1.0}
 %{!?_with_log4cpp:BuildRequires: log4shib-devel}
+%endif
+BuildRequires:  gcc-c++
+%{!?_without_doxygen:BuildRequires: doxygen}
+
+%if "%{_vendor}" == "suse"
+%define pkgdocdir %{_docdir}/%{name}
+%else
+%define pkgdocdir %{_docdir}/%{name}-%{version}
+%endif
 
 %description
 OpenSAML is an open source implementation of the OASIS Security Assertion
 Markup Language Specification. It contains a set of open source C++ classes
 that support the SAML 1.0, 1.1, and 2.0 specifications.
 
-This package contains the saml runtime library.
+%if 0%{?suse_version} > 1030
+%package -n libsaml22
+Summary:    OpenSAML SAML library
+Group:      Development/Libraries
+Provides:   opensaml = %{version}
+
+%description -n libsaml22
+OpenSAML is an open source implementation of the OASIS Security Assertion
+Markup Language Specification. It contains a set of open source C++ classes
+that support the SAML 1.0, 1.1, and 2.0 specifications.
 
+This package contains just the shared library.
+%endif
+
+%if 0%{?suse_version} > 1030
+%package -n libsaml-devel
+Requires: libsaml22 = %version
+%else
 %package devel
+Requires: %name = %version
+%endif
 Summary: OpenSAML development Headers
 Group: Development/Libraries
-Requires: %{name} = %{version}
+%if 0%{?suse_version} > 1030
+Requires: libXerces-c-devel >= 2.8.0
+Requires: libxml-security-c-devel >= 1.4.0
+Requires: libxmltooling-devel >= 1.2
+%{?_with_log4cpp:Requires: liblog4cpp-devel >= 1.0}
+%{!?_with_log4cpp:Requires: liblog4shib-devel}
+%else
+Requires: xerces%{?xercesver}-c-devel >= 2.8.0
+Requires: xml-security-c-devel >= 1.4.0
 Requires: xmltooling-devel >= 1.2
+%{?_with_log4cpp:Requires: log4cpp-devel >= 1.0}
+%{!?_with_log4cpp:Requires: log4shib-devel}
+%endif
 
+%if 0%{?suse_version} > 1030
+%description -n libsaml-devel
+%else
 %description devel
+%endif
 OpenSAML is an open source implementation of the OASIS Security Assertion
 Markup Language Specification. It contains a set of open source C++ classes
 that support the SAML 1.0, 1.1, and 2.0 specifications.
 
-This package contains the headers and other necessary files to build
-applications or libraries that use or extend the saml library.
+This package includes files needed for development with opensaml.
 
-%package docs
-Summary: OpenSAML API Documentation
-Group: Development/Libraries
-Requires: %{name} = %{version}
-
-%description docs
-OpenSAML Library API documentation generated by doxygen.
 
 %prep
 %setup -q
@@ -55,10 +92,9 @@ OpenSAML Library API documentation generated by doxygen.
 %{__make}
 
 %install
-[ "$RPM_BUILD_ROOT" != "/" ] && %{__rm} -rf $RPM_BUILD_ROOT
-%{__make} install DESTDIR=$RPM_BUILD_ROOT
-find $RPM_BUILD_ROOT/%{_bindir} -type f |
-  %{__sed} -e "s|$RPM_BUILD_ROOT||" | sort > rpm.binlist
+%{__make} install DESTDIR=$RPM_BUILD_ROOT pkgdocdir=%{pkgdocdir}
+# Don't package unit tester if present.
+%{__rm} -f $RPM_BUILD_ROOT/%{_bindir}/samltest
 
 %check
 %{__make} check
@@ -66,35 +102,48 @@ find $RPM_BUILD_ROOT/%{_bindir} -type f |
 %clean
 [ "$RPM_BUILD_ROOT" != "/" ] && %{__rm} -rf $RPM_BUILD_ROOT
 
-%ifnos solaris2.8 solaris2.9 solaris2.10 
+%ifnos solaris2.8 solaris2.9 solaris2.10
+%if 0%{?suse_version} > 1030
+%post -n libsaml22 -p /sbin/ldconfig
+%else
 %post -p /sbin/ldconfig
 %endif
+%endif
 
-%ifnos solaris2.8 solaris2.9 solaris2.10 
+%ifnos solaris2.8 solaris2.9 solaris2.10
+%if 0%{?suse_version} > 1030
+%postun -n libsaml22 -p /sbin/ldconfig
+%else
 %postun -p /sbin/ldconfig
 %endif
+%endif
 
-%files -f rpm.binlist
+%files
+%defattr(-,root,root,-)
+%{_bindir}/samlsign
+%if 0%{?suse_version} > 1030
+%files -n libsaml22
 %defattr(-,root,root,-)
+%endif
 %{_libdir}/libsaml.so.*
 %dir %{_datadir}/xml/%{name}
 %{_datadir}/xml/%{name}
-%docdir %{_datadir}/doc/%{name}
-%{_datadir}/doc/%{name}/README.txt
-%{_datadir}/doc/%{name}/LICENSE.txt
-%{_datadir}/doc/%{name}/NOTICE.txt
-%{_datadir}/doc/%{name}/LOG4CPP.LICENSE
 
+%if 0%{?suse_version} > 1030
+%files -n libsaml-devel
+%else
 %files devel
+%endif
 %defattr(-,root,root,-)
-%{_includedir}
-%{_libdir}/libsaml.so
-
-%files docs
-%defattr(644,root,root,755)
-%doc %{_datadir}/doc/%{name}/api
+%{_includedir}/*
+%{_libdir}/*.so
+%doc %{pkgdocdir}
 
 %changelog
+* Sat Aug 8 2009  Scott Cantor  <cantor.2@osu.edu>  - 2.2.1-1
+- SuSE conventions
+- Stop packaging unit tester
+
 * Wed Dec 3 2008  Scott Cantor  <cantor.2@osu.edu>  - 2.2-1
 - Bumping for minor update.
 - Fixing SUSE Xerces dependency name.