06511bf
%define pkgname   dirsrv
06511bf
06511bf
Summary:          389 Administration Server (admin)
06511bf
Name:             389-admin
c8b03e8
Version:          1.1.9
c8b03e8
Release:          1%{?dist}
06511bf
License:          GPLv2 and ASL 2.0
06511bf
URL:              http://port389.org/
06511bf
Group:            System Environment/Daemons
06511bf
BuildRoot:        %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
06511bf
Provides:         fedora-ds-admin = %{version}-%{release}
06511bf
Obsoletes:        fedora-ds-admin < 1.1.8-1
06511bf
06511bf
BuildRequires:    nspr-devel
06511bf
BuildRequires:    nss-devel
06511bf
BuildRequires:    svrcore-devel
06511bf
BuildRequires:    mozldap-devel
06511bf
BuildRequires:    cyrus-sasl-devel
06511bf
BuildRequires:    icu
06511bf
BuildRequires:    libicu-devel
06511bf
BuildRequires:    httpd-devel
06511bf
BuildRequires:    apr-devel
06511bf
BuildRequires:    mod_nss
f15d69e
BuildRequires:    389-adminutil-devel
06511bf
06511bf
Requires:         389-ds-base
06511bf
Requires:         mod_nss
06511bf
# the following are needed for some of our scripts
06511bf
Requires:         perl-Mozilla-LDAP
06511bf
Requires:         nss-tools
06511bf
06511bf
# for the init script
06511bf
Requires(post): /sbin/chkconfig
06511bf
Requires(preun): /sbin/chkconfig
06511bf
Requires(preun): /sbin/service
06511bf
06511bf
Source0:          http://port389.org/sources/%{name}-%{version}.tar.bz2
06511bf
# 389-admin-git.sh should be used to generate the source tarball from git
06511bf
Source1:          %{name}-git.sh
06511bf
06511bf
%description
06511bf
389 Administration Server is an HTTP agent that provides management features
06511bf
for 389 Directory Server.  It provides some management web apps that can
06511bf
be used through a web browser.  It provides the authentication, access control,
06511bf
and CGI utilities used by the console.
06511bf
06511bf
%prep
06511bf
%setup -q -n %{name}-%{version}
06511bf
06511bf
%build
06511bf
%configure --disable-rpath
06511bf
06511bf
# Generate symbolic info for debuggers
06511bf
export XCFLAGS=$RPM_OPT_FLAGS
06511bf
06511bf
%ifarch x86_64 ppc64 ia64 s390x sparc64
06511bf
export USE_64=1
06511bf
%endif
06511bf
06511bf
make %{?_smp_mflags}
06511bf
06511bf
%install
06511bf
rm -rf $RPM_BUILD_ROOT 
06511bf
06511bf
make DESTDIR="$RPM_BUILD_ROOT" install
06511bf
06511bf
# make console jars directory
06511bf
mkdir -p $RPM_BUILD_ROOT%{_datadir}/%{pkgname}/html/java
06511bf
06511bf
#remove libtool and static libs
06511bf
rm -f $RPM_BUILD_ROOT%{_libdir}/*.a
06511bf
rm -f $RPM_BUILD_ROOT%{_libdir}/*.so
06511bf
rm -f $RPM_BUILD_ROOT%{_libdir}/*.la
06511bf
rm -f $RPM_BUILD_ROOT%{_libdir}/%{pkgname}/modules/*.a
06511bf
rm -f $RPM_BUILD_ROOT%{_libdir}/%{pkgname}/modules/*.la
06511bf
06511bf
%clean
06511bf
rm -rf $RPM_BUILD_ROOT
06511bf
ea32edc
%pre -p <lua>
ea32edc
-- save ownership/permissions on the dirs/files that rpm changes
ea32edc
-- if these don't exist, the vars will be nil
ea32edc
%{pkgname}admin_adminserv = posix.stat('%{_sysconfdir}/%{pkgname}/admin-serv')
ea32edc
%{pkgname}admin_consoleconf = posix.stat('%{_sysconfdir}/%{pkgname}/admin-serv/console.conf')
ea32edc
-- save the run level configuration, if any
ea32edc
rc = os.execute('rpm --quiet -q fedora-ds-admin')
ea32edc
if rc == 0 then
ea32edc
    %{pkgname}admin_exists = true
ea32edc
    %{pkgname}admin_savelinks = {}
ea32edc
    for dir in posix.files("%{_sysconfdir}/rc.d") do
ea32edc
        if string.find(dir, "rc%d.d") then
ea32edc
--          print("looking in %{_sysconfdir}/rc.d/"..dir)
ea32edc
            for link in posix.files("%{_sysconfdir}/rc.d/"..dir) do
ea32edc
                if string.find(link, "[SK]%d%d%{pkgname}-admin") then
ea32edc
                    fullname = "%{_sysconfdir}/rc.d/"..dir.."/"..link
ea32edc
                    linked = posix.readlink(fullname)
ea32edc
--                  print(fullname.." is linked to "..linked)
ea32edc
                    %{pkgname}_savelinks[fullname] = linked
ea32edc
                end
ea32edc
            end
ea32edc
        end
ea32edc
    end
ea32edc
end
ea32edc
ea32edc
%post -p <lua>
ea32edc
-- do the usual daemon post setup stuff
ea32edc
os.execute('/sbin/chkconfig --add %{pkgname}-admin')
ea32edc
os.execute('/sbin/ldconfig')
ea32edc
-- restore permissions if upgrading
ea32edc
if %{pkgname}admin_adminserv then
ea32edc
    posix.chmod('%{_sysconfdir}/%{pkgname}/admin-serv', %{pkgname}admin_adminserv.mode)
ea32edc
    posix.chown('%{_sysconfdir}/%{pkgname}/admin-serv', %{pkgname}admin_adminserv.uid, %{pkgname}admin_adminserv.gid)
ea32edc
end
ea32edc
if %{pkgname}admin_consoleconf then
ea32edc
    posix.chmod('%{_sysconfdir}/%{pkgname}/admin-serv/console.conf', %{pkgname}admin_consoleconf.mode)
ea32edc
    posix.chown('%{_sysconfdir}/%{pkgname}/admin-serv/console.conf', %{pkgname}admin_consoleconf.uid, %{pkgname}admin_consoleconf.gid)
ea32edc
end
06511bf
06511bf
%preun
06511bf
if [ $1 = 0 ]; then
06511bf
        /sbin/service %{pkgname}-admin stop >/dev/null 2>&1 || :
06511bf
        /sbin/chkconfig --del %{pkgname}-admin
06511bf
fi
06511bf
06511bf
%postun -p /sbin/ldconfig
06511bf
ea32edc
%posttrans -p <lua>
ea32edc
-- if we saved the run level configuration in %pre, restore it now
ea32edc
-- we can get rid of this code once Fedora 11 becomes obsolete
ea32edc
if %{pkgname}admin_savelinks then
ea32edc
    for fullpath,link in pairs(%{pkgname}admin_savelinks) do
ea32edc
        posix.symlink(link,fullpath)
ea32edc
--        print("posttrans - restored run level "..fullpath.." to "..link)
ea32edc
    end
ea32edc
end
ea32edc
if %{pkgname}admin_exists then
ea32edc
    os.execute('/sbin/service %{pkgname}-admin start >/dev/null 2>&1')
ea32edc
end
ea32edc
06511bf
%files
06511bf
%defattr(-,root,root,-)
06511bf
%doc LICENSE
06511bf
%dir %{_sysconfdir}/%{pkgname}/admin-serv
06511bf
%config(noreplace)%{_sysconfdir}/%{pkgname}/admin-serv/*.conf
06511bf
%{_datadir}/%{pkgname}
06511bf
%{_sysconfdir}/rc.d/init.d/%{pkgname}-admin
06511bf
%config(noreplace)%{_sysconfdir}/sysconfig/%{pkgname}-admin
06511bf
%{_sbindir}/*
06511bf
%{_libdir}/*.so.*
06511bf
%{_libdir}/%{pkgname}
06511bf
%{_mandir}/man8/*
06511bf
06511bf
%changelog
c8b03e8
* Mon Sep 14 2009 Rich Megginson <rmeggins@redhat.com> - 1.1.9-1
c8b03e8
- the 1.1.9 release
c8b03e8
ea32edc
* Tue Aug 25 2009 Rich Megginson <rmeggins@redhat.com> - 1.1.8-4
ea32edc
- resolves 518418 -  Package rename shuts down server, results in unconfigured package
ea32edc
- rewrite perm/owner preservation code to use lua
ea32edc
ea32edc
- rewrite perm/owner preservation code to use lua
ea32edc
- add lua code to save run level configuration
ea32edc
894666c
* Wed Aug 12 2009 Rich Megginson <rmeggins@redhat.com> - 1.1.8-3
894666c
- final rebuild for 1.1.8 release
894666c
e6aa104
* Tue Jul 21 2009 Rich Megginson <rmeggins@redhat.com> - 1.1.8-2
f15d69e
- change adminutil to 389-adminutil
f15d69e
06511bf
* Thu Jun 18 2009 Rich Megginson <rmeggins@redhat.com> - 1.1.8-1
06511bf
- bump version to 1.1.8
06511bf
- change license to GPLv2 + ASL 2.0
06511bf
- changed files that were incorrectly licensed as GPLv2+ to plain GPLv2
06511bf
06511bf
* Wed May 13 2009 Rich Megginson <rmeggins@redhat.com> - 1.1.7-5
06511bf
- rename to 389
06511bf
06511bf
* Thu Apr  9 2009 Rich Megginson <rmeggins@redhat.com> - 1.1.7-4
06511bf
- Resolves: bug 493424
06511bf
- Description: dirsrv-admin initscript looks for nonexistent library
06511bf
- Added patch to remove those modules from the httpd.conf
06511bf
06511bf
* Wed Apr  8 2009 Rich Megginson <rmeggins@redhat.com> - 1.1.7-3
06511bf
- Resolves: bug 494980
06511bf
- Description: setup-ds-admin.pl -u and silent setup complain about ServerIpAddress
06511bf
- CVS tag FedoraDirSrvAdmin_1_1_7_RC3 FedoraDirSrvAdmin_1_1_7_RC3_20090408
06511bf
06511bf
* Fri Apr  3 2009 Rich Megginson <rmeggins@redhat.com> - 1.1.7-2
06511bf
- Resolves: bug 493989
06511bf
- Description: Admin Server: valgrind invalid read in security.c when installing CRL
06511bf
06511bf
* Tue Mar 31 2009 Rich Megginson <rmeggins@redhat.com> - 1.1.7-1
06511bf
- this is the 1.1.7 release
06511bf
- added man pages for setup, migration, remove commands
06511bf
- better error handling for command line utilities
06511bf
- fixed remove from console
06511bf
- added remove-ds-admin.pl
06511bf
- added pre and post sections in order to preserve the permissions and ownerships
06511bf
- CVS tag FedoraDirSrvAdmin_1_1_7_RC1 FedoraDirSrvAdmin_1_1_7_RC1_20090331
06511bf
06511bf
* Tue Feb 24 2009 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.1.6-3
06511bf
- Rebuilt for https://fedoraproject.org/wiki/Fedora_11_Mass_Rebuild
06511bf
06511bf
* Mon Sep 15 2008 Rich Megginson <rmeggins@redhat.com> - 1.1.6-2
06511bf
- patch for bug 451702 not required anymore - in upstream now
06511bf
06511bf
* Wed Jul  2 2008 Rich Megginson <rmeggins@redhat.com> - 1.1.6-1
06511bf
- add patch for bug 451702
06511bf
- The 1.1.6 release
06511bf
06511bf
* Fri Jun  6 2008 Rich Megginson <rmeggins@redhat.com> - 1.1.5-1
06511bf
- Resolves: Bug 448366
06511bf
- genrb no longer supports -p option
06511bf
06511bf
* Tue Apr 15 2008 Rich Megginson <rmeggins@redhat.com> - 1.1.4-1
06511bf
- Resolves: Bug 437301
06511bf
- Directory Server: shell command injection in CGI replication monitor
06511bf
- Fix: rewrite the perl script to ignore all input parameters - replmon.conf
06511bf
- file will have to be hard coded to be in the admin-serv directory
06511bf
- Resolves: Bug 437320
06511bf
- Directory Server: unrestricted access to CGI scripts
06511bf
- Fix: remove script alias for /bin/admin/admin/bin/
06511bf
06511bf
* Wed Jan  9 2008 Rich Megginson <rmeggins@redhat.com> - 1.1.2-1
06511bf
- Fix issues associated with Fedora pkg review bug 249548
06511bf
06511bf
* Tue Dec 11 2007 Rich Megginson <rmeggins@redhat.com> - 1.1.1-1
06511bf
- this is the final GA candidate
06511bf
06511bf
* Tue Nov  6 2007 Rich Megginson <rmeggins@redhat.com> - 1.1.0-1.16
06511bf
- fix several beta blocker issues
06511bf
06511bf
* Mon Oct 15 2007 Rich Megginson <rmeggins@redhat.com> - 1.1.0-1.15
06511bf
- fix bogus dist macro
06511bf
- change mozldap6 to mozldap
06511bf
06511bf
* Thu Oct 11 2007 Rich Megginson <rmeggins@redhat.com> - 1.1.0-1.14
06511bf
- make admin server work with SELinux enabled
06511bf
- fix wording errors in setup
06511bf
06511bf
* Mon Oct  8 2007 Rich Megginson <rmeggins@redhat.com> - 1.1.0-1.13
06511bf
- added /etc/sysconfig/dirsrv-admin the file that allows you to set
06511bf
- the environment used to start up the admin server (e.g. keytab, ulimit, etc.)
06511bf
- the initscript and admin start script use this file now
06511bf
- This version also has a fix to print the correct error message if the admin
06511bf
- server cannot be contacted during setup or migration.
06511bf
06511bf
* Thu Sep 27 2007 Rich Megginson <rmeggins@redhat.com> - 1.1.0-1.12
06511bf
- fix a couple of migration issues, including the rpath $libdir problem
06511bf
- allow ds_remove from console to remove instances
06511bf
06511bf
* Wed Sep 19 2007 Rich Megginson <rmeggins@redhat.com> - 1.1.0-1.11
06511bf
- one line fix to fix of 295001 - console.conf clobbered
06511bf
06511bf
* Tue Sep 18 2007 Rich Megginson <rmeggins@redhat.com> - 1.1.0-1.10
06511bf
- fixed migration issue bugzilla 295001 - console.conf clobbered
06511bf
06511bf
* Fri Sep 14 2007 Rich Megginson <rmeggins@redhat.com> - 1.1.0-1.9
06511bf
- fix several more migration problems
06511bf
06511bf
* Fri Sep 14 2007 Rich Megginson <rmeggins@redhat.com> - 1.1.0-1.8
06511bf
- fix migration - servers are started as they are migrated now
06511bf
06511bf
* Tue Aug 21 2007 Rich Megginson <rmeggins@redhat.com> - 1.1.0-1.7
06511bf
- Fix the with-fhs-opt configure flag
06511bf
06511bf
* Fri Aug 17 2007 Rich Megginson <rmeggins@redhat.com> - 1.1.0-1.6
06511bf
- remove curses
06511bf
- make mod_admserv link against sasl
06511bf
- add the usual .m4 files to mod_admserv instead of having all of
06511bf
- the component logic in configure.in
06511bf
06511bf
* Thu Aug 16 2007 Rich Megginson <rmeggins@redhat.com> - 1.1.0-1.5
06511bf
- incorporate Noriko's migration fix
06511bf
06511bf
* Wed Aug 15 2007 Rich Megginson <rmeggins@redhat.com> - 1.1.0-1.4
06511bf
- address several migration issues
06511bf
06511bf
* Mon Aug 13 2007 Rich Megginson <rmeggins@redhat.com> - 1.1.0-1.3
06511bf
- there is no devel package, so remove unused .so files
06511bf
06511bf
* Mon Aug 13 2007 Rich Megginson <rmeggins@redhat.com> - 1.1.0-1.2
06511bf
- forgot to tag the modules
06511bf
06511bf
* Fri Aug 10 2007 Rich Megginson <rmeggins@redhat.com> - 1.1.0-1.1
06511bf
- get rid of cvsdate
06511bf
- use pkgname of dirsrv for filesystem path naming
06511bf
- get rid of devel package
06511bf
- simplify files section
06511bf
06511bf
* Fri Aug 10 2007 Noriko Hosoi <nhosoi@redhat.com> - 1.1.0-0.3.20070810
06511bf
- updated to latest sources
06511bf
- upgraded the mozldap6 version to 6.0.4
06511bf
06511bf
* Wed Aug  8 2007 Noriko Hosoi <nhosoi@redhat.com> - 1.1.0-0.2.20070808
06511bf
- updated to latest sources -- bug fixes in the setup scripts
06511bf
06511bf
* Mon Aug  6 2007 Rich Megginson <rmeggins@redhat.com> - 1.1.0-0.1.20070806
06511bf
- updated to latest sources
06511bf
06511bf
* Thu Aug  2 2007 Rich Megginson <rmeggins@redhat.com> - 1.1.0-0.4.20070802
06511bf
- There are no files in bindir anymore
06511bf
06511bf
* Thu Aug  2 2007 Rich Megginson <rmeggins@redhat.com> - 1.1.0-0.3.20070802
06511bf
- forgot to prepend build root to java dir creation
06511bf
06511bf
* Thu Aug  2 2007 Rich Megginson <rmeggins@redhat.com> - 1.1.0-0.2.20070802
06511bf
- forgot to add mod_admserv and mod_restartd to source
06511bf
06511bf
* Thu Aug  2 2007 Rich Megginson <rmeggins@redhat.com> - 1.1.0-0.1.20070802
06511bf
- updated to latest sources - fix build breakage
06511bf
- add console jars dir under html
06511bf
06511bf
* Mon Jul 23 2007 Rich Megginson <rmeggins@redhat.com> - 1.1.0-0.1.20070725
06511bf
- Initial version based on fedora-ds-base.spec