File libidmef.spec of Package libidmef

#
# spec file for package libidmef (Version 1.0.2)
#
# Copyright (c) 2009 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/
#

# norootforbuild


Name:           libidmef
BuildRequires:  dos2unix gcc-c++ libxml2-devel
Url:            http://sourceforge.net/projects/libidmef
Summary:        C Library for the Intrusion Detection Message Exchange Format (IDMEF)
Version:        1.0.2
Release:        1
License:        BSD 3-clause (or similar) ; GPL v2 or later
Group:          Development/Libraries/C and C++
Source:         libidmef-%{version}.tar.gz
Patch1:         libidmef-%{version}_cleanup_autoconf.diff
Patch2:         libidmef-%{version}_parser_fatal_error_handling.diff
BuildRoot:      %{_tmppath}/%{name}-%{version}-build

%description
Libidmef is a C implementation of the "Intrusion Detection Message
Exchange Format" (IDMEF) made by Silicon Defense.


%define library_name libidmef1
%define debug_package_requires %{library_name} = %{version}-%{release}

%package -n libidmef1
License:        BSD 3-clause (or similar) ; GPL v2 or later
Group:          Development/Libraries/C and C++
Summary:        C Library for the "Intrusion Detection Message Exchange Format" (IDMEF)
Requires:       %{library_name} = %{version}

%description -n libidmef1
Libidmef is a C implementation of the "Intrusion Detection Message
Exchange Format" (IDMEF) made by Silicon Defense.


%package devel
License:        BSD 3-clause (or similar) ; GPL v2 or later
Group:          Development/Libraries/C and C++
Summary:        C Library for the "Intrusion Detection Message Exchange Format" (IDMEF)
Requires:       %{library_name} = %{version}

%description devel
Libidmef is a C implementation of the "Intrusion Detection Message
Exchange Format" (IDMEF) made by Silicon Defense.



Authors:
--------
    Joe McAlerney, joey@silicondefense.com
    Adam Migus, NAI Labs, amigus@NAI.com

%prep
%setup -q
dos2unix ChangeLog
%patch1 -p1
%patch2 -p1

%build
%{?suse_update_config:%{suse_update_config -f .}}
cp libidmef-functions.map libidmef-functions-rfc.map
autoreconf -i -f
#LDFLAGS="$(xml2-config --libs)" \
#CFLAGS="$RPM_OPT_FLAGS $(xml2-config --cflags) -fno-strict-aliasing" \
%configure --disable-static --with-pic 
%{__make} %{?jobs:-j%jobs}

%install
# make directories
mkdir -p $RPM_BUILD_ROOT/etc/idmef/
mkdir -p $RPM_BUILD_ROOT/%{_libdir}
# install files
make DESTDIR=$RPM_BUILD_ROOT install
install xml/idmef-message.dtd $RPM_BUILD_ROOT/etc/idmef/
%{__rm} -f %{buildroot}%{_libdir}/*.la
#strip $RPM_BUILD_ROOT/%{_libdir}/libidmef.so.%{version}

%post   -n %{library_name} -p /sbin/ldconfig

%postun -n %{library_name} -p /sbin/ldconfig

%clean
rm -rf $RPM_BUILD_ROOT

%files -n %{library_name}
%defattr(-,root,root)
%doc AUTHORS COPYING ChangeLog INSTALL NEWS README TODO
%attr(755,root,root) %dir /etc/idmef
%attr(755,root,root) %dir /usr/share/idmef-messages
%attr(644,root,root) %config /etc/idmef/idmef-message.dtd
%attr(555,root,root) %{_libdir}/libidmef.so.*

%files devel
%defattr(-,root,root)
%doc AUTHORS COPYING ChangeLog INSTALL NEWS README TODO
%attr(755,root,root) %dir /usr/include/libidmef
%attr(755,root,root) %dir /etc/idmef
%attr(755,root,root) %dir /usr/share/idmef-messages
%attr(555,root,root) %{_libdir}/libidmef.so
#%attr(644,root,root) %config /etc/idmef/idmef-message.dtd
%attr(755,root,root) /usr/bin/libidmef-config
%attr(644,root,root) /usr/include/libidmef/idmef_create.h
%attr(644,root,root) /usr/include/libidmef/idmef_global.h
%attr(644,root,root) /usr/include/libidmef/idmef_list.h
%attr(644,root,root) /usr/include/libidmef/idmef_message.h
%attr(644,root,root) /usr/include/libidmef/idmef_parser.h
%attr(644,root,root) /usr/include/libidmef/idmef_parser_helpers.h
%attr(644,root,root) /usr/include/libidmef/idmef_strings.h
%attr(644,root,root) /usr/include/libidmef/idmef_types.h
%attr(644,root,root) %{_libdir}/pkgconfig/libidmef.pc
%attr(644,root,root) /usr/share/idmef-message.dtd
%attr(644,root,root) /usr/share/idmef-messages/example1.xml
%attr(644,root,root) /usr/share/idmef-messages/example10.xml
%attr(644,root,root) /usr/share/idmef-messages/example11.xml
%attr(644,root,root) /usr/share/idmef-messages/example12.xml
%attr(644,root,root) /usr/share/idmef-messages/example13.xml
%attr(644,root,root) /usr/share/idmef-messages/example14.xml
%attr(644,root,root) /usr/share/idmef-messages/example15.xml
%attr(644,root,root) /usr/share/idmef-messages/example16.xml
%attr(644,root,root) /usr/share/idmef-messages/example17.xml
%attr(644,root,root) /usr/share/idmef-messages/example18.xml
%attr(644,root,root) /usr/share/idmef-messages/example2.xml
%attr(644,root,root) /usr/share/idmef-messages/example20.xml
%attr(644,root,root) /usr/share/idmef-messages/example3.xml
%attr(644,root,root) /usr/share/idmef-messages/example4.xml
%attr(644,root,root) /usr/share/idmef-messages/example5.xml
%attr(644,root,root) /usr/share/idmef-messages/example6.xml
%attr(644,root,root) /usr/share/idmef-messages/example7.xml
%attr(644,root,root) /usr/share/idmef-messages/example8.xml
%attr(644,root,root) /usr/share/idmef-messages/example9.xml

%changelog