]>
Commit | Line | Data |
---|---|---|
e21765f5 ER |
1 | # TODO |
2 | # - merge with fedora-ds-admin.spec | |
fef0291e | 3 | # - apache2 only package? the apache deps seems overkill |
cc355b32 | 4 | |
5 | #%global selinux_variants mls targeted | |
6 | ||
e21765f5 ER |
7 | %define subver .a1 |
8 | %define rel 0.1 | |
05b4ed27 | 9 | Summary: 389 Administration Server (admin) |
10 | Name: 389-admin | |
11 | Version: 1.1.11 | |
e21765f5 ER |
12 | Release: 0%{?subver}.%{rel} |
13 | License: GPL v2 and ASL 2.0 | |
05b4ed27 | 14 | Group: Daemons |
15 | URL: http://directory.fedoraproject.org/ | |
e21765f5 ER |
16 | Source0: http://directory.fedoraproject.org/sources/%{name}-%{version}%{subver}.tar.bz2 |
17 | # Source0-md5: 2d5c5e2058429086bbced744590aba7f | |
51b8a1bd | 18 | Patch0: %{name}-httpd.conf.patch |
05b4ed27 | 19 | BuildRequires: 389-adminutil-devel |
20 | BuildRequires: apache-devel | |
21 | BuildRequires: apr-devel | |
22 | BuildRequires: apr-util-devel | |
23 | BuildRequires: cyrus-sasl-devel | |
24 | BuildRequires: icu | |
25 | BuildRequires: libicu-devel >= 4.2.1 | |
26 | BuildRequires: mozldap-devel | |
27 | BuildRequires: nspr-devel | |
28 | BuildRequires: nss-devel | |
29 | BuildRequires: svrcore-devel | |
e21765f5 | 30 | %if %{with selinux} |
cc355b32 | 31 | # The following are needed to build the SELinux policy |
05b4ed27 | 32 | BuildRequires: /usr/share/selinux/devel/Makefile |
33 | BuildRequires: 389-ds-base-selinux-devel | |
34 | BuildRequires: checkpolicy | |
35 | BuildRequires: selinux-policy-devel | |
cc355b32 | 36 | %endif |
05b4ed27 | 37 | Requires: 389-ds-base |
fef0291e ER |
38 | Requires: apache-mod_actions |
39 | Requires: apache-mod_alias | |
7e3fa3a3 | 40 | Requires: apache-mod_auth_basic |
41 | Requires: apache-mod_authn_file | |
fef0291e | 42 | Requires: apache-mod_authz_host |
fef0291e | 43 | Requires: apache-mod_dir |
7e3fa3a3 | 44 | Requires: apache-mod_env |
7e3fa3a3 | 45 | Requires: apache-mod_expires |
7e3fa3a3 | 46 | Requires: apache-mod_headers |
fef0291e ER |
47 | Requires: apache-mod_log_config |
48 | Requires: apache-mod_mime_magic | |
49 | Requires: apache-mod_negotiation | |
50 | Requires: apache-mod_nss | |
51 | Requires: apache-mod_rewrite | |
7e3fa3a3 | 52 | Requires: apache-mod_setenvif |
fef0291e ER |
53 | Requires: apache-mod_unique_id |
54 | Requires: apache-mod_vhost_alias | |
cc355b32 | 55 | # the following are needed for some of our scripts |
05b4ed27 | 56 | Requires: nss-tools |
57 | Requires: perl-Mozilla-LDAP | |
cc355b32 | 58 | # for the init script |
e21765f5 ER |
59 | Requires(post,preun): /sbin/chkconfig |
60 | Requires: rc-scripts | |
61 | BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n) | |
cc355b32 | 62 | |
63 | %description | |
05b4ed27 | 64 | 389 Administration Server is an HTTP agent that provides management |
65 | features for 389 Directory Server. It provides some management web | |
66 | apps that can be used through a web browser. It provides the | |
67 | authentication, access control, and CGI utilities used by the console. | |
cc355b32 | 68 | |
e21765f5 | 69 | %package selinux |
05b4ed27 | 70 | Summary: SELinux policy for 389 Administration Server |
71 | Group: Daemons | |
72 | Requires: %{name} = %{version}-%{release} | |
73 | Requires: 389-ds-base-selinux | |
74 | Requires: selinux-policy | |
cc355b32 | 75 | |
e21765f5 | 76 | %description selinux |
cc355b32 | 77 | SELinux policy for the 389 Adminstration Server package. |
cc355b32 | 78 | |
79 | %prep | |
e21765f5 | 80 | %setup -q -n %{name}-%{version}%{subver} |
51b8a1bd | 81 | %patch0 -p1 |
cc355b32 | 82 | |
83 | %build | |
84 | %{__aclocal} -I m4 | |
85 | %{__automake} | |
86 | %{__autoconf} | |
e21765f5 ER |
87 | export CFLAGS="%{rpmcflags} $(apu-1-config --includes)" |
88 | %configure \ | |
cc355b32 | 89 | --disable-rpath \ |
e21765f5 | 90 | %{?with_selinux:--with-selinux} |
cc355b32 | 91 | |
92 | %ifarch x86_64 ppc64 ia64 s390x sparc64 | |
93 | export USE_64=1 | |
94 | %endif | |
95 | ||
e21765f5 | 96 | %{__make} |
cc355b32 | 97 | |
e21765f5 | 98 | %if %{with selinux} |
cc355b32 | 99 | # Build the SELinux policy module for each variant |
100 | cd selinux-built | |
101 | cp %{_datadir}/dirsrv-selinux/dirsrv.if . | |
102 | cp %{_datadir}/dirsrv-selinux/dirsrv.te . | |
e21765f5 ER |
103 | for selinuxvariant in %{selinux_variants}; do |
104 | %{__make} NAME=${selinuxvariant} -f %{_datadir}/selinux/devel/Makefile | |
105 | mv dirsrv-admin.pp dirsrv-admin.pp.${selinuxvariant} | |
106 | %{__make} NAME=${selinuxvariant} -f %{_datadir}/selinux/devel/Makefile clean | |
cc355b32 | 107 | done |
108 | cd - | |
109 | %endif | |
110 | ||
111 | %install | |
05b4ed27 | 112 | rm -rf $RPM_BUILD_ROOT |
cc355b32 | 113 | |
e21765f5 ER |
114 | %{__make} install \ |
115 | DESTDIR=$RPM_BUILD_ROOT | |
cc355b32 | 116 | |
117 | # make console jars directory | |
05b4ed27 | 118 | install -d $RPM_BUILD_ROOT%{_datadir}/dirsrv/html/java |
cc355b32 | 119 | |
e21765f5 | 120 | # remove libtool and static libs |
cc355b32 | 121 | rm -f $RPM_BUILD_ROOT%{_libdir}/*.a |
122 | rm -f $RPM_BUILD_ROOT%{_libdir}/*.so | |
123 | rm -f $RPM_BUILD_ROOT%{_libdir}/*.la | |
124 | rm -f $RPM_BUILD_ROOT%{_libdir}/dirsrv/modules/*.a | |
125 | rm -f $RPM_BUILD_ROOT%{_libdir}/dirsrv/modules/*.la | |
126 | ||
e21765f5 | 127 | %if %{with selinux} |
cc355b32 | 128 | # Install the SELinux policy |
129 | cd selinux-built | |
e21765f5 ER |
130 | for selinuxvariant in %{selinux_variants}; do |
131 | install -d $RPM_BUILD_ROOT%{_datadir}/selinux/${selinuxvariant} | |
132 | install -p -m 644 dirsrv-admin.pp.${selinuxvariant} \ | |
133 | $RPM_BUILD_ROOT%{_datadir}/selinux/${selinuxvariant}/dirsrv-admin.pp | |
cc355b32 | 134 | done |
135 | cd - | |
136 | %endif | |
137 | ||
138 | %clean | |
139 | rm -rf $RPM_BUILD_ROOT | |
140 | ||
141 | %post | |
142 | /sbin/chkconfig --add dirsrv-admin | |
143 | /sbin/ldconfig | |
144 | ||
145 | %preun | |
e21765f5 ER |
146 | if [ "$1" = 0 ]; then |
147 | %service dirsrv-admin stop | |
148 | /sbin/chkconfig --del dirsrv-admin | |
cc355b32 | 149 | fi |
150 | ||
151 | %postun -p /sbin/ldconfig | |
152 | ||
e21765f5 | 153 | %if %{with selinux} |
cc355b32 | 154 | %post selinux |
e21765f5 ER |
155 | if [ "$1" -le "1" ]; then # First install |
156 | for selinuxvariant in %{selinux_variants}; do | |
157 | semodule -s ${selinuxvariant} -i %{_datadir}/selinux/${selinuxvariant}/dirsrv-admin.pp 2>/dev/null || : | |
158 | done | |
159 | fixfiles -R %{name} restore || : | |
160 | %service dirsrv-admin condrestart | |
cc355b32 | 161 | fi |
162 | ||
163 | %preun selinux | |
164 | if [ "$1" -lt "1" ]; then # Final removal | |
e21765f5 ER |
165 | for selinuxvariant in %{selinux_variants}; do |
166 | semodule -s ${selinuxvariant} -r dirsrv-admin 2>/dev/null || : | |
167 | done | |
168 | fixfiles -R %{name} restore || : | |
169 | %service dirsrv-admin condrestart | |
cc355b32 | 170 | fi |
171 | ||
172 | %postun selinux | |
173 | if [ "$1" -ge "1" ]; then # Upgrade | |
e21765f5 ER |
174 | for selinuxvariant in %{selinux_variants}; do |
175 | semodule -s ${selinuxvariant} -i %{_datadir}/selinux/${selinuxvariant}/dirsrv-admin.pp 2>/dev/null || : | |
176 | done | |
cc355b32 | 177 | fi |
178 | %endif | |
179 | ||
180 | %files | |
05b4ed27 | 181 | %defattr(644,root,root,755) |
cc355b32 | 182 | %doc LICENSE |
183 | %dir %{_sysconfdir}/dirsrv/admin-serv | |
184 | %config(noreplace)%{_sysconfdir}/dirsrv/admin-serv/*.conf | |
185 | %{_datadir}/dirsrv | |
05b4ed27 | 186 | %attr(754,root,root) /etc/rc.d/init.d/dirsrv-admin |
187 | %config(noreplace)%verify(not md5 mtime size) /etc/sysconfig/dirsrv-admin | |
188 | %attr(755,root,root) %{_sbindir}/* | |
189 | %attr(755,root,root) %{_libdir}/*.so.* | |
cc355b32 | 190 | %{_libdir}/dirsrv |
191 | %{_mandir}/man8/* | |
192 | ||
e21765f5 | 193 | %if %{with selinux} |
cc355b32 | 194 | %files selinux |
05b4ed27 | 195 | %defattr(644,root,root,755) |
cc355b32 | 196 | %{_datadir}/selinux/*/dirsrv-admin.pp |
197 | %endif |