/* alpine RPM fixes for /etc/pine.conf and friends This patch is for alpine-0.99999, by The University of Washington et. al. http://www.washington.edu/alpine/ Patch written by Richard Bullington-McGuire email: rbulling@pkrinternet.com http://www.pkrinternet.com/ Copyright (C) 2007 PKR Internet, LLC Features: Without this patch, alpine could not find its configuration file, pine.conf, in the usual places (/etc or /usr/local/lib). It was looking in the literal filenames "${prefix}/etc/pine.conf" and "${prefix}/etc/pine.conf.fixed". This spec file now uses alpine itself to generate a sample /etc/pine.conf configuration file, and also generates an /etc/pine.conf.fixed configuration file. Those files are marked as configuration files in the RPM spec file. This also fixes directions given to the user if the SUID installation of mlock failed. The directions had the wrong directory listed vs. the actual location of mlock. License: Copyright 2007 PKR Internet, LLC Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. This patch lives at: http://www.pkrinternet.com/~rbulling/patches/alpine-0.99999-config-file-fix.patch */ --- alpine-0.99999.spec.orig 2007-11-15 14:18:09.000000000 -0500 +++ alpine-0.99999.spec 2007-11-16 11:14:42.000000000 -0500 @@ -25,7 +25,7 @@ %build touch imap/ip6 -./configure --without-krb5 --with-spellcheck-prog=aspell +./configure --without-krb5 --with-spellcheck-prog=aspell --sysconfdir=%{_sysconfdir} make %install @@ -39,8 +39,8 @@ if ! install -D -m2755 -gmail imap/mlock/mlock $RPM_BUILD_ROOT%{_sbindir}/mlock; then install -D -m755 imap/mlock/mlock $RPM_BUILD_ROOT%{_sbindir}/mlock echo "*** DO NOT FORGET TO DO THE FOLLOWING BY HAND while root: -*** chgrp mail $RPM_BUILD_ROOT%{_sysconfdir}/mlock -*** echo chmod 2755 $RPM_BUILD_ROOT%{_sysconfdir}/mlock" +*** chgrp mail $RPM_BUILD_ROOT%{_sbindir}/mlock +*** echo chmod 2755 $RPM_BUILD_ROOT%{_sbindir}/mlock" fi install -D -m644 doc/alpine.1 $RPM_BUILD_ROOT%{_mandir}/man1/alpine.1 install -D -m644 doc/pico.1 $RPM_BUILD_ROOT%{_mandir}/man1/pico.1 @@ -48,6 +48,16 @@ install -D -m644 doc/rpload.1 $RPM_BUILD_ROOT%{_mandir}/man1/rpload.1 install -D -m644 doc/rpdump.1 $RPM_BUILD_ROOT%{_mandir}/man1/rpdump.1 install -D -m644 imap/src/mailutil/mailutil.1 $RPM_BUILD_ROOT%{_mandir}/man1/mailutil.1 +install -d -m755 $RPM_BUILD_ROOT%{_sysconfdir} +$RPM_BUILD_ROOT%{_bindir}/alpine -conf > $RPM_BUILD_ROOT%{_sysconfdir}/pine.conf +cat < $RPM_BUILD_ROOT%{_sysconfdir}/pine.conf.fixed +# alpine non-overridable configuration file +# +# Users can not change settings listed in this file, unlike those +# listed in pine.conf. +# +# See %{_sysconfdir}/pine.conf for example settings. +EOF %clean [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT @@ -68,3 +78,5 @@ %{_mandir}/man1/rpload.1* %{_mandir}/man1/rpdump.1* %{_mandir}/man1/mailutil.1* +%config(noreplace) %{_sysconfdir}/pine.conf +%config(noreplace) %{_sysconfdir}/pine.conf.fixed