File LConf.spec of Package lconf
#
# spec file for package lconf
#
# Copyright (c) 2013 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: LConf
Summary: LDAP based configuration tool for Icinga and Nagios
Version: 1.2
Release: 1
Url: https://www.netways.org/projects/lconf
License: GPL-2.0+
Group: System/Monitoring
BuildRequires: apache2-devel
%if 0%{?suse_version} > 1020
BuildRequires: fdupes
%endif
PreReq: apache2
Requires: openldap2 >= 2.3
Requires: perl(Net::LDAP)
Requires: openldap2-client
BuildRequires: perl(Net::LDAP)
BuildRequires: openldap2-client
Recommends: rsync
Source0: %name-%version.tar.bz2
Patch0: LConf-buildroot.patch
BuildArch: noarch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
%define apxs2 /usr/sbin/apxs2-prefork
%define apache2_sysconfdir %(%{apxs2} -q SYSCONFDIR)
%define installdir /srv/www/%{name}
%description
LConf is a LDAP based configuration tool for Icinga® and Nagios®. All
configuration elements are stored on a LDAP server and exported to text-based
configuration files. Icinga® / Nagios® uses only these config files and will
work independent from the LDAP during runtime.
%prep
%setup -q
%patch0 -p1
%build
%configure
%install
%{makeinstall}
mkdir -p %{buildroot}%{_bindir}
mkdir -p %{buildroot}%{_sysconfdir}/%{name}
mkdir -p %{buildroot}%{_prefix}/lib/%{name}
mv %{buildroot}/usr/LConf* %{buildroot}%{_bindir}/
mv %{buildroot}/usr/etc/* %{buildroot}%{_sysconfdir}/%{name}/
chmod -x %{buildroot}%{_sysconfdir}/%{name}/*
mv %{buildroot}/usr/lib/*.pm %{buildroot}%{_prefix}/lib/%{name}
rmdir %{buildroot}/usr/{tmp,var}
%clean
rm -rf %buildroot
%files
%defattr(0644,root,root,0755)
%doc src/*.ldif contrib LICENSE README
%defattr(-,root,root)
%{_bindir}/*
%dir %{_sysconfdir}/%{name}
%config(noreplace) %{_sysconfdir}/%{name}/*
%dir %{_prefix}/lib/%{name}
%{_prefix}/lib/%{name}/
%changelog