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