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