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 Added 389-ds-base-git-local.sh script to generate a source tarball from a local git repository and a git tag
This commit is contained in:
parent
caa5ee37d6
commit
256eebfb5a
@ -1,2 +1 @@
|
|||||||
389-ds-base-1.2.1.tar.bz2
|
389-ds-base-1.2.3.tar.bz2
|
||||||
389-ds-base-1.2.2.tar.bz2
|
|
||||||
|
19
389-ds-base-git-local.sh
Normal file
19
389-ds-base-git-local.sh
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
DATE=`date +%Y%m%d`
|
||||||
|
# use a real tag name here
|
||||||
|
TAG=389-ds-base-1.2.3
|
||||||
|
VERSION=1.2.3
|
||||||
|
PKGNAME=389-ds-base
|
||||||
|
#SRCNAME=$PKGNAME-$VERSION-$DATE
|
||||||
|
SRCNAME=$PKGNAME-$VERSION
|
||||||
|
|
||||||
|
echo you must be in the ds git repo to use this
|
||||||
|
git status > /dev/null || echo bye
|
||||||
|
if [ -z "$1" ] ; then
|
||||||
|
dir=.
|
||||||
|
else
|
||||||
|
dir="$1"
|
||||||
|
fi
|
||||||
|
|
||||||
|
git archive --prefix=$SRCNAME/ $TAG | bzip2 > $dir/$SRCNAME.tar.bz2
|
130
389-ds-base.spec
130
389-ds-base.spec
@ -3,8 +3,8 @@
|
|||||||
|
|
||||||
Summary: 389 Directory Server (base)
|
Summary: 389 Directory Server (base)
|
||||||
Name: 389-ds-base
|
Name: 389-ds-base
|
||||||
Version: 1.2.2
|
Version: 1.2.3
|
||||||
Release: 3%{?dist}
|
Release: 1%{?dist}
|
||||||
License: GPLv2 with exceptions
|
License: GPLv2 with exceptions
|
||||||
URL: http://port389.org/
|
URL: http://port389.org/
|
||||||
Group: System Environment/Daemons
|
Group: System Environment/Daemons
|
||||||
@ -53,6 +53,9 @@ Requires: db4-utils
|
|||||||
# This picks up libperl.so as a Requires, so we add this versioned one
|
# This picks up libperl.so as a Requires, so we add this versioned one
|
||||||
Requires: perl(:MODULE_COMPAT_%(eval "`%{__perl} -V:version`"; echo $version))
|
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
|
# for the init script
|
||||||
Requires(post): /sbin/chkconfig
|
Requires(post): /sbin/chkconfig
|
||||||
Requires(preun): /sbin/chkconfig
|
Requires(preun): /sbin/chkconfig
|
||||||
@ -119,28 +122,114 @@ sed -i -e 's|#{{PERL-EXEC}}|#!/usr/bin/perl|' $RPM_BUILD_ROOT%{_datadir}/%{pkgna
|
|||||||
%clean
|
%clean
|
||||||
rm -rf $RPM_BUILD_ROOT
|
rm -rf $RPM_BUILD_ROOT
|
||||||
|
|
||||||
%post
|
%pre -p <lua>
|
||||||
/sbin/chkconfig --add %{pkgname}
|
-- see if fedora-ds-base exists - if so, save the run level configuration
|
||||||
/sbin/ldconfig
|
-- and set a flag that tells us to restore that config in %posttrans
|
||||||
# this has been problematic - if this directory
|
-- and restart the server
|
||||||
# does not exist, the server will silently fail to
|
-- we can get rid of this code once Fedora 11 becomes obsolete
|
||||||
# start - however, if the user has already created
|
rc = os.execute('rpm --quiet -q fedora-ds-base')
|
||||||
# it, we don't want to overwrite the permissions
|
if rc == 0 then
|
||||||
# on it - so we can't list it explicitly in the
|
%{pkgname}_exists = true
|
||||||
# files section - we list it as a ghost so that
|
%{pkgname}_savelinks = {}
|
||||||
# it will be removed when the rpm is removed
|
for dir in posix.files("%{_sysconfdir}/rc.d") do
|
||||||
if [ ! -d %{_localstatedir}/run/%{pkgname} ] ; then
|
if string.find(dir, "rc%d.d") then
|
||||||
mkdir -p %{_localstatedir}/run/%{pkgname}
|
-- print("looking in %{_sysconfdir}/rc.d/"..dir)
|
||||||
fi
|
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 <lua>
|
||||||
|
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
|
%preun
|
||||||
if [ $1 = 0 ]; then
|
if [ $1 = 0 ]; then
|
||||||
/sbin/service %{pkgname} stop >/dev/null 2>&1 || :
|
/sbin/service %{pkgname} stop >/dev/null 2>&1 || :
|
||||||
/sbin/chkconfig --del %{pkgname}
|
/sbin/chkconfig --del %{pkgname}
|
||||||
|
/sbin/service %{pkgname}-snmp stop >/dev/null 2>&1 || :
|
||||||
|
/sbin/chkconfig --del %{pkgname}-snmp
|
||||||
fi
|
fi
|
||||||
|
|
||||||
%postun -p /sbin/ldconfig
|
%postun -p /sbin/ldconfig
|
||||||
|
|
||||||
|
%posttrans -p <lua>
|
||||||
|
-- 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
|
%files
|
||||||
%defattr(-,root,root,-)
|
%defattr(-,root,root,-)
|
||||||
%doc LICENSE EXCEPTION LICENSE.GPLv2
|
%doc LICENSE EXCEPTION LICENSE.GPLv2
|
||||||
@ -150,9 +239,12 @@ fi
|
|||||||
%dir %{_sysconfdir}/%{pkgname}/config
|
%dir %{_sysconfdir}/%{pkgname}/config
|
||||||
%config(noreplace)%{_sysconfdir}/%{pkgname}/config/slapd-collations.conf
|
%config(noreplace)%{_sysconfdir}/%{pkgname}/config/slapd-collations.conf
|
||||||
%config(noreplace)%{_sysconfdir}/%{pkgname}/config/certmap.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}
|
%config(noreplace)%{_sysconfdir}/sysconfig/%{pkgname}
|
||||||
%{_datadir}/%{pkgname}
|
%{_datadir}/%{pkgname}
|
||||||
%{_sysconfdir}/rc.d/init.d/%{pkgname}
|
%{_sysconfdir}/rc.d/init.d/%{pkgname}
|
||||||
|
%{_sysconfdir}/rc.d/init.d/%{pkgname}-snmp
|
||||||
%{_bindir}/*
|
%{_bindir}/*
|
||||||
%{_sbindir}/*
|
%{_sbindir}/*
|
||||||
%dir %{_libdir}/%{pkgname}
|
%dir %{_libdir}/%{pkgname}
|
||||||
@ -173,8 +265,12 @@ fi
|
|||||||
%{_libdir}/%{pkgname}/*.so
|
%{_libdir}/%{pkgname}/*.so
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
* Tue Sep 08 2009 Nathan Kinder <nkinder@redhat.com> - 1.2.2-3
|
* Mon Sep 14 2009 Rich Megginson <rmeggins@redhat.com> - 1.2.3-1
|
||||||
- removed BuildRequires for lm_sensors on s390 and s390x
|
- 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 <caolanm@redhat.com> - 1.2.2-2
|
* Tue Sep 01 2009 Caolán McNamara <caolanm@redhat.com> - 1.2.2-2
|
||||||
- rebuild with new openssl to fix dependencies
|
- rebuild with new openssl to fix dependencies
|
||||||
|
Loading…
Reference in New Issue
Block a user