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