%define pkgname dirsrv Summary: 389 Directory Server (base) Name: 389-ds-base Version: 1.2.4 Release: 1%{?dist} License: GPLv2 with exceptions URL: http://port389.org/ Group: System Environment/Daemons BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) Provides: fedora-ds-base = %{version}-%{release} Obsoletes: fedora-ds-base < 1.2.1-1 BuildRequires: nspr-devel BuildRequires: nss-devel BuildRequires: svrcore-devel BuildRequires: mozldap-devel BuildRequires: db4-devel BuildRequires: cyrus-sasl-devel BuildRequires: icu BuildRequires: libicu-devel BuildRequires: pcre-devel # The following are needed to build the snmp ldap-agent BuildRequires: net-snmp-devel %ifnarch sparc sparc64 ppc ppc64 s390 s390x BuildRequires: lm_sensors-devel %endif BuildRequires: bzip2-devel BuildRequires: zlib-devel BuildRequires: openssl-devel BuildRequires: tcp_wrappers BuildRequires: libselinux-devel # the following is for the pam passthru auth plug-in BuildRequires: pam-devel # the following are needed for some of our scripts Requires: mozldap-tools Requires: perl-Mozilla-LDAP # this is needed to setup SSL if you are not using the # administration server package Requires: nss-tools # these are not found by the auto-dependency method # they are required to support the mandatory LDAP SASL mechs Requires: cyrus-sasl-gssapi Requires: cyrus-sasl-md5 # this is needed for verify-db.pl Requires: db4-utils # This picks up libperl.so as a Requires, so we add this versioned one Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version)) # This is for the fedora-ds -> 389 run level hack Requires(posttrans): /sbin/service # for the init script Requires(post): /sbin/chkconfig Requires(preun): /sbin/chkconfig Requires(preun): /sbin/service Source0: http://port389.org/sources/%{name}-%{version}.tar.bz2 # 389-ds-git.sh should be used to generate the source tarball from git Source1: %{name}-git.sh Source2: %{name}-devel.README %description 389 Directory Server is an LDAPv3 compliant server. The base package includes the LDAP server and command line utilities for server administration. %package devel Summary: Development libraries for 389 Directory Server Group: Development/Libraries Requires: %{name} = %{version}-%{release} Requires: mozldap-devel Provides: fedora-ds-base-devel = %{version}-%{release} Obsoletes: fedora-ds-base-devel < 1.2.1-1 %description devel Development Libraries and headers for the 389 Directory Server base package. %prep %setup -q -n %{name}-%{version} cp %{SOURCE2} README.devel %build %configure --enable-autobind # Generate symbolic info for debuggers export XCFLAGS=$RPM_OPT_FLAGS %ifarch x86_64 ppc64 ia64 s390x sparc64 export USE_64=1 %endif make %{?_smp_mflags} %install rm -rf $RPM_BUILD_ROOT make DESTDIR="$RPM_BUILD_ROOT" install mkdir -p $RPM_BUILD_ROOT/var/log/%{pkgname} mkdir -p $RPM_BUILD_ROOT/var/lib/%{pkgname} mkdir -p $RPM_BUILD_ROOT/var/lock/%{pkgname} mkdir -p $RPM_BUILD_ROOT%{_includedir}/%{pkgname} #remove libtool and static libs rm -f $RPM_BUILD_ROOT%{_libdir}/%{pkgname}/*.a rm -f $RPM_BUILD_ROOT%{_libdir}/%{pkgname}/*.la rm -f $RPM_BUILD_ROOT%{_libdir}/%{pkgname}/plugins/*.a rm -f $RPM_BUILD_ROOT%{_libdir}/%{pkgname}/plugins/*.la install -p -m 644 ldap/servers/slapd/slapi-plugin.h $RPM_BUILD_ROOT%{_includedir}/%{pkgname}/ install -p -m 644 ldap/servers/plugins/replication/winsync-plugin.h $RPM_BUILD_ROOT%{_includedir}/%{pkgname}/ # make sure perl scripts have a proper shebang sed -i -e 's|#{{PERL-EXEC}}|#!/usr/bin/perl|' $RPM_BUILD_ROOT%{_datadir}/%{pkgname}/script-templates/template-*.pl %clean rm -rf $RPM_BUILD_ROOT %pre -p -- see if fedora-ds-base exists - if so, save the run level configuration -- and set a flag that tells us to restore that config in %posttrans -- and restart the server -- we can get rid of this code once Fedora 11 becomes obsolete rc = os.execute('rpm --quiet -q fedora-ds-base') if rc == 0 then %{pkgname}_exists = true %{pkgname}_savelinks = {} for dir in posix.files("%{_sysconfdir}/rc.d") do if string.find(dir, "rc%d.d") then -- print("looking in %{_sysconfdir}/rc.d/"..dir) for link in posix.files("%{_sysconfdir}/rc.d/"..dir) do if string.find(link, "[SK]%d%d%{pkgname}") then fullname = "%{_sysconfdir}/rc.d/"..dir.."/"..link linked = posix.readlink(fullname) -- print(fullname.." is linked to "..linked) %{pkgname}_savelinks[fullname] = linked end end end end end %post -p os.execute('/sbin/chkconfig --add %{pkgname}') os.execute('/sbin/ldconfig') os.execute('/sbin/chkconfig --add %{pkgname}-snmp') -- this has been problematic - if this directory -- does not exist, the server will silently fail to -- start - however, if the user has already created -- it, we don't want to overwrite the permissions -- on it - so we can't list it explicitly in the -- files section - we list it as a ghost so that -- it will be removed when the rpm is removed if not posix.access("%{_localstatedir}/run/%{pkgname}") then posix.mkdir("%{_localstatedir}/run/%{pkgname}") end -- since posttrans is not passed the upgrade status, we get -- it here if (arg[2] > 1) or %{pkgname}_exists then -- print("in %{pkgname} post - upgrading") %{pkgname}_upgrading = true else -- print("in %{pkgname} post - installing") %{pkgname}_upgrading = false end %preun if [ $1 = 0 ]; then /sbin/service %{pkgname} stop >/dev/null 2>&1 || : /sbin/chkconfig --del %{pkgname} /sbin/service %{pkgname}-snmp stop >/dev/null 2>&1 || : /sbin/chkconfig --del %{pkgname}-snmp fi %postun -p /sbin/ldconfig %posttrans -p -- if we saved the run level configuration in %pre, restore it now -- we can get rid of this code once Fedora 11 becomes obsolete if %{pkgname}_savelinks then for fullpath,link in pairs(%{pkgname}_savelinks) do posix.symlink(link,fullpath) -- print("posttrans - restored run level "..fullpath.." to "..link) end end if %{pkgname}_upgrading then instbase = "%{_sysconfdir}/%{pkgname}" -- print("posttrans - upgrading - looking for instances in "..instbase) -- find all instances instances = {} -- instances that require a restart after upgrade for dir in posix.files(instbase) do -- print("dir="..dir) if string.find(dir,"^slapd-") and not string.find(dir,"\.removed$") then inst = string.gsub(dir,"^slapd[-]", "") -- print("found instance "..inst.." getting status") rc = os.execute('/sbin/service %{pkgname} status '..inst..' >/dev/null 2>&1') -- if instance is running, we must restart it after upgrade if rc == 0 then instances[inst] = inst -- print("instance "..inst.." is running") -- else -- print("instance "..inst.." is shutdown") end end end -- shutdown all instances -- print("shutting down all instances . . .") os.execute('/sbin/service %{pkgname} stop > /dev/null 2>&1') -- do the upgrade -- print("upgrading instances . . .") os.execute('%{_sbindir}/setup-ds.pl -l /dev/null -u -s General.UpdateMode=offline > /dev/null 2>&1') -- restart instances that require it for inst,dummy in pairs(instances) do -- print("restarting instance "..inst) os.execute('/sbin/service %{pkgname} start '..inst..' >/dev/null 2>&1') end end -- if we upgraded from fedora to 389, the upgrade will shutdown -- all old running instances, so we have to start them here if %{pkgname}_exists then -- print("restarting all instances due to package rename") os.execute('/sbin/service %{pkgname} start >/dev/null 2>&1') end %files %defattr(-,root,root,-) %doc LICENSE EXCEPTION LICENSE.GPLv2 %dir %{_sysconfdir}/%{pkgname} %dir %{_sysconfdir}/%{pkgname}/schema %config(noreplace)%{_sysconfdir}/%{pkgname}/schema/*.ldif %dir %{_sysconfdir}/%{pkgname}/config %config(noreplace)%{_sysconfdir}/%{pkgname}/config/slapd-collations.conf %config(noreplace)%{_sysconfdir}/%{pkgname}/config/certmap.conf %config(noreplace)%{_sysconfdir}/%{pkgname}/config/ldap-agent.conf %config(noreplace)%{_sysconfdir}/%{pkgname}/config/template-initconfig %config(noreplace)%{_sysconfdir}/sysconfig/%{pkgname} %{_datadir}/%{pkgname} %{_sysconfdir}/rc.d/init.d/%{pkgname} %{_sysconfdir}/rc.d/init.d/%{pkgname}-snmp %{_bindir}/* %{_sbindir}/* %dir %{_libdir}/%{pkgname} %{_libdir}/%{pkgname}/*.so.* %{_libdir}/%{pkgname}/perl %dir %{_libdir}/%{pkgname}/plugins %{_libdir}/%{pkgname}/plugins/*.so %dir %{_localstatedir}/lib/%{pkgname} %dir %{_localstatedir}/log/%{pkgname} %dir %{_localstatedir}/lock/%{pkgname} %{_mandir}/man1/* %{_mandir}/man8/* %files devel %defattr(-,root,root,-) %doc LICENSE EXCEPTION LICENSE.GPLv2 README.devel %{_includedir}/%{pkgname} %{_libdir}/%{pkgname}/*.so %changelog * Thu Oct 29 2009 Rich Megginson - 1.2.4-1 - 1.2.4 release - resolves bug 221905 - added support for Salted MD5 (SMD5) passwords - primarily for migration - resolves bug 529258 - Make upgrade remove obsolete schema from 99user.ldif * Mon Sep 14 2009 Rich Megginson - 1.2.3-1 - 1.2.3 release - added template-initconfig to %files - %posttrans now runs update to update the server instances - servers are shutdown, then restarted if running before install - scriptlets mostly use lua now to pass data among scriptlet phases * Tue Sep 01 2009 Caolán McNamara - 1.2.2-2 - rebuild with new openssl to fix dependencies * Tue Aug 25 2009 Rich Megginson - 1.2.2-1 - backed out - added template-initconfig to %files - this change is for the next major release - bump version to 1.2.2 - fix reopened 509472 db2index all does not reindex all the db backends correctly - fix 518520 - pre hashed salted passwords do not work - see https://bugzilla.redhat.com/show_bug.cgi?id=518519 for the list of - bugs fixed in 1.2.2 * Fri Aug 21 2009 Tomas Mraz - 1.2.1-5 - rebuilt with new openssl * Wed Aug 19 2009 Noriko Hosoi - 1.2.1-4 - added template-initconfig to %files * Wed Aug 12 2009 Rich Megginson - 1.2.1-3 - added BuildRequires pcre * Fri Jul 24 2009 Fedora Release Engineering - 1.2.1-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_12_Mass_Rebuild * Mon May 18 2009 Rich Megginson - 1.2.1-1 - change name to 389 - change version to 1.2.1 - added initial support for numeric string syntax - added initial support for syntax validation - added initial support for paged results including sorting * Tue Apr 28 2009 Rich Megginson - 1.2.0-4 - final release 1.2.0 - Resolves: bug 475338 - LOG: the intenal type of maxlogsize, maxdiskspace and minfreespace should be 64-bit integer - Resolves: bug 496836 - SNMP ldap-agent on Solaris: Unable to open semaphore for server: 389 - CVS tag: FedoraDirSvr_1_2_0 FedoraDirSvr_1_2_0_20090428 * Mon Apr 6 2009 Rich Megginson - 1.2.0-3 - re-enable ppc builds * Thu Apr 2 2009 Rich Megginson - 1.2.0-2 - exclude ppc builds - needs extensive porting work * Mon Mar 30 2009 Rich Megginson - 1.2.0-1 - new release 1.2.0 - Made devel package depend on mozldap-devel - only create run dir if it does not exist - CVS tag: FedoraDirSvr_1_2_0_RC1 FedoraDirSvr_1_2_0_RC1_20090330 * Mon Oct 30 2008 Noriko Hosoi - 1.1.3-7 - added db4-utils to Requires for verify-db.pl * Mon Oct 13 2008 Noriko Hosoi - 1.1.3-6 - Enabled LDAPI autobind * Thu Oct 9 2008 Rich Megginson - 1.1.3-5 - updated update to patch bug463991-bdb47.patch * Thu Oct 9 2008 Rich Megginson - 1.1.3-4 - updated patch bug463991-bdb47.patch * Mon Sep 29 2008 Rich Megginson - 1.1.3-3 - added patch bug463991-bdb47.patch - make ds work with bdb 4.7 * Wed Sep 24 2008 Rich Megginson - 1.1.3-2 - rolled back bogus winsync memory leak fix * Tue Sep 23 2008 Rich Megginson - 1.1.3-1 - winsync api improvements for modify operations * Fri Jun 13 2008 Rich Megginson - 1.1.2-1 - This is the 1.1.2 release. The bugs fixed can be found here - https://bugzilla.redhat.com/showdependencytree.cgi?id=452721 - Added winsync-plugin.h to the devel subpackage * Fri Jun 6 2008 Rich Megginson - 1.1.1-2 - bump rev to rebuild and pick up new version of ICU * Fri May 23 2008 Rich Megginson - 1.1.1-1 - 1.1.1 release candidate - several bug fixes * Wed Apr 16 2008 Rich Megginson - 1.1.0.1-4 - fix bugzilla 439829 - patch to allow working with NSS 3.11.99 and later * Tue Mar 18 2008 Tom "spot" Callaway - 1.1.0.1-3 - add patch to allow server to work with NSS 3.11.99 and later - do NSS_Init after fork but before detaching from console * Tue Mar 18 2008 Tom "spot" Callaway - 1.1.0.1-3 - add Requires for versioned perl (libperl.so) * Wed Feb 27 2008 Rich Megginson - 1.1.0.1-2 - previous fix for 434403 used the wrong patch - this is the right one * Wed Feb 27 2008 Rich Megginson - 1.1.0.1-1 - Resolves bug 434403 - GCC 4.3 build fails - Rolled new source tarball which includes Nathan's fix for the struct ucred - NOTE: Change version back to 1.1.1 for next release - this release was pulled from CVS tag FedoraDirSvr110_gcc43 * Tue Feb 19 2008 Fedora Release Engineering - 1.1.0-5 - Autorebuild for GCC 4.3 * Thu Dec 20 2007 Rich Megginson - 1.1.0-4 - This is the GA release of Fedora DS 1.1 - Removed version numbers for BuildRequires and Requires - Added full URL to source tarball * Fri Dec 07 2007 Release Engineering - 1.1.0-3 - Rebuild for deps * Wed Nov 7 2007 Rich Megginson - 1.1.0-2.0 - This is the beta2 release - new file added to package - /etc/sysconfig/dirsrv - for setting - daemon environment as is usual in other linux daemons * Thu Aug 16 2007 Rich Megginson - 1.1.0-1.2 - fix build breakage due to open() - mock could not find BuildRequires: db4-devel >= 4.2.52 - mock works if >= version is removed - it correctly finds db4.6 * Fri Aug 10 2007 Rich Megginson - 1.1.0-1.1 - Change pathnames to use the pkgname macro which is dirsrv - get rid of cvsdate in source name * Fri Jul 20 2007 Rich Megginson - 1.1.0-0.3.20070720 - Added Requires for perldap, cyrus sasl plugins - Removed template-migrate* files - Added perl module directory - Removed install.inf - setup-ds.pl can now easily generate one * Mon Jun 18 2007 Nathan Kinder - 1.1.0-0.2.20070320 - added requires for mozldap-tools * Tue Mar 20 2007 Rich Megginson - 1.1.0-0.1.20070320 - update to latest sources - added migrateTo11 to allow migrating instances from 1.0.x to 1.1 - ldapi support - fixed pam passthru plugin ENTRY method * Fri Feb 23 2007 Rich Megginson - 1.1.0-0.1.20070223 - Renamed package to fedora-ds-base, but keep names of paths/files/services the same - use the shortname macro (fedora-ds) for names of paths, files, and services instead - of name, so that way we can continue to use e.g. /etc/fedora-ds instead of /etc/fedora-ds-base - updated to latest sources * Tue Feb 13 2007 Rich Megginson - 1.1.0-0.1.20070213 - More cleanup suggested by Dennis Gilmore - This is the fedora extras candidate based on cvs tag FedoraDirSvr110a1 * Fri Feb 9 2007 Rich Megginson - 1.1.0-1.el4.20070209 - latest sources - added init scripts - use /etc as instconfigdir * Wed Feb 7 2007 Rich Megginson - 1.1.0-1.el4.20070207 - latest sources - moved all executables to _bindir * Mon Jan 29 2007 Rich Megginson - 1.1.0-1.el4.20070129 - latest sources - added /var/tmp/fedora-ds to dirs * Fri Jan 26 2007 Rich Megginson - 1.1.0-8.el4.20070125 - added logconv.pl - added slapi-plugin.h to devel package - added explicit dirs for /var/log/fedora-ds et. al. * Thu Jan 25 2007 Rich Megginson - 1.1.0-7.el4.20070125 - just move all .so files into the base package from the devel package * Thu Jan 25 2007 Rich Megginson - 1.1.0-6.el4.20070125 - Move the plugin *.so files into the main package instead of the devel - package because they are loaded directly by name via dlopen * Fri Jan 19 2007 Rich Megginson - 1.1.0-5.el4.20070125 - Move the script-templates directory to datadir/fedora-ds * Fri Jan 19 2007 Rich Megginson - 1.1.0-4.el4.20070119 - change mozldap to mozldap6 * Fri Jan 19 2007 Rich Megginson - 1.1.0-3.el4.20070119 - remove . from cvsdate define * Fri Jan 19 2007 Rich Megginson - 1.1.0-2.el4.20070119 - Having a problem building in Brew - may be Release format * Fri Jan 19 2007 Rich Megginson - 1.1.0-1.el4.cvs20070119 - Changed version to 1.1.0 and added Release 1.el4.cvs20070119 - merged in changes from Fedora Extras candidate spec file * Mon Jan 15 2007 Rich Megginson - 1.1-0.1.cvs20070115 - Bump component versions (nspr, nss, svrcore, mozldap) to their latest - remove unneeded patches * Tue Jan 09 2007 Dennis Gilmore - 1.1-0.1.cvs20070108 - update to a cvs snapshot - fedorafy the spec - create -devel subpackage - apply a patch to use mozldap not mozldap6 - apply a patch to allow --prefix to work correctly * Mon Dec 4 2006 Rich Megginson - 1.0.99-16 - Fixed the problem where the server would crash upon shutdown in dblayer - due to a race condition among the database housekeeping threads - Fix a problem with normalized absolute paths for db directories * Tue Nov 28 2006 Rich Megginson - 1.0.99-15 - Touch all of the ldap/admin/src/scripts/*.in files so that they - will be newer than their corresponding script template files, so - that make will rebuild them. * Mon Nov 27 2006 Rich Megginson - 1.0.99-14 - Chown new schema files when copying during instance creation * Tue Nov 21 2006 Rich Megginson - 1.0.99-13 - Configure will get ldapsdk_bindir from pkg-config, or $libdir/mozldap6 * Tue Nov 21 2006 Rich Megginson - 1.0.99-12 - use eval to sed ./configure into ../configure * Tue Nov 21 2006 Rich Megginson - 1.0.99-11 - jump through hoops to be able to run ../configure * Tue Nov 21 2006 Rich Megginson - 1.0.99-10 - Need to make built dir in setup section * Tue Nov 21 2006 Rich Megginson - 1.0.99-9 - The template scripts needed to use @libdir@ instead of hardcoding - /usr/lib - Use make DESTDIR=$RPM_BUILD_ROOT install instead of % makeinstall - do the actual build in a "built" subdirectory, until we remove - the old script templates * Thu Nov 16 2006 Rich Megginson - 1.0.99-8 - Make replication plugin link with libdb * Wed Nov 15 2006 Rich Megginson - 1.0.99-7 - Have make define LIBDIR, BINDIR, etc. for C code to use - especially for create_instance.h * Tue Nov 14 2006 Rich Megginson - 1.0.99-6 - Forgot to checkin new config.h.in for AC_CONFIG_HEADERS * Tue Nov 14 2006 Rich Megginson - 1.0.99-5 - Add perldap as a Requires; update sources * Thu Nov 9 2006 Rich Megginson - 1.0.99-4 - Fix ds_newinst.pl - Remove obsolete #defines * Thu Nov 9 2006 Rich Megginson - 1.0.99-3 - Update sources; rebuild to populate brew yum repo with dirsec-nss * Tue Nov 7 2006 Rich Megginson - 1.0.99-2 - Update sources * Thu Nov 2 2006 Rich Megginson - 1.0.99-1 - initial revision