From 3f0595a29a084615a45b790f641a606978a870e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fran=C3=A7ois-Xavier=20Deltombe?= Date: Thu, 9 Feb 2012 18:12:20 +0000 Subject: [PATCH] Create /var/lib/lemonldap-ng/notifications/ at install (Lemonldap-434) --- build/lemonldap-ng/Makefile | 18 +++++++++++++++++- .../debian/liblemonldap-ng-portal-perl.dirs | 1 + build/rpm/lemonldap-ng.spec | 2 ++ 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/build/lemonldap-ng/Makefile b/build/lemonldap-ng/Makefile index b3f91e08a..71095137b 100644 --- a/build/lemonldap-ng/Makefile +++ b/build/lemonldap-ng/Makefile @@ -68,6 +68,9 @@ RAPACHESESSIONFILEDIR=$(DESTDIR)/$(APACHESESSIONFILEDIR) APACHESESSIONFILELOCKDIR=$(APACHESESSIONFILEDIR)/lock RAPACHESESSIONFILELOCKDIR=$(DESTDIR)/$(APACHESESSIONFILELOCKDIR) +# Lemonldap-ng notifications storage dir +RFILENOTIFDIR=$(DESTDIR)/$(DATADIR)/notifications + # Apache user/group APACHEUSER= APACHEGROUP= @@ -382,7 +385,7 @@ install_doc_site: @install -v -d $(RDOCDIR) @cp -dR --remove-destination doc/* $(RDOCDIR) -install_conf_dir: install_sessions_dir +install_conf_dir: install_sessions_dir install_notif_dir # Configuration files install @install -v -d $(RCONFDIR) $(RFILECONFIGDIR) $(RTOOLSDIR) @if [ "$(ERASECONFIG)" -eq "1" ]; then \ @@ -419,6 +422,19 @@ install_sessions_dir: chmod 777 $(RAPACHESESSIONFILEDIR) $(RAPACHESESSIONFILELOCKDIR); \ fi +install_notif_dir: + @install -m 777 -v -d $(RFILENOTIFDIR) + # Fix notifications directory permissions + @if [ "$(APACHEUSER)" != "" ]; then \ + chown $(APACHEUSER) $(RFILENOTIFDIR) || exit 1; \ + if [ "$(APACHEGROUP)" != "" ]; then \ + chgrp $(APACHEGROUP) $(RFILENOTIFDIR) || exit 1; \ + fi; \ + chmod 770 $(RFILENOTIFDIR); \ + else \ + chmod 777 $(RFILENOTIFDIR); \ + fi + postconf_hosts: @cat ${CONFDIR}/for_etc_hosts >> /etc/hosts @echo "/etc/hosts was updated" diff --git a/build/lemonldap-ng/debian/liblemonldap-ng-portal-perl.dirs b/build/lemonldap-ng/debian/liblemonldap-ng-portal-perl.dirs index da4e5562e..8e28a0c30 100644 --- a/build/lemonldap-ng/debian/liblemonldap-ng-portal-perl.dirs +++ b/build/lemonldap-ng/debian/liblemonldap-ng-portal-perl.dirs @@ -5,3 +5,4 @@ /var/lib/lemonldap-ng/portal /var/lib/lemonldap-ng/sessions /var/lib/lemonldap-ng/sessions/lock +/var/lib/lemonldap-ng/notifications diff --git a/build/rpm/lemonldap-ng.spec b/build/rpm/lemonldap-ng.spec index a572dbe0c..b1413df33 100644 --- a/build/rpm/lemonldap-ng.spec +++ b/build/rpm/lemonldap-ng.spec @@ -322,6 +322,7 @@ chmod 640 %{buildroot}%{lm_vardir}/conf/* chmod 640 %{buildroot}%{lm_storagefile} chmod 770 %{buildroot}%{lm_vardir}/sessions chmod 770 %{buildroot}%{lm_vardir}/sessions/lock +chmod 770 %{buildroot}%{lm_vardir}/notifications # Touch for ghost mkdir -p $RPM_BUILD_ROOT%{apache_confdir} @@ -404,6 +405,7 @@ rm -rf %{buildroot} %dir %{lm_vardir}/conf %dir %{lm_vardir}/sessions %dir %{lm_vardir}/sessions/lock +%dir %{lm_vardir}/notifications %defattr(640,%{lm_apacheuser},%{lm_apachegroup},-) %config(noreplace) %{lm_vardir}/conf/lmConf-1