Tue, 28 Aug 2012 18:52:10 +0200
Update version, remove seemingly unneded Groff dependency, and update patching.
michael@144 | 1 | ## |
michael@144 | 2 | ## sasl.spec -- OpenPKG RPM Package Specification |
michael@144 | 3 | ## Copyright (c) 2000-2008 OpenPKG Foundation e.V. <http://openpkg.net/> |
michael@144 | 4 | ## |
michael@144 | 5 | ## Permission to use, copy, modify, and distribute this software for |
michael@144 | 6 | ## any purpose with or without fee is hereby granted, provided that |
michael@144 | 7 | ## the above copyright notice and this permission notice appear in all |
michael@144 | 8 | ## copies. |
michael@144 | 9 | ## |
michael@144 | 10 | ## THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED |
michael@144 | 11 | ## WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF |
michael@144 | 12 | ## MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. |
michael@144 | 13 | ## IN NO EVENT SHALL THE AUTHORS AND COPYRIGHT HOLDERS AND THEIR |
michael@144 | 14 | ## CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, |
michael@144 | 15 | ## SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT |
michael@144 | 16 | ## LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF |
michael@144 | 17 | ## USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND |
michael@144 | 18 | ## ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, |
michael@144 | 19 | ## OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT |
michael@144 | 20 | ## OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF |
michael@144 | 21 | ## SUCH DAMAGE. |
michael@144 | 22 | ## |
michael@144 | 23 | |
michael@144 | 24 | # package information |
michael@144 | 25 | Name: sasl |
michael@144 | 26 | Summary: Simple Authentication and Security Layer (SASL) |
michael@144 | 27 | URL: http://asg.web.cmu.edu/sasl/ |
michael@144 | 28 | Vendor: Cyrus Project, CMU |
michael@144 | 29 | Packager: OpenPKG Foundation e.V. |
michael@144 | 30 | Distribution: OpenPKG Community |
michael@144 | 31 | Class: BASE |
michael@144 | 32 | Group: Cryptography |
michael@144 | 33 | License: BSD |
michael@597 | 34 | Version: 2.1.23 |
michael@597 | 35 | Release: 20120208 |
michael@144 | 36 | |
michael@144 | 37 | # package options |
michael@144 | 38 | %option with_fsl yes |
michael@144 | 39 | %option with_sasldb yes |
michael@144 | 40 | %option with_pam no |
michael@144 | 41 | %option with_login no |
michael@144 | 42 | %option with_ldap no |
michael@144 | 43 | %option with_mysql no |
michael@144 | 44 | %option with_pgsql no |
michael@144 | 45 | %option with_sqlite no |
michael@144 | 46 | %option with_ntlm no |
michael@144 | 47 | %option with_otp no |
michael@144 | 48 | %option with_srp no |
michael@144 | 49 | %option with_kerberos no |
michael@144 | 50 | |
michael@144 | 51 | # list of sources |
michael@144 | 52 | Source0: ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/cyrus-sasl-%{version}.tar.gz |
michael@144 | 53 | Source1: rc.sasl |
michael@144 | 54 | Source2: fsl.sasl |
michael@144 | 55 | Source3: saslauthd.conf |
michael@144 | 56 | Source4: sasl.pc |
michael@144 | 57 | Patch0: sasl.patch |
michael@144 | 58 | |
michael@144 | 59 | # build information |
michael@144 | 60 | Prefix: %{l_prefix} |
michael@144 | 61 | BuildRoot: %{l_buildroot} |
michael@597 | 62 | BuildPreReq: OpenPKG, openpkg >= 20060823, gcc, make |
michael@144 | 63 | PreReq: OpenPKG, openpkg >= 20060823 |
michael@144 | 64 | BuildPreReq: db >= 4.1.24, openssl |
michael@144 | 65 | PreReq: db >= 4.1.24, openssl |
michael@144 | 66 | %if "%{with_fsl}" == "yes" |
michael@144 | 67 | BuildPreReq: fsl |
michael@144 | 68 | PreReq: fsl |
michael@144 | 69 | %endif |
michael@144 | 70 | %if "%{with_pam}" == "yes" |
michael@144 | 71 | BuildPreReq: PAM |
michael@144 | 72 | PreReq: PAM |
michael@144 | 73 | %endif |
michael@144 | 74 | %if "%{with_ldap}" == "yes" |
michael@144 | 75 | BuildPreReq: openldap |
michael@144 | 76 | PreReq: openldap |
michael@144 | 77 | %endif |
michael@144 | 78 | %if "%{with_mysql}" == "yes" |
michael@144 | 79 | BuildPreReq: mysql |
michael@144 | 80 | PreReq: mysql |
michael@144 | 81 | %endif |
michael@144 | 82 | %if "%{with_pgsql}" == "yes" |
michael@144 | 83 | BuildPreReq: postgresql |
michael@144 | 84 | PreReq: postgresql |
michael@144 | 85 | %endif |
michael@144 | 86 | %if "%{with_sqlite}" == "yes" |
michael@144 | 87 | BuildPreReq: sqlite |
michael@144 | 88 | PreReq: sqlite |
michael@144 | 89 | %endif |
michael@144 | 90 | %if "%{with_otp}" == "yes" |
michael@144 | 91 | BuildPreReq: opie |
michael@144 | 92 | PreReq: opie |
michael@144 | 93 | %endif |
michael@144 | 94 | %if "%{with_kerberos}" == "yes" |
michael@144 | 95 | BuildPreReq: KERBEROS |
michael@144 | 96 | PreReq: KERBEROS |
michael@144 | 97 | %endif |
michael@144 | 98 | AutoReq: no |
michael@144 | 99 | AutoReqProv: no |
michael@144 | 100 | |
michael@144 | 101 | %description |
michael@144 | 102 | SASL is the Simple Authentication and Security Layer, a method |
michael@144 | 103 | for adding authentication support to connection-based protocols. |
michael@144 | 104 | To use SASL, a protocol includes a command for identifying and |
michael@144 | 105 | authenticating a user to a server and for optionally negotiating |
michael@144 | 106 | protection of subsequent protocol interactions. If its use is |
michael@144 | 107 | negotiated, a security layer is inserted between the protocol and |
michael@144 | 108 | the connection. |
michael@144 | 109 | |
michael@144 | 110 | %track |
michael@144 | 111 | prog sasl = { |
michael@144 | 112 | version = %{version} |
michael@144 | 113 | url = ftp://ftp.andrew.cmu.edu/pub/cyrus-mail/ |
michael@144 | 114 | regex = cyrus-sasl-(\d+\.\d+\.\d+)\.tar\.gz |
michael@144 | 115 | } |
michael@144 | 116 | |
michael@144 | 117 | %prep |
michael@144 | 118 | %setup -q -n cyrus-sasl-%{version} |
michael@144 | 119 | %patch -p0 |
michael@144 | 120 | |
michael@144 | 121 | %build |
michael@144 | 122 | # ensure the OpenPKG Berkeley-DB is picked up only |
michael@144 | 123 | %{l_shtool} subst \ |
michael@144 | 124 | -e 's;for dbname in db-.*db$;for dbname in db;' \ |
michael@144 | 125 | saslauthd/configure configure |
michael@144 | 126 | |
michael@144 | 127 | # disable some unwanted configure checks |
michael@144 | 128 | %{l_shtool} subst \ |
michael@144 | 129 | -e 's;\(SASL_DB_UTILS="saslpasswd2 sasldblistusers2\);\1 dbconverter-2;' \ |
michael@144 | 130 | -e "s;javac;javac-xxx;g" \ |
michael@144 | 131 | -e "s;javah;javah-xxx;g" \ |
michael@144 | 132 | -e "s;javadoc;javadoc-xxx;g" \ |
michael@144 | 133 | configure |
michael@144 | 134 | |
michael@144 | 135 | # fix OpenLDAP support |
michael@144 | 136 | %if "%{with_ldap}" == "yes" |
michael@144 | 137 | echo 'ac_cv_lib_ldap_ldap_initialize=yes' >config.cache |
michael@144 | 138 | %{l_shtool} subst \ |
michael@144 | 139 | -e "s;\(\$LDAP_LIBS\) *\(-lcrypto\);\1 -lssl -lcrypto \2;" \ |
michael@144 | 140 | saslauthd/configure |
michael@144 | 141 | %endif |
michael@144 | 142 | |
michael@144 | 143 | # fix GSS/Kerberos support |
michael@144 | 144 | %if "%{with_kerberos}" == "yes" |
michael@144 | 145 | %{l_shtool} subst \ |
michael@144 | 146 | -e 's;\(-lk5crypto\);\1 -lkrb5support;' \ |
michael@144 | 147 | configure |
michael@144 | 148 | %endif |
michael@144 | 149 | |
michael@144 | 150 | # enforce disabled Kerberos 5 support in saslauthd |
michael@144 | 151 | echo 'ac_cv_header_krb5_h=no' >config.cache |
michael@144 | 152 | |
michael@144 | 153 | # configure path to sasl-server config files |
michael@144 | 154 | %{l_shtool} subst \ |
michael@144 | 155 | -e 's;@l_sysconfdir@;%{l_prefix}/etc/sasl/sasl.d;g' \ |
michael@144 | 156 | lib/server.c |
michael@144 | 157 | |
michael@144 | 158 | # determine build flags |
michael@144 | 159 | cflags="%{l_cflags -O} %{l_cppflags}" |
michael@144 | 160 | ldflags="%{l_ldflags} %{l_fsl_ldflags}" |
michael@144 | 161 | libs="-ldb %{l_fsl_libs}" |
michael@144 | 162 | %if "%{with_ldap}" == "yes" |
michael@144 | 163 | cflags="$cflags -DAUTH_LDAP" |
michael@144 | 164 | %endif |
michael@144 | 165 | %if "%{with_mysql}" == "yes" |
michael@144 | 166 | libs="$libs -lz -lm" |
michael@144 | 167 | %endif |
michael@144 | 168 | %if "%{with_pgsql}" == "yes" |
michael@144 | 169 | cflags="$cflags -I%{l_cppflags postgresql}" |
michael@144 | 170 | libs="$libs -lssl -lcrypto -lcrypt" |
michael@144 | 171 | %endif |
michael@144 | 172 | %if "%{with_kerberos}" == "yes" |
michael@144 | 173 | cflags="$cflags `krb5-config --cflags gssapi`" |
michael@144 | 174 | libs="$libs `krb5-config --libs gssapi`" |
michael@144 | 175 | %endif |
michael@144 | 176 | case "%{l_platform -t}" in |
michael@144 | 177 | *-sunos* ) libs="$libs -lrt" ;; |
michael@144 | 178 | esac |
michael@144 | 179 | |
michael@144 | 180 | # configure package |
michael@144 | 181 | CC="%{l_cc}" \ |
michael@144 | 182 | CFLAGS="$cflags" \ |
michael@144 | 183 | CPPFLAGS="%{l_cppflags}" \ |
michael@144 | 184 | LDFLAGS="$ldflags" \ |
michael@144 | 185 | LIBS="$libs" \ |
michael@144 | 186 | ./configure \ |
michael@144 | 187 | --cache-file=./config.cache \ |
michael@144 | 188 | --prefix=%{l_prefix} \ |
michael@144 | 189 | --sysconfdir=%{l_prefix}/etc/sasl \ |
michael@144 | 190 | --with-configdir=%{l_prefix}/etc/sasl/sasl.d \ |
michael@144 | 191 | --with-plugindir=%{l_prefix}/lib/sasl \ |
michael@144 | 192 | --with-saslauthd=%{l_prefix}/var/sasl/run/saslauthd \ |
michael@144 | 193 | --enable-digest \ |
michael@144 | 194 | --enable-cram \ |
michael@144 | 195 | --enable-anon \ |
michael@144 | 196 | %if "%{with_sasldb}" == "yes" |
michael@144 | 197 | --enable-auth-sasldb \ |
michael@144 | 198 | --with-dbpath=%{l_prefix}/var/sasl/run/sasl.db \ |
michael@144 | 199 | --with-dblib=berkeley \ |
michael@144 | 200 | --with-bdb-incdir=%{l_prefix}/include \ |
michael@144 | 201 | --with-bdb-libdir=%{l_prefix}/lib \ |
michael@144 | 202 | %else |
michael@144 | 203 | --with-dblib=none \ |
michael@144 | 204 | %endif |
michael@144 | 205 | --with-openssl=%{l_prefix} \ |
michael@144 | 206 | %if "%{with_pam}" == "yes" |
michael@144 | 207 | --with-pam \ |
michael@144 | 208 | %else |
michael@144 | 209 | --without-pam \ |
michael@144 | 210 | %endif |
michael@144 | 211 | %if "%{with_login}" == "yes" |
michael@144 | 212 | --enable-login \ |
michael@144 | 213 | %else |
michael@144 | 214 | --disable-login \ |
michael@144 | 215 | %endif |
michael@144 | 216 | %if "%{with_ldap}" == "yes" |
michael@144 | 217 | --with-ldap=%{l_prefix} \ |
michael@144 | 218 | %else |
michael@144 | 219 | --without-ldap \ |
michael@144 | 220 | %endif |
michael@144 | 221 | %if "%{with_otp}" == "yes" |
michael@144 | 222 | --enable-otp \ |
michael@144 | 223 | --with-opie=%{l_prefix} \ |
michael@144 | 224 | %else |
michael@144 | 225 | --disable-otp \ |
michael@144 | 226 | --without-opie \ |
michael@144 | 227 | %endif |
michael@144 | 228 | %if "%{with_srp}" == "yes" |
michael@144 | 229 | --enable-srp \ |
michael@144 | 230 | %else |
michael@144 | 231 | --disable-srp \ |
michael@144 | 232 | %endif |
michael@144 | 233 | %if "%{with_kerberos}" == "yes" |
michael@144 | 234 | --enable-gssapi \ |
michael@144 | 235 | --with-gss_impl=`if [ -d %{l_prefix}/include/heimdal ]; then echo "heimdal"; else echo "mit"; fi` \ |
michael@144 | 236 | %else |
michael@144 | 237 | --disable-gssapi \ |
michael@144 | 238 | --without-gss_impl \ |
michael@144 | 239 | %endif |
michael@144 | 240 | %if "%{with_mysql}" == "yes" || "%{with_pgsql}" == "yes" || "%{with_sqlite}" == "yes" |
michael@144 | 241 | --enable-sql \ |
michael@144 | 242 | %if "%{with_mysql}" == "yes" |
michael@144 | 243 | --with-mysql=%{l_prefix} \ |
michael@144 | 244 | %else |
michael@144 | 245 | --without-mysql \ |
michael@144 | 246 | %endif |
michael@144 | 247 | %if "%{with_pgsql}" == "yes" |
michael@144 | 248 | --with-pgsql=%{l_prefix} \ |
michael@144 | 249 | %else |
michael@144 | 250 | --without-pgsql \ |
michael@144 | 251 | %endif |
michael@144 | 252 | %if "%{with_sqlite}" == "yes" |
michael@144 | 253 | --with-sqlite=%{l_prefix} \ |
michael@144 | 254 | %else |
michael@144 | 255 | --without-sqlite \ |
michael@144 | 256 | %endif |
michael@144 | 257 | %endif |
michael@144 | 258 | %if "%{with_ntlm}" == "yes" |
michael@144 | 259 | --enable-ntlm \ |
michael@144 | 260 | %else |
michael@144 | 261 | --disable-ntlm \ |
michael@144 | 262 | %endif |
michael@144 | 263 | --enable-shared \ |
michael@144 | 264 | --enable-static \ |
michael@144 | 265 | --enable-staticdlopen \ |
michael@144 | 266 | --enable-sample \ |
michael@144 | 267 | --disable-java \ |
michael@144 | 268 | --disable-krb4 \ |
michael@144 | 269 | --without-des |
michael@144 | 270 | |
michael@144 | 271 | # post adjustment: trust me, libtool, I know what I am doing |
michael@144 | 272 | %{l_shtool} subst \ |
michael@144 | 273 | -e 's;^\(deplibs_check_method=\).*;\1"pass_all";' \ |
michael@144 | 274 | -e 's/\(eval libobjs=.*$whole_archive_flag_spec.*\)$/case $archive_cmds in \\$LD* ) wl= ;; esac; \1/' \ |
michael@144 | 275 | libtool |
michael@144 | 276 | |
michael@144 | 277 | # post adjustment: do not reference static plugins |
michael@144 | 278 | %{l_shtool} subst \ |
michael@144 | 279 | -e '58s;.*;#define PIC;' \ |
michael@144 | 280 | lib/dlopen.c |
michael@144 | 281 | |
michael@144 | 282 | # post adjustment: do not pull static plugins into static library |
michael@144 | 283 | %{l_shtool} subst \ |
michael@144 | 284 | -e 's;-ln -s $(SASL_STATIC_SRCS) .;-ln ../sasldb/*.o ../plugins/*.o $(SASL_STATIC_SRCS) .;' \ |
michael@144 | 285 | lib/Makefile |
michael@144 | 286 | |
michael@144 | 287 | # post adjustment: build utils against static library |
michael@144 | 288 | %{l_shtool} subst \ |
michael@144 | 289 | -e 's;\(\$(CCLD)\);\1 -static;' \ |
michael@144 | 290 | -e 's;\(noinst.*=\) *dbconverter.*;\1;' \ |
michael@144 | 291 | utils/Makefile \ |
michael@144 | 292 | sample/Makefile |
michael@144 | 293 | |
michael@144 | 294 | # post adjustment: fix OpenLDAP support |
michael@144 | 295 | %if "%{with_ldap}" == "yes" |
michael@144 | 296 | %{l_shtool} subst \ |
michael@144 | 297 | -e "s;^\(saslauthd_LDADD[ ]*=[ ]*[^\\]*\);\1 -lcrypt -lldap -llber -lssl -lcrypto ;" \ |
michael@144 | 298 | saslauthd/Makefile |
michael@144 | 299 | %endif |
michael@144 | 300 | |
michael@144 | 301 | # build package |
michael@144 | 302 | %{l_make} %{l_mflags} |
michael@144 | 303 | ( cd saslauthd |
michael@144 | 304 | %{l_make} %{l_mflags} testsaslauthd |
michael@144 | 305 | ) || exit $? |
michael@144 | 306 | ( cd sample |
michael@144 | 307 | %{l_make} %{l_mflags} sample-client sample-server |
michael@144 | 308 | ) || exit $? |
michael@144 | 309 | |
michael@144 | 310 | %install |
michael@144 | 311 | rm -rf $RPM_BUILD_ROOT |
michael@144 | 312 | |
michael@144 | 313 | # install package |
michael@144 | 314 | %{l_make} %{l_mflags} install AM_MAKEFLAGS="DESTDIR=$RPM_BUILD_ROOT" |
michael@144 | 315 | |
michael@144 | 316 | # remove libtool cruft |
michael@144 | 317 | rm -f \ |
michael@144 | 318 | $RPM_BUILD_ROOT%{l_prefix}/lib/*.la \ |
michael@144 | 319 | $RPM_BUILD_ROOT%{l_prefix}/lib/*.s[ol] \ |
michael@144 | 320 | $RPM_BUILD_ROOT%{l_prefix}/lib/*.s[ol].* \ |
michael@144 | 321 | $RPM_BUILD_ROOT%{l_prefix}/lib/sasl2/*.a |
michael@144 | 322 | |
michael@144 | 323 | # post-adjust installation |
michael@144 | 324 | mv $RPM_BUILD_ROOT%{l_prefix}/lib/sasl2 \ |
michael@144 | 325 | $RPM_BUILD_ROOT%{l_prefix}/lib/sasl |
michael@144 | 326 | mv $RPM_BUILD_ROOT%{l_prefix}/sbin/testsaslauthd \ |
michael@144 | 327 | $RPM_BUILD_ROOT%{l_prefix}/sbin/saslauthd-test |
michael@144 | 328 | mv $RPM_BUILD_ROOT%{l_prefix}/sbin/pluginviewer \ |
michael@144 | 329 | $RPM_BUILD_ROOT%{l_prefix}/sbin/sasl-pluginviewer |
michael@144 | 330 | mv $RPM_BUILD_ROOT%{l_prefix}/man/man8/pluginviewer.8 \ |
michael@144 | 331 | $RPM_BUILD_ROOT%{l_prefix}/man/man8/sasl-pluginviewer.8 |
michael@144 | 332 | mv $RPM_BUILD_ROOT%{l_prefix}/sbin/saslpasswd2 \ |
michael@144 | 333 | $RPM_BUILD_ROOT%{l_prefix}/sbin/saslpasswd |
michael@144 | 334 | mv $RPM_BUILD_ROOT%{l_prefix}/man/man8/saslpasswd2.8 \ |
michael@144 | 335 | $RPM_BUILD_ROOT%{l_prefix}/man/man8/saslpasswd.8 |
michael@144 | 336 | mv $RPM_BUILD_ROOT%{l_prefix}/sbin/sasldblistusers2 \ |
michael@144 | 337 | $RPM_BUILD_ROOT%{l_prefix}/sbin/sasldblistusers |
michael@144 | 338 | mv $RPM_BUILD_ROOT%{l_prefix}/man/man8/sasldblistusers2.8 \ |
michael@144 | 339 | $RPM_BUILD_ROOT%{l_prefix}/man/man8/sasldblistusers.8 |
michael@144 | 340 | rm -f $RPM_BUILD_ROOT%{l_prefix}/sbin/dbconverter-2 |
michael@144 | 341 | strip $RPM_BUILD_ROOT%{l_prefix}/sbin/* >/dev/null 2>&1 || true |
michael@144 | 342 | |
michael@144 | 343 | # install sample client/server programs |
michael@144 | 344 | %{l_shtool} install -c -m 755 \ |
michael@144 | 345 | sample/sample-client \ |
michael@144 | 346 | $RPM_BUILD_ROOT%{l_prefix}/sbin/sasl-sample-client |
michael@144 | 347 | %{l_shtool} install -c -m 755 \ |
michael@144 | 348 | sample/sample-server \ |
michael@144 | 349 | $RPM_BUILD_ROOT%{l_prefix}/sbin/sasl-sample-server |
michael@144 | 350 | |
michael@144 | 351 | # install saslauthd default configuration |
michael@144 | 352 | %{l_shtool} mkdir -f -p -m 755 \ |
michael@144 | 353 | $RPM_BUILD_ROOT%{l_prefix}/etc/sasl |
michael@144 | 354 | %{l_shtool} install -c -m 755 \ |
michael@144 | 355 | %{SOURCE saslauthd.conf} \ |
michael@144 | 356 | $RPM_BUILD_ROOT%{l_prefix}/etc/sasl/ |
michael@144 | 357 | |
michael@144 | 358 | # create necessary additional directories |
michael@144 | 359 | %{l_shtool} mkdir -f -p -m 755 \ |
michael@144 | 360 | $RPM_BUILD_ROOT%{l_prefix}/var/sasl/log \ |
michael@144 | 361 | $RPM_BUILD_ROOT%{l_prefix}/var/sasl/run/saslauthd \ |
michael@144 | 362 | $RPM_BUILD_ROOT%{l_prefix}/etc/sasl/sasl.d |
michael@144 | 363 | |
michael@144 | 364 | # install run-command script |
michael@144 | 365 | %if "%{with_pam}" == "yes" |
michael@144 | 366 | l_authmech="pam" |
michael@144 | 367 | %else |
michael@144 | 368 | case "%{l_platform -t}" in |
michael@144 | 369 | *-linux* | *-sunos* ) l_authmech="shadow" ;; |
michael@144 | 370 | * ) l_authmech="getpwent" ;; |
michael@144 | 371 | esac |
michael@144 | 372 | %endif |
michael@144 | 373 | %{l_shtool} mkdir -f -p -m 755 \ |
michael@144 | 374 | $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d |
michael@144 | 375 | %{l_shtool} install -c -m 755 \ |
michael@144 | 376 | -e "s;@l_authmech@;${l_authmech};g" %{l_value -s -a} \ |
michael@144 | 377 | %{SOURCE rc.sasl} \ |
michael@144 | 378 | $RPM_BUILD_ROOT%{l_prefix}/etc/rc.d/ |
michael@144 | 379 | |
michael@144 | 380 | # install OSSP fsl configuration |
michael@144 | 381 | %{l_shtool} mkdir -f -p -m 755 \ |
michael@144 | 382 | $RPM_BUILD_ROOT%{l_prefix}/etc/fsl |
michael@144 | 383 | %{l_shtool} install -c -m 644 %{l_value -s -a} \ |
michael@144 | 384 | %{SOURCE fsl.sasl} \ |
michael@144 | 385 | $RPM_BUILD_ROOT%{l_prefix}/etc/fsl/ |
michael@144 | 386 | |
michael@144 | 387 | # install pkg-config configuration |
michael@144 | 388 | libs="-lsasl2" |
michael@144 | 389 | case "%{l_platform -t}" in |
michael@144 | 390 | *-linux* ) libs="$libs -ldl" ;; |
michael@144 | 391 | esac |
michael@144 | 392 | %{l_shtool} mkdir -f -p -m 755 \ |
michael@144 | 393 | $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig |
michael@144 | 394 | %{l_shtool} install -c -m 644 %{l_value -s -a} \ |
michael@144 | 395 | -e "s;@version@;%{version};" \ |
michael@144 | 396 | -e "s;@libs@;$libs;" \ |
michael@144 | 397 | %{SOURCE sasl.pc} \ |
michael@144 | 398 | $RPM_BUILD_ROOT%{l_prefix}/lib/pkgconfig/ |
michael@144 | 399 | |
michael@144 | 400 | # determine installation files |
michael@144 | 401 | %{l_rpmtool} files -v -ofiles -r$RPM_BUILD_ROOT \ |
michael@144 | 402 | %{l_files_std} \ |
michael@144 | 403 | '%config %{l_prefix}/etc/fsl/fsl.sasl' \ |
michael@144 | 404 | '%config %{l_prefix}/etc/sasl/saslauthd.conf' \ |
michael@144 | 405 | '%dir %attr(0755,%{l_musr},%{l_rgrp}) %{l_prefix}/var/sasl' \ |
michael@144 | 406 | '%dir %attr(0755,%{l_musr},%{l_rgrp}) %{l_prefix}/var/sasl/run' \ |
michael@144 | 407 | '%dir %attr(0755,%{l_musr},%{l_rgrp}) %{l_prefix}/var/sasl/run/saslauthd' \ |
michael@144 | 408 | '%dir %attr(0700,%{l_susr},%{l_sgrp}) %{l_prefix}/var/sasl/log' |
michael@144 | 409 | |
michael@144 | 410 | %files -f files |
michael@144 | 411 | |
michael@144 | 412 | %clean |
michael@144 | 413 | rm -rf $RPM_BUILD_ROOT |
michael@144 | 414 | |
michael@144 | 415 | %pre |
michael@144 | 416 | # before upgrade, save status and stop service |
michael@144 | 417 | [ $1 -eq 2 ] || exit 0 |
michael@144 | 418 | eval `%{l_rc} sasl status 2>/dev/null | tee %{l_tmpfile}` |
michael@144 | 419 | %{l_rc} sasl stop 2>/dev/null |
michael@144 | 420 | exit 0 |
michael@144 | 421 | |
michael@144 | 422 | %post |
michael@144 | 423 | %if "%{with_pam}" == "yes" |
michael@144 | 424 | if [ $1 -eq 1 ]; then |
michael@144 | 425 | # after install, add PAM configuration entry |
michael@144 | 426 | $RPM_INSTALL_PREFIX/sbin/pamtool --add --smart --name=sasl |
michael@144 | 427 | fi |
michael@144 | 428 | %endif |
michael@144 | 429 | if [ $1 -eq 2 ]; then |
michael@144 | 430 | # after upgrade, restore status |
michael@144 | 431 | eval `cat %{l_tmpfile}`; rm -f %{l_tmpfile} |
michael@144 | 432 | [ ".$sasl_active" = .yes ] && %{l_rc} sasl start |
michael@144 | 433 | fi |
michael@144 | 434 | exit 0 |
michael@144 | 435 | |
michael@144 | 436 | %preun |
michael@144 | 437 | # before erase, stop service and remove log files |
michael@144 | 438 | [ $1 -eq 0 ] || exit 0 |
michael@144 | 439 | %{l_rc} sasl stop 2>/dev/null |
michael@144 | 440 | rm -f $RPM_INSTALL_PREFIX/var/sasl/log/*.log* >/dev/null 2>&1 || true |
michael@144 | 441 | %if "%{with_pam}" == "yes" |
michael@144 | 442 | # remove PAM configuration entry |
michael@144 | 443 | $RPM_INSTALL_PREFIX/sbin/pamtool --remove --smart --name=sasl |
michael@144 | 444 | %endif |
michael@144 | 445 | exit 0 |
michael@144 | 446 |