File ldap-account-manager.spec of Package ldap-account-manager
#
# spec file for package ldap-account-manager
#
# Copyright (c) 2018 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/
#
%define tarversion 6_7
%define statedir %{_sharedstatedir}/%{name}
%define configdir %{statedir}/config
%define lam_uid wwwrun
%define lam_gid www
Name: ldap-account-manager
Version: 6.7
Release: 0
Summary: Administration of LDAP users, groups and hosts via Web GUI
License: GPL-3.0
Group: Productivity/Networking/Web/Frontends
Url: https://www.ldap-account-manager.org/
Source0: https://github.com/LDAPAccountManager/lam/archive/lam_%{tarversion}.tar.gz
Source1: %{name}.apache.conf
Source2: %{name}.nginx.conf
Source99: %{name}.rpmlintrc
Patch1: lam-6.7-manual-build-fix.diff
Patch2: lam-6.7-manual-doc-path-fix.diff
BuildRequires: make
BuildRequires: apache2
BuildRequires: nginx
BuildRequires: libxslt-tools
BuildRequires: docbook-xsl-stylesheets
Requires: perl
Requires: php
Requires: php-gd
Requires: php-gettext
Requires: php-hash
Requires: php-ldap
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
%description
LDAP Account Manager (LAM) runs on an existing webserver.
It manages user, group and host accounts. Currently LAM supports
these account types: Samba 3/4, Unix, Kolab 2/3, address book
entries, NIS mail aliases and MAC addresses. There is an integrated LDAP browser
to allow access to the raw LDAP attributes. You
can use templates for account creation and use multiple configuration
profiles. Account information can be exported as PDF file. There is also
a script included which manages quota and homedirectories.
%lang_package
%package apache
Summary: Apache config for lam
Group: Productivity/Networking/Web/Frontends
Requires: %{name} = %{version}-%{release}
Requires: apache2
%description apache
Apache configuration file for ldap-account-manager.
%package nginx
Summary: Nginx config for lam
Group: Productivity/Networking/Web/Frontends
Requires: %{name} = %{version}-%{release}
Requires: nginx
%description nginx
Nginx configuration file for ldap-account-manager.
%package daemon
Summary: Quota and home directory management for LDAP Account Manager
Group: Productivity/Networking/Web/Frontends
AutoReqProv: no
Requires: perl
Requires: sudo
%description daemon
ldap-account-manager-daemon is part of LDAP Account Manager. This package
needs to be installed on the server where the home directories
reside and/or quotas should be managed.
%prep
%setup -q -n lam-lam_%{tarversion}/lam
%patch1 -p1
%patch2 -p1
find . -name .gitignore -exec rm -f {} \;
find . -name .htaccess -exec rm -f {} \;
%build
cd docs/manual-sources
./make.sh
%install
mkdir -p %{buildroot}/%{_datadir}/%{name}
cp -dR * %{buildroot}/%{_datadir}/%{name}
mkdir -p %{buildroot}/var/lib/%{name}
mv %{buildroot}/%{_datadir}/%{name}/config %{buildroot}/var/lib/%{name}
ln -s /var/lib/%{name}/config %{buildroot}/%{_datadir}/%{name}/config
mkdir -p %{buildroot}/var/lib/%{name}/config/pdf
mkdir -p %{buildroot}/var/lib/%{name}/config/profiles
mv %{buildroot}/%{_datadir}/%{name}/tmp %{buildroot}/var/lib/%{name}
ln -s /var/lib/%{name}/tmp %{buildroot}/%{_datadir}/%{name}/tmp
mv %{buildroot}/%{_datadir}/%{name}/sess %{buildroot}/var/lib/%{name}
ln -s /var/lib/%{name}/sess %{buildroot}/%{_datadir}/%{name}/sess
mkdir -p %{buildroot}%{_sysconfdir}/%{name}
install -D -m0644 %{SOURCE1} %{buildroot}%{_sysconfdir}/apache2/conf.d/%{name}.conf
install -D -m0644 %{SOURCE2} %{buildroot}%{_sysconfdir}/nginx/conf.d/%{name}.conf
chmod 700 %{buildroot}/%{statedir}
rm -rf %{buildroot}/%{_datadir}/%{name}/po
rm -rf %{buildroot}/%{_datadir}/%{name}/docs/manual-sources
chmod a-x %{buildroot}/%{_datadir}/%{name}/docs/manual/style.css
chmod a-x %{buildroot}/%{_datadir}/%{name}/graphics/yubikey.png
%find_lang messages
%post
for server in apache2 nginx; do
if systemctl --quiet is-active ${server}; then
systemctl reload ${server}.service
fi
done
%postun
for server in apache2 nginx; do
if systemctl --quiet is-active ${server}; then
systemctl reload ${server}.service
fi
done
%files
%defattr(-, %{lam_uid}, %{lam_gid})
%doc HISTORY README VERSION
%license COPYING
%attr(-, root, root) %{_sysconfdir}/%{name}
%exclude %{_datadir}/%{name}/locale/*
%exclude %{_datadir}/%{name}/lib/lamdaemon.pl
%attr(-, root, root) %{_datadir}/%{name}
%dir %{statedir}
%{statedir}/sess
%{statedir}/tmp
%dir %{configdir}
%dir %{configdir}/templates
%dir %{configdir}/templates/pdf
%dir %{configdir}/templates/profiles
%dir %{configdir}/selfService
%dir %{configdir}/pdf
%dir %{configdir}/profiles
%{configdir}/*.sample
%{configdir}/language
%{configdir}/templates/pdf/logos
%config(noreplace) %{configdir}/templates/pdf/default.*
%config(noreplace) %{configdir}/templates/profiles/default.*
%config(noreplace) %{configdir}/selfService/.placeholder
%files lang -f messages.lang
%defattr(-,root,root)
%dir /usr/share/ldap-account-manager/locale/*
%dir /usr/share/ldap-account-manager/locale/*/LC_MESSAGES
%files apache
%defattr(-,root,root)
%dir %{_sysconfdir}/apache2
%dir %{_sysconfdir}/apache2/conf.d
%config(noreplace) %{_sysconfdir}/apache2/conf.d/%{name}.conf
%files nginx
%defattr(-,root,root)
%dir %{_sysconfdir}/nginx/
%dir %{_sysconfdir}/nginx/conf.d
%config(noreplace) %{_sysconfdir}/nginx/conf.d/%{name}.conf
%files daemon
%dir %{_datadir}/%{name}
%dir %{_datadir}/%{name}/lib
%{_datadir}/%{name}/lib/lamdaemon.pl
%changelog