From 153abacf58f29af71be72aa88791ecfd68a9d82c Mon Sep 17 00:00:00 2001 From: Mattias Ellert Date: May 29 2010 09:51:45 +0000 Subject: - New upstream release 5.1.5 - Get rid of lsb initscript dependency --- diff --git a/.cvsignore b/.cvsignore index e69de29..a73f6da 100644 --- a/.cvsignore +++ b/.cvsignore @@ -0,0 +1 @@ +bdii-5.1.5.tar.gz diff --git a/bdii-init.patch b/bdii-init.patch new file mode 100644 index 0000000..2268df4 --- /dev/null +++ b/bdii-init.patch @@ -0,0 +1,140 @@ +diff -ur bdii-5.1.5.orig/etc/init.d/bdii bdii-5.1.5/etc/init.d/bdii +--- bdii-5.1.5.orig/etc/init.d/bdii 2010-05-23 15:53:06.176116947 +0200 ++++ bdii-5.1.5/etc/init.d/bdii 2010-05-23 19:01:17.577368324 +0200 +@@ -18,12 +18,24 @@ + + shopt -s expand_aliases + +-if [ -f /lib/lsb/init-functions ]; then +- . /lib/lsb/init-functions ++if [ -f /etc/init.d/functions ]; then ++ . /etc/init.d/functions + else +- echo "Error: Cannot source /lib/lsb/init-functions" ++ echo "Error: Cannot source /etc/init.d/functions" + fi + ++log_success_msg () ++{ ++ success ++ echo ++} ++ ++log_failure_msg() ++{ ++ failure ++ echo ++} ++ + prog=bdii + lockfile=/var/lock/subsys/$prog + +@@ -95,7 +107,7 @@ + sudo -u ${BDII_USER} cp ${DB_CONFIG} ${SLAPD_DB_DIR}/stats/ + sudo -u ${BDII_USER} cp ${DB_CONFIG} ${SLAPD_DB_DIR}/glue2/ + +- echo -n "Starting SLAPD: " ++ echo -n "Starting BDII slapd: " + COMMAND="${SLAPD} -f ${SLAPD_CONF} -h ldap://$(hostname -f):${SLAPD_PORT} -u ${BDII_USER}" + ${COMMAND} + touch ${SLAPD_LOCK_FILE} +@@ -111,7 +123,7 @@ + fi + + if [ ${RETVAL} -gt 0 ]; then +- echo -n "SLAPD failed to start" 1>&2 ++ echo -n "BDII slapd failed to start" 1>&2 + + rm -f ${SLAPD_LOCK_FILE} + eval log_failure_msg +@@ -139,9 +151,9 @@ + RETVAL=1 + fi + +- echo -n "Starting update process: " ++ echo -n "Starting BDII update process: " + if [ ${RETVAL} -gt 0 ]; then +- echo -n "Update process failed to start" 1>&2 ++ echo -n "BDII update process failed to start" 1>&2 + rm -f ${UPDATE_LOCK_FILE} + eval log_failure_msg + return 1 +@@ -158,18 +170,18 @@ + if [ ! -f "${SLAPD_LOCK_FILE}" ] && [ ! -f "${UPDATE_LOCK_FILE}" ]; then + echo -n "Stopping BDII: " + result=$($0 status) +- if [ $? -gt 0 ]; then ++ if [ $? -gt 0 -a $? -ne 3 ]; then + echo ${result} 1>&2 + return 1 + else +- echo "BDII Already stopped" ++ echo "BDII already stopped" + return 0 + fi + fi + + RETVAL=0 + +- echo -n "Stopping update process: " ++ echo -n "Stopping BDII update process: " + + if [ -f "${UPDATE_PID_FILE}" ]; then + UPDATE_PID=$(cat ${UPDATE_PID_FILE}) +@@ -186,7 +198,7 @@ + sleep 2 + ps ${UPDATE_PID} >/dev/null 2>&1 + if [ $? = 0 ]; then +- echo -n "Could not kill update process ${UPDATE_PID}" 1>&2 ++ echo -n "Could not kill BDII update process ${UPDATE_PID}" 1>&2 + RETVAL=1 + fi + fi +@@ -201,7 +213,7 @@ + eval log_failure_msg + fi + +- echo -n "Stopping SLAPD: " ++ echo -n "Stopping BDII slapd: " + + if [ -f "${SLAPD_PID_FILE}" ]; then + SLAPD_PID=$(cat ${SLAPD_PID_FILE}) +@@ -218,7 +230,7 @@ + sleep 2 + ps ${SLAPD_PID} >/dev/null 2>&1 + if [ $? = 0 ]; then +- echo -n "Could not kill slapd process ${SLAPD_PID}" 1>&2 ++ echo -n "Could not kill BDII slapd process ${SLAPD_PID}" 1>&2 + RETVAL=2 + else + rm -f {SLAPD_PID_FILE} +@@ -253,12 +265,12 @@ + if [ -f ${SLAPD_PID_FILE} ]; then + ps $(cat ${SLAPD_PID_FILE}) >/dev/null 2>&1 + if [ ! $? = 0 ]; then +- echo -n "SLAPD PID file exists but the process died" 1>&2 ++ echo -n "BDII slapd PID file exists but the process died" 1>&2 + eval log_failure_msg + return 1 + fi + else +- echo -n "SLAPD PID file ${SLAPD_PID_FILE} does not exist" 1>&2 ++ echo -n "BDII slapd PID file ${SLAPD_PID_FILE} does not exist" 1>&2 + eval log_failure_msg + return 1 + fi +@@ -266,12 +278,12 @@ + if [ -f ${UPDATE_PID_FILE} ]; then + ps $(cat ${UPDATE_PID_FILE}) >/dev/null 2>&1 + if [ ! $? = 0 ]; then +- echo -n "Update process died" 1>&2 ++ echo -n "BDII update process died" 1>&2 + eval log_failure_msg + return 1 + fi + else +- echo -n "Update process failed to start" 1>&2 ++ echo -n "BDII update process failed to start" 1>&2 + eval log_failure_msg + return 1 + fi diff --git a/bdii.spec b/bdii.spec new file mode 100644 index 0000000..9c1a355 --- /dev/null +++ b/bdii.spec @@ -0,0 +1,148 @@ +Name: bdii +Version: 5.1.5 +Release: 1%{?dist} +Summary: The Berkeley Database Information Index (BDII) + +Group: System Environment/Daemons +License: ASL 2.0 +URL: https://twiki.cern.ch/twiki/bin/view/EGEE/BDII +# The source tarball is created from a svn checkout: +# svn co http://svnweb.cern.ch/guest/gridinfo/bdii/tags/R_5_1_5 bdii-5.1.5 +# tar -z -c --exclude .svn -f bdii-5.1.5.tar.gz bdii-5.1.5 +Source: %{name}-%{version}.tar.gz +Patch0: %{name}-init.patch +BuildArch: noarch +BuildRoot: %{_tmppath}/%{name}-%{version}-build + +Requires: openldap-clients +Requires: openldap-servers +Requires: glue-schema >= 2.0.0 +Requires: globus-proxy-utils +Requires: sudo + +Requires(post): chkconfig +Requires(post): expect +Requires(preun): chkconfig +Requires(preun): initscripts +Requires(preun): sudo +Requires(postun): initscripts +Requires(postun): sudo + +%if %{?fedora}%{!?fedora:0} >= 5 || %{?rhel}%{!?rhel:0} >= 5 +Requires(post): policycoreutils +Requires(postun): policycoreutils +%if %{?fedora}%{!?fedora:0} >= 11 || %{?rhel}%{!?rhel:0} >= 6 +Requires(post): policycoreutils-python +Requires(postun): policycoreutils-python +%endif +%endif + +%description +The Berkeley Database Information Index (BDII) consists of a standard +LDAP database which is updated by an external process. The update process +obtains LDIF from a number of sources and merges them. It then compares +this to the contents of the database and creates an LDIF file of the +differences. This is then used to update the database. + +%prep +%setup -q +%patch0 -p1 + +# Fix install paths +sed 's!/opt/glite/etc!/var/lib/bdii!g' -i Makefile +sed 's!/opt/glite/etc!/var/lib/bdii!g' -i etc/bdii.conf + +%build +# Nothing to build + +%install +rm -rf %{buildroot} +make install prefix=%{buildroot} + +# Turn off default enabling of the service +if [ -f %{buildroot}%{_initrddir}/%{name} ]; then + sed -e 's/\(chkconfig: \)\w*/\1-/' \ + -e '/Default-Start/d' \ + -e 's/\(Default-Stop:\s*\).*/\10 1 2 3 4 5 6/' \ + -i %{buildroot}%{_initrddir}/%{name} +else + mkdir -p %{buildroot}%{_initrddir} + sed -e 's/\(chkconfig: \)\w*/\1-/' \ + -e '/Default-Start/d' \ + -e 's/\(Default-Stop:\s*\).*/\10 1 2 3 4 5 6/' \ + %{buildroot}%{_sysconfdir}/init.d/%{name} > \ + %{buildroot}%{_initrddir}/%{name} + chmod 0755 %{buildroot}%{_initrddir}/%{name} + rm %{buildroot}%{_sysconfdir}/init.d/%{name} +fi + +mkdir -p %{buildroot}%{_localstatedir}/run/%{name} + +%clean +rm -rf %{buildroot} + +%post +sed "s/\(rootpw *\)secret/\1$(mkpasswd -s 0 | tr '/' 'x')/" \ + -i %{_sysconfdir}/%{name}/bdii-slapd.conf +/sbin/chkconfig --add %{name} +%if %{?fedora}%{!?fedora:0} >= 5 || %{?rhel}%{!?rhel:0} >= 5 +semanage port -a -t ldap_port_t -p tcp 2170 2>/dev/null || : +semanage fcontext -a -t slapd_db_t "%{_localstatedir}/run/%{name}(/.*)?" 2>/dev/null || : +restorecon -R %{_localstatedir}/run/%{name} || : +%endif + +%preun +if [ $1 -eq 0 ]; then + service %{name} stop > /dev/null 2>&1 + /sbin/chkconfig --del %{name} +fi + +%postun +if [ $1 -ge 1 ]; then + service %{name} condrestart > /dev/null 2>&1 +fi +%if %{?fedora}%{!?fedora:0} >= 5 || %{?rhel}%{!?rhel:0} >= 5 +if [ $1 -eq 0 ]; then + semanage port -d -t ldap_port_t -p tcp 2170 2>/dev/null || : + semanage fcontext -d -t slapd_db_t "%{_localstatedir}/run/%{name}(/.*)?" 2>/dev/null || : +fi +%endif + +%files +%defattr(-,root,root,-) +%attr(-,ldap,ldap) %{_localstatedir}/lib/%{name} +%attr(-,ldap,ldap) %{_localstatedir}/log/%{name} +%attr(-,ldap,ldap) %{_localstatedir}/run/%{name} +%dir %{_sysconfdir}/%{name} +%config(noreplace) %{_sysconfdir}/%{name}/DB_CONFIG +%config(noreplace) %{_sysconfdir}/%{name}/bdii.conf +%config(noreplace) %{_sysconfdir}/%{name}/BDII.schema +%config(noreplace) %{_sysconfdir}/%{name}/bdii-slapd.conf +%config(noreplace) %{_sysconfdir}/logrotate.d/%{name} +%config(noreplace) %{_sysconfdir}/cron.d/bdii-proxy +%{_initrddir}/%{name} +%{_sbindir}/bdii-update +%{_sbindir}/bdii-proxy +%doc copyright + +%changelog +* Sun May 23 2010 Mattias Ellert - 5.1.5-1 +- New upstream release 5.1.5 +- Get rid of lsb initscript dependency + +* Mon Apr 05 2010 Mattias Ellert - 5.1.0-1 +- New upstream verison 5.1.0 +- Add SELinux context management to scriptlets + +* Thu Mar 25 2010 Mattias Ellert - 5.0.8-4.460 +- Update (svn revision 460) +- Use proper anonymous svn checkout instead of svnweb generated tarball + +* Fri Feb 26 2010 Mattias Ellert - 5.0.8-3.443 +- Update (svn revision 443) + +* Wed Feb 24 2010 Mattias Ellert - 5.0.8-2.436 +- Update (svn revision 436) + +* Mon Feb 08 2010 Mattias Ellert - 5.0.8-1.375 +- Initial package (svn revision 375) diff --git a/import.log b/import.log new file mode 100644 index 0000000..9d3d617 --- /dev/null +++ b/import.log @@ -0,0 +1 @@ +bdii-5_1_5-1_fc12:EL-5:bdii-5.1.5-1.fc12.src.rpm:1275126691 diff --git a/sources b/sources index e69de29..b05b016 100644 --- a/sources +++ b/sources @@ -0,0 +1 @@ +afcb5450c5615c19514841fb4283b27a bdii-5.1.5.tar.gz