big spec cleanup - step 3 improve spec readability

This commit is contained in:
Michal Hlavinka 2010-06-08 11:54:59 +00:00
parent 11263a4916
commit aff248446c

View File

@ -143,7 +143,7 @@ autoconf -f
# Modify docs master --> cyrus-master
%{__perl} -pi -e "s@master\(8\)@cyrus-master(8)@" man/*5 man/*8 lib/imapoptions
%{__sed} -i -e 's|\([^-]\)master|\1cyrus-master|g;s|^master|cyrus-master|g;s|Master|Cyrus-master|g;s|MASTER|CYRUS-MASTER|g' \
sed -i -e 's|\([^-]\)master|\1cyrus-master|g;s|^master|cyrus-master|g;s|Master|Cyrus-master|g;s|MASTER|CYRUS-MASTER|g' \
man/master.8 doc/man.html
# Modify path in perl scripts
@ -156,7 +156,7 @@ find . -type f -name "*.pl" | xargs %{__perl} -pi -e "s@/usr/local/bin/perl@%{__
%{__perl} -pi -e "s/# idled/ idled/" master/conf/*.conf
# Fix permissions on perl programs
find . -type f -name "*.pl" -exec %{__chmod} 755 {} \;
find . -type f -name "*.pl" -exec chmod 755 {} \;
%build
CPPFLAGS="$RPM_OPT_FLAGS -I%{_includedir}/et -I%{_includedir}/kerberosIV"; export CPPFLAGS
@ -184,13 +184,13 @@ LDFLAGS="$LDFLAGS -pie"; export LDFLAGS
--with-syslogfacility=MAIL \
--with-krbimpl=mit
%{__make} -C man -f Makefile.dist
%{__make} -C doc -f Makefile.dist
%{__make}
%{__make} -C notifyd notifytest
make -C man -f Makefile.dist
make -C doc -f Makefile.dist
make
make -C notifyd notifytest
%install
%{__rm} -rf %{buildroot}
rm -rf %{buildroot}
# This is needed to install the perl files correctly
pushd perl/imap
@ -201,20 +201,20 @@ pushd perl/sieve/managesieve
popd
# Do what the regular make install does
%{__make} install DESTDIR=%{buildroot} PREFIX=%{_prefix} mandir=%{_mandir}
%{__make} -C man install DESTDIR=%{buildroot} PREFIX=%{_prefix} mandir=%{_mandir}
make install DESTDIR=%{buildroot} PREFIX=%{_prefix} mandir=%{_mandir}
make -C man install DESTDIR=%{buildroot} PREFIX=%{_prefix} mandir=%{_mandir}
%{__install} -m 755 imtest/imtest %{buildroot}%{_bindir}/
%{__install} -m 755 notifyd/notifytest %{buildroot}%{_bindir}/
%{__install} -m 755 perl/imap/cyradm %{buildroot}%{_bindir}/
install -m 755 imtest/imtest %{buildroot}%{_bindir}/
install -m 755 notifyd/notifytest %{buildroot}%{_bindir}/
install -m 755 perl/imap/cyradm %{buildroot}%{_bindir}/
# Install tools
for tool in tools/* ; do
test -f ${tool} && %{__install} -m 755 ${tool} %{buildroot}%{_cyrexecdir}/
test -f ${tool} && install -m 755 ${tool} %{buildroot}%{_cyrexecdir}/
done
# Create directories
%{__install} -d \
install -d \
%{buildroot}%{_sysconfdir}/{rc.d/init.d,logrotate.d,pam.d,sysconfig,cron.daily} \
%{buildroot}%{_libdir}/sasl \
%{buildroot}%{_var}/spool/imap \
@ -225,40 +225,40 @@ done
doc/contrib
# Install additional files
%{__install} -m 755 %{SOURCE8} %{buildroot}%{_cyrexecdir}/cvt_cyrusdb_all
%{__install} -m 644 %{SOURCE9} %{buildroot}%{_datadir}/%{name}/rpm/magic
%{__install} -p -m 644 master/conf/prefork.conf %{buildroot}%{_sysconfdir}/cyrus.conf
%{__install} -p -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/imapd.conf
%{__install} -p -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/pam.d/pop
%{__install} -p -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/pam.d/imap
%{__install} -p -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/pam.d/sieve
%{__install} -p -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/pam.d/mupdate
%{__install} -p -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/pam.d/lmtp
%{__install} -p -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/pam.d/nntp
%{__install} -p -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/pam.d/csync
%{__install} -p -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
%{__install} -p -m 755 %{SOURCE6} %{buildroot}%{_sysconfdir}/rc.d/init.d/%{name}
%{__install} -p -m 644 %{SOURCE7} %{buildroot}%{_sysconfdir}/sysconfig/%{name}
%{__install} -p -m 755 %{SOURCE10} %{buildroot}%{_sysconfdir}/cron.daily/%{name}
install -m 755 %{SOURCE8} %{buildroot}%{_cyrexecdir}/cvt_cyrusdb_all
install -m 644 %{SOURCE9} %{buildroot}%{_datadir}/%{name}/rpm/magic
install -p -m 644 master/conf/prefork.conf %{buildroot}%{_sysconfdir}/cyrus.conf
install -p -m 644 %{SOURCE2} %{buildroot}%{_sysconfdir}/imapd.conf
install -p -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/pam.d/pop
install -p -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/pam.d/imap
install -p -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/pam.d/sieve
install -p -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/pam.d/mupdate
install -p -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/pam.d/lmtp
install -p -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/pam.d/nntp
install -p -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/pam.d/csync
install -p -m 644 %{SOURCE1} %{buildroot}%{_sysconfdir}/logrotate.d/%{name}
install -p -m 755 %{SOURCE6} %{buildroot}%{_sysconfdir}/rc.d/init.d/%{name}
install -p -m 644 %{SOURCE7} %{buildroot}%{_sysconfdir}/sysconfig/%{name}
install -p -m 755 %{SOURCE10} %{buildroot}%{_sysconfdir}/cron.daily/%{name}
# Cleanup of doc dir
find doc perl -name CVS -type d -prune -exec echo %{__rm} -rf {} \;
find doc perl -name .cvsignore -type f -exec %{__rm} -rf {} \;
%{__rm} -f doc/Makefile.dist*
%{__rm} -f doc/text/htmlstrip.c
%{__rm} -f doc/text/Makefile
%{__rm} -rf doc/man
find doc perl -name CVS -type d -prune -exec rm -rf {} \;
find doc perl -name .cvsignore -type f -exec rm -f {} \;
rm -f doc/Makefile.dist*
rm -f doc/text/htmlstrip.c
rm -f doc/text/Makefile
rm -rf doc/man
# fix permissions on perl .so files
find %{buildroot}%{_libdir}/perl5/ -type f -name "*.so" -exec %{__chmod} 755 {} \;
find %{buildroot}%{_libdir}/perl5/ -type f -name "*.so" -exec chmod 755 {} \;
# fix conflicts with uw-imap
mv %{buildroot}%{_mandir}/man8/imapd.8 %{buildroot}%{_mandir}/man8/imapd.8cyrus
mv %{buildroot}%{_mandir}/man8/pop3d.8 %{buildroot}%{_mandir}/man8/pop3d.8cyrus
# Install templates
%{__install} -m 755 -d doc/conf
%{__install} -m 644 master/conf/*.conf doc/conf/
install -m 755 -d doc/conf
install -m 644 master/conf/*.conf doc/conf/
# Generate db config file
( grep '^{' lib/imapoptions | grep _db | cut -d'"' -f 2,4 | \
@ -269,33 +269,33 @@ mv %{buildroot}%{_mandir}/man8/pop3d.8 %{buildroot}%{_mandir}/man8/pop3d.8cyrus
touch %{buildroot}%{ssl_pem_file}
# Rename 'master' binary and manpage to avoid clash with postfix
%{__mv} -f %{buildroot}%{_cyrexecdir}/master %{buildroot}%{_cyrexecdir}/cyrus-master
%{__mv} -f %{buildroot}%{_mandir}/man8/master.8 %{buildroot}%{_mandir}/man8/cyrus-master.8
mv -f %{buildroot}%{_cyrexecdir}/master %{buildroot}%{_cyrexecdir}/cyrus-master
mv -f %{buildroot}%{_mandir}/man8/master.8 %{buildroot}%{_mandir}/man8/cyrus-master.8
# Rename 'fetchnews' binary and manpage to avoid clash with leafnode
%{__mv} -f %{buildroot}%{_cyrexecdir}/fetchnews %{buildroot}%{_cyrexecdir}/cyrfetchnews
%{__mv} -f %{buildroot}%{_mandir}/man8/fetchnews.8 %{buildroot}%{_mandir}/man8/cyrfetchnews.8
mv -f %{buildroot}%{_cyrexecdir}/fetchnews %{buildroot}%{_cyrexecdir}/cyrfetchnews
mv -f %{buildroot}%{_mandir}/man8/fetchnews.8 %{buildroot}%{_mandir}/man8/cyrfetchnews.8
%{__perl} -pi -e 's|fetchnews|cyrfetchnews|g;s|Fetchnews|Cyrfetchnews|g;s/FETCHNEWS/CYRFETCHNEWS/g' \
%{buildroot}%{_mandir}/man8/cyrfetchnews.8
#remove executable bit from docs
for ddir in doc perl/imap/examples
do
find $ddir -type f -exec %{__chmod} -x {} \;
find $ddir -type f -exec chmod -x {} \;
done
# Remove installed but not packaged files
%{__rm} -f %{buildroot}%{_cyrexecdir}/not-mkdep
%{__rm} -f %{buildroot}%{_cyrexecdir}/config2header*
%{__rm} -f %{buildroot}%{_cyrexecdir}/config2man
%{__rm} -f %{buildroot}%{_cyrexecdir}/pop3proxyd
find %{buildroot} -name "perllocal.pod" -exec %{__rm} -f {} \;
find %{buildroot} -name ".packlist" -exec %{__rm} -f {} \;
%{__rm} -f %{buildroot}%{_mandir}/man8/syncnews.8*
find %{buildroot}%{perl_vendorarch} -name "*.bs" -exec %{__rm} -f {} \;
rm -f %{buildroot}%{_cyrexecdir}/not-mkdep
rm -f %{buildroot}%{_cyrexecdir}/config2header*
rm -f %{buildroot}%{_cyrexecdir}/config2man
rm -f %{buildroot}%{_cyrexecdir}/pop3proxyd
find %{buildroot} -name "perllocal.pod" -exec rm -f {} \;
find %{buildroot} -name ".packlist" -exec rm -f {} \;
rm -f %{buildroot}%{_mandir}/man8/syncnews.8*
find %{buildroot}%{perl_vendorarch} -name "*.bs" -exec rm -f {} \;
%clean
%{__rm} -rf %{buildroot}
rm -rf %{buildroot}
%pre
# Create 'cyrus' user on target host
@ -315,7 +315,7 @@ exec > /dev/null 2> /dev/null
if [ ! -f %{ssl_pem_file} ]; then
pushd %{_sysconfdir}/pki/tls/certs
umask 077
%{__cat} << EOF | make %{name}.pem
cat << EOF | make %{name}.pem
--
SomeState
SomeCity
@ -324,8 +324,8 @@ SomeOrganizationalUnit
localhost.localdomain
root@localhost.localdomain
EOF
%{__chown} root.%{_cyrusgroup} %{name}.pem
%{__chmod} 640 %{name}.pem
chown root.%{_cyrusgroup} %{name}.pem
chmod 640 %{name}.pem
mv %{name}.pem %{ssl_pem_file}
popd
fi