"Fossies" - the Fresh Open Source Software Archive

Member "sqwebmail-6.0.3/sqwebmail.spec.in" (20 Aug 2019, 7166 Bytes) of package /linux/www/sqwebmail-6.0.3.tar.bz2:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. See also the latest Fossies "Diffs" side-by-side code changes report for "sqwebmail.spec.in": 6.0.2_vs_6.0.3.

    1 #
    2 # Copyright 1998 - 2018 Double Precision, Inc.  See COPYING for
    3 # distribution information.
    4 
    5 
    6 #
    7 #  Need to version-upgrade RH builds due to different directory locations.
    8 #
    9 
   10 %define is_not_mandrake %(test ! -e /etc/mandrake-release && echo 1 || echo 0)
   11 
   12 %if 0%{!?dist:1}
   13 %if %is_not_mandrake
   14 %define courier_release %(release="`rpm -q --queryformat='.%{VERSION}' redhat-release 2>/dev/null`" ; if test $? != 0 ; then release="`rpm -q --queryformat='.%{VERSION}' fedora-release 2>/dev/null`" ; if test $? != 0 ; then release="" ; fi ; fi ; echo "$release")
   15 %else
   16 %define courier_release mdk
   17 %endif
   18 %else
   19 %define courier_release %{nil}
   20 %endif
   21 
   22 %define _missing_doc_files_terminate_build 1
   23 %define _unpackaged_files_terminate_build 1
   24 
   25 %{expand:%%define apachedir %(if test -d /home/httpd ; then echo /home/httpd ; else echo /var/www ; fi)}
   26 
   27 %define	cgibindir		%{apachedir}/cgi-bin
   28 %define imagedir		%{apachedir}/html/webmail
   29 %define	imageurl		/webmail
   30 
   31 %define	cacheowner		bin
   32 %define cachedir		%{_localstatedir}/webmail-logincache
   33 
   34 %{expand:%%define initdir %(if test -d /etc/init.d/. ; then echo /etc/init.d ; else echo /etc/rc.d/init.d ; fi)}
   35 
   36 Summary: SqWebMail - Maildir Webmail CGI client.
   37 Name: @PACKAGE@
   38 Version: @VERSION@
   39 Release: 1%{?dist}%{courier_release}
   40 License: GPL
   41 Group: Applications/Mail
   42 Source: http://download.sourceforge.net/courier/@PACKAGE@-@VERSION@.tar.bz2
   43 Url: http://www.courier-mta.org/sqwebmail
   44 BuildRoot: %{_tmppath}/sqwebmail-install
   45 Requires: /etc/cron.hourly expect
   46 
   47 %{?_with_gpg2:  %define with_gpg2 1}
   48 %{!?_with_gpg2: %define with_gpg2 0}
   49 
   50 %if %with_gpg2
   51 BuildRequires: gnupg2
   52 Requires: gnupg2
   53 %define gpg_option --with-gpg2
   54 %else
   55 BuildRequires: gnupg >= 1.0.5
   56 Requires: gnupg >= 1.0.5
   57 %endif
   58 
   59 Requires(post):   systemd
   60 Requires(postun): systemd
   61 Requires(preun):  systemd
   62 
   63 %if %is_not_mandrake
   64 Requires: %{cgibindir}
   65 %endif
   66 Obsoletes: %{name}-mysql
   67 Obsoletes: %{name}-pgsql
   68 
   69 BuildRequires: gcc-c++
   70 BuildRequires: procps-ng
   71 BuildRequires: rpm >= 4.0.2 coreutils grep perl
   72 BuildRequires: %(which gpg >/dev/null 2>/dev/null && echo 'gnupg >= 1.0.5' && exit 0; echo gnupg2)
   73 BuildRequires: openldap-devel courier-authlib-devel >= 0.55
   74 BuildRequires: /etc/mime.types
   75 BuildRequires: libidn-devel
   76 BuildRequires: courier-unicode-devel
   77 
   78 %define is_fedora %(if rpm -q fedora-release >/dev/null 2>/dev/null; then echo "1"; exit 0; fi; echo "1"; exit 1)
   79 
   80 %if %is_fedora
   81 BuildRequires: perl-generators
   82 BuildRequires: /usr/lib/locale/locale-archive
   83 %endif
   84 
   85 %description
   86 SqWebMail is a Webmail CGI for Maildir mailboxes.
   87 
   88 %package ldap
   89 Group: Applications/Mail
   90 Summary: LDAP address book hook for SqWebMail
   91 Requires: %{name} = 0:%{version}-%{release}
   92 
   93 %description ldap
   94 This package installes the SqWebMail LDAP address book lookup module.
   95 
   96 %define _prefix /usr/lib/sqwebmail
   97 %define _sysconfdir %{_prefix}/etc
   98 %define _mandir %{_prefix}/man
   99 
  100 %define scriptdir %{_datadir}/sqwebmail
  101 %define htmldir %{_datadir}/sqwebmail/html
  102 
  103 %prep
  104 %setup -q
  105 PATH=/usr/bin:$PATH %configure %{?notice_option} \
  106 	--enable-cgibindir=%{cgibindir} \
  107 	--enable-imagedir=%{imagedir} \
  108 	--enable-imageurl=%{imageurl} \
  109 	--with-cachedir=%{cachedir} \
  110 	--with-cacheowner=%{cacheowner} \
  111 	%{?gpg_option} \
  112 	%{?xflags: %{xflags}}
  113 
  114 
  115 #
  116 #  --sysconfdir needed for RH 7.x
  117 #
  118 
  119 %build
  120 %{__make} %{_smp_mflags}
  121 %{__make} check
  122 %install
  123 %{__rm} -rf $RPM_BUILD_ROOT
  124 %{__make} install DESTDIR=$RPM_BUILD_ROOT
  125 %{__mkdir} -p $RPM_BUILD_ROOT/etc/pam.d
  126 %{__install} -m 0444 libs/sqwebmail/webmail.authpam $RPM_BUILD_ROOT/etc/pam.d/webmail
  127 %{__install} -m 0444 libs/sqwebmail/webmail.authpam $RPM_BUILD_ROOT/etc/pam.d/calendar
  128 
  129 %{__rm} $RPM_BUILD_ROOT%{htmldir}/en || exit 1
  130 # Drop the soft link -> en_us, this is taken care of by post script.
  131 
  132 %{__mkdir} -p $RPM_BUILD_ROOT/etc/cron.hourly
  133 %{__cat} >$RPM_BUILD_ROOT/etc/cron.hourly/sqwebmail-cron-cleancache <<EOF
  134 #!/bin/sh
  135 
  136 su - %{cacheowner} -s /bin/sh -c %{scriptdir}/cleancache.pl
  137 EOF
  138 
  139 #
  140 # Red Hat /etc/profile.d scripts
  141 #
  142 
  143 %{__mkdir} -p $RPM_BUILD_ROOT/etc/profile.d
  144 %{__cat} >$RPM_BUILD_ROOT/etc/profile.d/sqwebmail.sh <<EOF
  145 if echo "\$MANPATH" | tr ':' '\012' | fgrep -qx %{_mandir}
  146 then
  147 	:
  148 else
  149 	MANPATH="%{_mandir}:\$MANPATH"
  150 	export MANPATH
  151 
  152 	if test -w /etc
  153 	then
  154 		PATH="%{_sbindir}:\$PATH"
  155 	fi
  156 	export PATH
  157 fi
  158 EOF
  159 
  160 %{__cat} >$RPM_BUILD_ROOT/etc/profile.d/sqwebmail.csh <<EOF
  161 
  162 if ( \$?MANPATH ) then
  163 	true
  164 else
  165 	setenv MANPATH ""
  166 endif
  167 
  168 echo "\$MANPATH" | tr ':' '\012' | fgrep -qx %{_mandir}
  169 
  170 if ( \$? ) then
  171 	true
  172 else
  173 	setenv MANPATH "%{_mandir}:\$MANPATH"
  174 	test -w /etc
  175 	if ( \$? ) then
  176 		true
  177         else
  178 		setenv PATH "%{_sbindir}:\$PATH"
  179 	endif
  180 endif
  181 EOF
  182 
  183 #
  184 # Red Hat init.d file
  185 #
  186 
  187 %{__mkdir} -p $RPM_BUILD_ROOT/lib/systemd/system
  188 
  189 %{__cat} >$RPM_BUILD_ROOT/lib/systemd/system/sqwebmail.service <<EOF
  190 [Unit]
  191 Description=SqWebMail
  192 Wants=network.target
  193 Wants=courier-authlib.service
  194 Wants=mail-transfer-agent.target
  195 After=network.target
  196 After=courier-authlib.service
  197 After=mail-transfer-agent.target
  198 
  199 [Install]
  200 WantedBy=multi-user.target
  201 
  202 [Service]
  203 Type=forking
  204 RemainAfterExit=true
  205 ExecStart=%{_libexecdir}/sqwebmaild.rc start
  206 ExecStop=%{_libexecdir}/sqwebmaild.rc stop
  207 EOF
  208 
  209 %{__cp} sysconftool $RPM_BUILD_ROOT%{scriptdir}/sysconftool
  210 
  211 %{__cp} libs/pcp/README.html pcp_README.html
  212 
  213 . libs/pcp/uids
  214 echo '%attr(-, ' "$localcacheowner, $mailgroup) $calendardir" >filelist
  215 
  216 (
  217 courierauthconfig --configfiles >configtmp || exit 1
  218 . ./configtmp
  219 echo '%attr(-, '"$mailuser, $mailgroup" ') %{_libexecdir}' >>filelist
  220 ) || exit 1
  221 
  222 ls $RPM_BUILD_ROOT%{scriptdir} | grep -v ldapsearch | sed 's:^:%attr(555, root, root) %{scriptdir}/:' >>filelist
  223 
  224 # Weird rpm bug.
  225 echo '%{cgibindir}/*' >>filelist
  226 echo '%{imagedir}' >>filelist
  227 
  228 %post
  229 
  230 test -d %{htmldir}/en || ln -fs en-us %{htmldir}/en
  231 
  232 if test -f %{initdir}/sqwebmail
  233 then
  234 	/sbin/chkconfig --del sqwebmail
  235 	/bin/systemctl stop sqwebmail.service
  236 fi
  237 
  238 %{scriptdir}/sysconftool %{_sysconfdir}/*.dist >/dev/null
  239 
  240 %systemd_post sqwebmail.service
  241 
  242 if [ $1 -eq 1 ]
  243 then
  244     /bin/systemctl daemon-reload >/dev/null 2>&1 || :
  245 fi
  246 
  247 %preun
  248 
  249 %systemd_preun sqwebmail.service
  250 
  251 %postun
  252 test -d %{htmldir}/en || %{__rm} -f %{htmldir}/en
  253 
  254 %systemd_postun_with_restart sqwebmail.service
  255 
  256 %files -f filelist
  257 %defattr(-, root, bin)
  258 %dir %{_prefix}
  259 %if "%{_prefix}" != "%{_exec_prefix}"
  260 %dir %{_exec_prefix}
  261 %endif
  262 
  263 %attr(555, root, root) %dir %{scriptdir}
  264 %dir %{_sysconfdir}
  265 %{_sysconfdir}/*.dist
  266 
  267 %{_sbindir}
  268 %{_mandir}
  269 
  270 %attr(644, root, root) /lib/systemd/system/*
  271 
  272 %attr(700, %{cacheowner}, bin) %{cachedir}
  273 %attr(644, root, root) %config(noreplace) /etc/pam.d/*
  274 
  275 %attr(755, bin, bin) /etc/cron.hourly/sqwebmail-cron-cleancache
  276 %attr(755, bin, bin) /etc/profile.d/sqwebmail.sh
  277 %attr(755, bin, bin) /etc/profile.d/sqwebmail.csh
  278 
  279 %attr(-, bin, bin) %doc AUTHORS libs/sqwebmail/BUGS COPYING INSTALL NEWS README libs/sqwebmail/SECURITY libs/sqwebmail/TODO libs/gpglib/README.html
  280 %attr(-, bin, bin) %doc libs/sqwebmail/BUGS.html INSTALL.html NEWS README.html libs/sqwebmail/SECURITY.html libs/sqwebmail/TODO.html libs/sqwebmail/ChangeLog pcp_README.html
  281 %attr(-, bin, bin) %doc libs/maildir/README*.html
  282 
  283 %files ldap
  284 %attr(755, root, root) %{scriptdir}/ldapsearch
  285 
  286 %clean
  287 %{__rm} -rf $RPM_BUILD_ROOT