spec clean-up
This commit is contained in:
parent
9ea7d4b3e5
commit
a5faf09e16
225
cyrus-imapd.spec
225
cyrus-imapd.spec
@ -8,67 +8,42 @@ Release: 2%{?dist}
|
||||
# rpm --rebuild --define='SEEN_DB skiplist' cyrus-imapd-2.x.x-x.src.rpm
|
||||
|
||||
# use saslauth group
|
||||
%{!?SASLGROUP: %define SASLGROUP 1}
|
||||
%{!?SASLGROUP: %global SASLGROUP 1}
|
||||
# include deliver-wrapper
|
||||
%{!?DEL_WRAP: %define DEL_WRAP 0}
|
||||
%{!?DEL_WRAP: %global DEL_WRAP 0}
|
||||
# use preforking cyrus.conf
|
||||
%{!?PREFORK: %define PREFORK 1}
|
||||
%{!?PREFORK: %global PREFORK 1}
|
||||
# enable Netscape hack (recommended)
|
||||
%{!?NETSCAPEHACK: %define NETSCAPEHACK 1}
|
||||
%{!?NETSCAPEHACK: %global NETSCAPEHACK 1}
|
||||
# enable IMAP4 LIST extensions
|
||||
%{!?LISTEXT: %define LISTEXT 1}
|
||||
%{!?LISTEXT: %global LISTEXT 1}
|
||||
# enable IDLED support
|
||||
%{!?IDLED: %define IDLED 1}
|
||||
%{!?IDLED: %global IDLED 1}
|
||||
# enable SNMP support
|
||||
%{!?SNMP: %define SNMP 1}
|
||||
%{!?SNMP: %global SNMP 1}
|
||||
# force syncronous updates on ext3
|
||||
%{!?FORCESYNCEXT3: %define FORCESYNCEXT3 0}
|
||||
%{!?FORCESYNCEXT3: %global FORCESYNCEXT3 0}
|
||||
# include autocreate feature
|
||||
%{!?AUTOCREATE: %define AUTOCREATE 1}
|
||||
%{!?AUTOCREATE: %global AUTOCREATE 1}
|
||||
# don't check for RFC compliant line termination (bare newlines)
|
||||
%{!?NO_BARE_NL: %define NO_BARE_NL 0}
|
||||
%{!?NO_BARE_NL: %global NO_BARE_NL 0}
|
||||
# used syslog facility for logging
|
||||
%{!?SYSLOGFACILITY: %define SYSLOGFACILITY MAIL}
|
||||
%{!?SYSLOGFACILITY: %global SYSLOGFACILITY MAIL}
|
||||
# use -fpie for linking
|
||||
%{!?USEPIE: %define USEPIE 1}
|
||||
%{!?USEPIE: %global USEPIE 1}
|
||||
|
||||
# ********************** BUILD TIME OPTIONS END ************************
|
||||
|
||||
#%define _acversion 2.59
|
||||
%define _use_internal_dependency_generator 0
|
||||
#%define _rhver %(eval rpm -q --queryformat '%{VERSION}' $(rpm -qf /etc/redhat-release))
|
||||
#%define _rhrelease %(eval %{__cat} /etc/redhat-release)
|
||||
%define _dbver db4
|
||||
#%define _dbrpmver %(eval "rpm -q %{_dbver}")
|
||||
# Do we need the perl install hack for RedHat > 7.3 ?
|
||||
|
||||
%define _perlhack 1
|
||||
#(eval [ %{_rhver} = "6.2" -o %{_rhver} = "7.0" -o %{_rhver} = "7.1" -o %{_rhver} = "7.2" -o %{_rhver} = "7.3" -o %{_rhver} = "2.1AS" -o %{_rhver} = "2.1ES" ] && echo 0 || echo 1)
|
||||
|
||||
%define _perl_man3dir %(eval "$(perl -V:man3dir)"; echo $man3dir)
|
||||
|
||||
%define _withldap 1
|
||||
#(eval "rpm -q --requires openldap | grep -q ^libsasl2 && echo 1 || echo 0")
|
||||
|
||||
%define _snmpver net
|
||||
#(eval "rpm -q --quiet ucd-snmp && echo ucd || echo net")
|
||||
|
||||
# Disable -debuginfo package generation
|
||||
#define debug_package %{nil}
|
||||
# Do we have filesystem >= 2.3.2 (new pki location) ?
|
||||
|
||||
%define use_etc_pki 1
|
||||
#(eval [ $(rpm -q --queryformat '%{VERSION}' filesystem \| sed -e "s/\\.//g") -ge 232 ] && echo 1 || echo 0 )
|
||||
|
||||
%if %{use_etc_pki}
|
||||
%define certs_dir %{_sysconfdir}/pki/tls/certs
|
||||
%define pki_dir %{_sysconfdir}/pki/%{name}
|
||||
%else
|
||||
%define certs_dir %{_datadir}/ssl/certs
|
||||
%define pki_dir %{_datadir}/ssl/certs
|
||||
%endif
|
||||
|
||||
%define ssl_pem_file %{pki_dir}/%{name}.pem
|
||||
%define ssl_pem_file %{_sysconfdir}/pki/%{name}/%{name}.pem
|
||||
%define uid 76
|
||||
%if %{SASLGROUP}
|
||||
%define gid 76
|
||||
@ -134,7 +109,6 @@ Patch2: http://email.uoa.gr/download/cyrus/cyrus-imapd-2.3.12/cyrus-imapd-2.3.12
|
||||
Patch4: http://servercc.oakton.edu/~jwade/cyrus/cyrus-imapd-2.1.3/cyrus-imapd-2.1.3-flock.patch
|
||||
Patch6: cyrus-imapd-2.1.16-getrlimit.patch
|
||||
Patch7: cyrus-imapd-2.3.7-nobarenewlinescheck.patch
|
||||
Patch9: cyrus-imapd-2.3.1-config_defaults.patch
|
||||
Patch10: cyrus-imapd-acceptinvalidfrom.patch
|
||||
Patch12: cyrus-imapd-2.3.7-notify_sms.patch
|
||||
Patch14: cyrus-imapd-2.3.1-authid_normalize.patch
|
||||
@ -142,7 +116,7 @@ Patch15: cyrus-imapd-2.3.1-make_md5_defaults.patch
|
||||
Patch18: cyrus-imapd-2.3.7-krb4.patch
|
||||
# https://bugzilla.redhat.com/show_bug.cgi?id=461875
|
||||
Patch19: cyrus-imapd-2.3.12p2-current-db.patch
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
|
||||
BuildRoot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
|
||||
BuildRequires: autoconf >= 2.59
|
||||
BuildRequires: cyrus-sasl-devel >= 2.1.15-1, perl-devel, tcp_wrappers
|
||||
BuildRequires: %{_dbver}-devel, openssl-devel, pkgconfig
|
||||
@ -192,7 +166,6 @@ recipients, SIEVE provides server side email filtering.
|
||||
%package devel
|
||||
Group: Development/Libraries
|
||||
Summary: Cyrus IMAP server development files
|
||||
#Requires: %{name} = %{version}-%{release}
|
||||
|
||||
%description devel
|
||||
The %{name}-devel package contains header files and libraries
|
||||
@ -234,7 +207,6 @@ one running the server.
|
||||
%if %{NO_BARE_NL}
|
||||
%patch7 -p1 -b .nobarenewlinescheck
|
||||
%endif
|
||||
#%patch9 -p1 -b .config_defaults
|
||||
%patch10 -p1 -b .acceptinvalidfrom
|
||||
%patch12 -p1 -b .notify_sms
|
||||
%patch14 -p1 -b .authid_normalize
|
||||
@ -250,7 +222,6 @@ autoheader
|
||||
autoconf -f
|
||||
|
||||
%build
|
||||
#export RPM_OPT_FLAGS="$RPM_OPT_FLAGS -Werror-implicit-function-declaration"
|
||||
CPPFLAGS="-I%{_includedir}/et"; export CPPFLAGS
|
||||
CFLAGS="$RPM_OPT_FLAGS -fPIC"; export CFLAGS
|
||||
if pkg-config openssl; then
|
||||
@ -355,21 +326,15 @@ find doc -name "*.html.*" -type f | xargs -r %{__rm} -f
|
||||
%{__rm} -rf %{buildroot}
|
||||
|
||||
# This hack is needed on RedHat > 7.3 to install the perl files correctly
|
||||
%if %{_perlhack}
|
||||
pushd perl/imap
|
||||
%{__perl} Makefile.PL PREFIX=%{buildroot}%{_prefix} INSTALLDIRS=vendor
|
||||
popd
|
||||
pushd perl/sieve/managesieve
|
||||
%{__perl} Makefile.PL PREFIX=%{buildroot}%{_prefix} INSTALLDIRS=vendor
|
||||
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}
|
||||
%else
|
||||
%{__make} install DESTDIR=%{buildroot} PREFIX=%{buildroot}%{_prefix} mandir=%{_mandir}
|
||||
%{__make} -C man install DESTDIR=%{buildroot} PREFIX=%{buildroot}%{_prefix} mandir=%{_mandir}
|
||||
%endif
|
||||
%{__make} install DESTDIR=%{buildroot} PREFIX=%{_prefix} mandir=%{_mandir}
|
||||
%{__make} -C man install DESTDIR=%{buildroot} PREFIX=%{_prefix} mandir=%{_mandir}
|
||||
|
||||
%if %{DEL_WRAP}
|
||||
%{__install} -m 2755 deliver-wrapper %{buildroot}%{_cyrexecdir}/
|
||||
@ -393,7 +358,7 @@ done
|
||||
%{buildroot}%{_vardata}/ptclient \
|
||||
%endif
|
||||
%{buildroot}%{_datadir}/%{name}/rpm \
|
||||
%{buildroot}%{pki_dir} \
|
||||
%{buildroot}%{_sysconfdir}/pki/%{name} \
|
||||
%{_contribdir}
|
||||
|
||||
# Install additional files
|
||||
@ -444,13 +409,6 @@ mv %{buildroot}%{_mandir}/man8/pop3d.8 %{buildroot}%{_mandir}/man8/pop3d.8cyrus
|
||||
|
||||
# create the ghost pem file
|
||||
touch %{buildroot}%{ssl_pem_file}
|
||||
%if %{use_etc_pki}
|
||||
# change config file so ssl certificates are under /etc rather than /usr/share
|
||||
%{__perl} -pi -e \
|
||||
's@/usr/share/ssl/certs/%{name}.pem@%{ssl_pem_file}@g; \
|
||||
s@/usr/share/ssl/certs/ca-bundle.crt@/etc/pki/tls/certs/ca-bundle.crt@' \
|
||||
%{buildroot}%{_sysconfdir}/imapd.conf
|
||||
%endif
|
||||
|
||||
# Rename 'master' binary and manpage to avoid clash with postfix
|
||||
%{__mv} -f %{buildroot}%{_cyrexecdir}/master %{buildroot}%{_cyrexecdir}/cyrus-master
|
||||
@ -492,9 +450,6 @@ find %{buildroot} -name ".packlist" -exec %{__rm} -f {} \;
|
||||
%{__rm} -f %{buildroot}%{_mandir}/man8/syncnews.8*
|
||||
%{__rm} -f doc/man/syncnews.8.html
|
||||
|
||||
# On RedHat 7.3, this file is created here
|
||||
%{__rm} -f /perllocal.pod
|
||||
|
||||
%clean
|
||||
%{__rm} -rf %{buildroot}
|
||||
|
||||
@ -520,11 +475,6 @@ do
|
||||
fi
|
||||
done
|
||||
|
||||
# "ctl_deliver -E" is deprecated, now is "cyr_expire -E"
|
||||
if grep -q "ctl_deliver *-E" %{_sysconfdir}/cyrus.conf ; then
|
||||
%{__perl} -pi -e "s/ctl_deliver *-E/cyr_expire -E/" %{_sysconfdir}/cyrus.conf
|
||||
fi
|
||||
|
||||
# prevent idled related errors to show up
|
||||
%if %{IDLED}
|
||||
if grep -q "^# idled" %{_sysconfdir}/cyrus.conf ; then
|
||||
@ -536,24 +486,11 @@ fi
|
||||
fi
|
||||
%endif
|
||||
|
||||
%if %{use_etc_pki}
|
||||
# change existing config so ssl certificates are under /etc rather than /usr/share
|
||||
%{__perl} -pi -e \
|
||||
's@/usr/share/ssl/certs/%{name}.pem@%{ssl_pem_file}@g; \
|
||||
s@/usr/share/ssl/certs/ca-bundle.crt@/etc/pki/tls/certs/ca-bundle.crt@' \
|
||||
%{_sysconfdir}/imapd.conf
|
||||
%endif
|
||||
|
||||
# Create SSL certificates
|
||||
exec > /dev/null 2> /dev/null
|
||||
%if %{use_etc_pki}
|
||||
# if the certificate is only in the old location, move it to the new location
|
||||
if [ -f %{_datadir}/ssl/certs/%{name}.pem -a ! -f %{ssl_pem_file} ]; then
|
||||
mv %{_datadir}/ssl/certs/%{name}.pem %{ssl_pem_file}
|
||||
fi
|
||||
%endif
|
||||
|
||||
if [ ! -f %{ssl_pem_file} ]; then
|
||||
pushd %{certs_dir}
|
||||
pushd %{_sysconfdir}/pki/tls/certs
|
||||
umask 077
|
||||
%{__cat} << EOF | make %{name}.pem
|
||||
--
|
||||
@ -566,9 +503,7 @@ root@localhost.localdomain
|
||||
EOF
|
||||
%{__chown} root.%{_cyrusgroup} %{name}.pem
|
||||
%{__chmod} 640 %{name}.pem
|
||||
%if %{use_etc_pki}
|
||||
mv %{name}.pem %{ssl_pem_file}
|
||||
%endif
|
||||
popd
|
||||
fi
|
||||
|
||||
@ -644,7 +579,7 @@ if [ $1 = 0 ]; then
|
||||
fi
|
||||
|
||||
%files
|
||||
%defattr(0644,root,root,0755)
|
||||
%defattr(-,root,root,-)
|
||||
%config(noreplace) %{_sysconfdir}/cyrus.conf
|
||||
%config(noreplace) %{_sysconfdir}/imapd.conf
|
||||
%attr(0755,root,root) %{_sysconfdir}/rc.d/init.d/%{name}
|
||||
@ -659,69 +594,69 @@ fi
|
||||
%config(noreplace) %{_sysconfdir}/pam.d/nntp
|
||||
%attr(0755,root,root) %{_sysconfdir}/cron.daily/%{name}
|
||||
%dir %{_cyrexecdir}
|
||||
%attr(0755,root,root) %{_cyrexecdir}/arbitron
|
||||
%attr(0755,root,root) %{_cyrexecdir}/arbitronsort.pl
|
||||
%attr(0755,root,root) %{_cyrexecdir}/chk_cyrus
|
||||
%attr(0755,root,root) %{_cyrexecdir}/convert-sieve.pl
|
||||
%attr(0755,root,root) %{_cyrexecdir}/ctl_cyrusdb
|
||||
%attr(0755,root,root) %{_cyrexecdir}/ctl_deliver
|
||||
%attr(0755,root,root) %{_cyrexecdir}/ctl_mboxlist
|
||||
%attr(0755,root,root) %{_cyrexecdir}/cvt_cyrusdb
|
||||
%attr(0755,root,root) %{_cyrexecdir}/cyr_dbtool
|
||||
%attr(0755,root,root) %{_cyrexecdir}/cyr_expire
|
||||
%attr(0755,root,root) %{_cyrexecdir}/cyr_synclog
|
||||
%attr(0755,root,root) %{_cyrexecdir}/cyrdump
|
||||
%attr(0755,root,root) %{_cyrexecdir}/cyrus-master
|
||||
%attr(0755,root,root) %{_cyrexecdir}/deliver
|
||||
%attr(0755,root,root) %{_cyrexecdir}/dohash
|
||||
%attr(0755,root,root) %{_cyrexecdir}/fud
|
||||
%attr(0755,root,root) %{_cyrexecdir}/imapd
|
||||
%attr(0755,root,root) %{_cyrexecdir}/ipurge
|
||||
%attr(0755,root,root) %{_cyrexecdir}/lmtpd
|
||||
%attr(0755,root,root) %{_cyrexecdir}/lmtpproxyd
|
||||
%attr(0755,root,root) %{_cyrexecdir}/make_sha1
|
||||
%attr(0755,root,root) %{_cyrexecdir}/masssievec
|
||||
%attr(0755,root,root) %{_cyrexecdir}/mbexamine
|
||||
%attr(0755,root,root) %{_cyrexecdir}/mbpath
|
||||
%attr(0755,root,root) %{_cyrexecdir}/migrate-metadata
|
||||
%attr(0755,root,root) %{_cyrexecdir}/mkimap
|
||||
%attr(0755,root,root) %{_cyrexecdir}/mknewsgroups
|
||||
%attr(0755,root,root) %{_cyrexecdir}/notifyd
|
||||
%attr(0755,root,root) %{_cyrexecdir}/pop3d
|
||||
%attr(0755,root,root) %{_cyrexecdir}/quota
|
||||
%attr(0755,root,root) %{_cyrexecdir}/reconstruct
|
||||
%attr(0755,root,root) %{_cyrexecdir}/rehash
|
||||
%attr(0755,root,root) %{_cyrexecdir}/sievec
|
||||
%attr(0755,root,root) %{_cyrexecdir}/sieved
|
||||
%attr(0755,root,root) %{_cyrexecdir}/smmapd
|
||||
%attr(0755,root,root) %{_cyrexecdir}/squatter
|
||||
%attr(0755,root,root) %{_cyrexecdir}/timsieved
|
||||
%attr(0755,root,root) %{_cyrexecdir}/tls_prune
|
||||
%attr(0755,root,root) %{_cyrexecdir}/translatesieve
|
||||
%attr(0755,root,root) %{_cyrexecdir}/undohash
|
||||
%attr(0755,root,root) %{_cyrexecdir}/unexpunge
|
||||
%attr(0755,root,root) %{_cyrexecdir}/upgradesieve
|
||||
%attr(0755,root,root) %{_cyrexecdir}/cvt_cyrusdb_all
|
||||
%attr(0755,root,root) %{_cyrexecdir}/rpm_set_permissions
|
||||
%{_cyrexecdir}/arbitron
|
||||
%{_cyrexecdir}/arbitronsort.pl
|
||||
%{_cyrexecdir}/chk_cyrus
|
||||
%{_cyrexecdir}/convert-sieve.pl
|
||||
%{_cyrexecdir}/ctl_cyrusdb
|
||||
%{_cyrexecdir}/ctl_deliver
|
||||
%{_cyrexecdir}/ctl_mboxlist
|
||||
%{_cyrexecdir}/cvt_cyrusdb
|
||||
%{_cyrexecdir}/cyr_dbtool
|
||||
%{_cyrexecdir}/cyr_expire
|
||||
%{_cyrexecdir}/cyr_synclog
|
||||
%{_cyrexecdir}/cyrdump
|
||||
%{_cyrexecdir}/cyrus-master
|
||||
%{_cyrexecdir}/deliver
|
||||
%{_cyrexecdir}/dohash
|
||||
%{_cyrexecdir}/fud
|
||||
%{_cyrexecdir}/imapd
|
||||
%{_cyrexecdir}/ipurge
|
||||
%{_cyrexecdir}/lmtpd
|
||||
%{_cyrexecdir}/lmtpproxyd
|
||||
%{_cyrexecdir}/make_sha1
|
||||
%{_cyrexecdir}/masssievec
|
||||
%{_cyrexecdir}/mbexamine
|
||||
%{_cyrexecdir}/mbpath
|
||||
%{_cyrexecdir}/migrate-metadata
|
||||
%{_cyrexecdir}/mkimap
|
||||
%{_cyrexecdir}/mknewsgroups
|
||||
%{_cyrexecdir}/notifyd
|
||||
%{_cyrexecdir}/pop3d
|
||||
%{_cyrexecdir}/quota
|
||||
%{_cyrexecdir}/reconstruct
|
||||
%{_cyrexecdir}/rehash
|
||||
%{_cyrexecdir}/sievec
|
||||
%{_cyrexecdir}/sieved
|
||||
%{_cyrexecdir}/smmapd
|
||||
%{_cyrexecdir}/squatter
|
||||
%{_cyrexecdir}/timsieved
|
||||
%{_cyrexecdir}/tls_prune
|
||||
%{_cyrexecdir}/translatesieve
|
||||
%{_cyrexecdir}/undohash
|
||||
%{_cyrexecdir}/unexpunge
|
||||
%{_cyrexecdir}/upgradesieve
|
||||
%{_cyrexecdir}/cvt_cyrusdb_all
|
||||
%{_cyrexecdir}/rpm_set_permissions
|
||||
%if %{IDLED}
|
||||
%attr(0755,root,root) %{_cyrexecdir}/idled
|
||||
%{_cyrexecdir}/idled
|
||||
%endif
|
||||
%if %{AUTOCREATE}
|
||||
%attr(0755,root,root) %{_cyrexecdir}/compile_sieve
|
||||
%{_cyrexecdir}/compile_sieve
|
||||
%endif
|
||||
%attr(0755,root,root) %{_cyrexecdir}/mupdate
|
||||
%attr(0755,root,root) %{_cyrexecdir}/mupdate-loadgen.pl
|
||||
%attr(0755,root,root) %{_cyrexecdir}/proxyd
|
||||
%attr(0755,root,root) %{_cyrexecdir}/make_md5
|
||||
%attr(0755,root,root) %{_cyrexecdir}/sync_client
|
||||
%attr(0755,root,root) %{_cyrexecdir}/sync_reset
|
||||
%attr(0755,root,root) %{_cyrexecdir}/sync_server
|
||||
%attr(0755,root,root) %{_cyrexecdir}/cyrfetchnews
|
||||
%attr(0755,root,root) %{_cyrexecdir}/nntpd
|
||||
%{_cyrexecdir}/mupdate
|
||||
%{_cyrexecdir}/mupdate-loadgen.pl
|
||||
%{_cyrexecdir}/proxyd
|
||||
%{_cyrexecdir}/make_md5
|
||||
%{_cyrexecdir}/sync_client
|
||||
%{_cyrexecdir}/sync_reset
|
||||
%{_cyrexecdir}/sync_server
|
||||
%{_cyrexecdir}/cyrfetchnews
|
||||
%{_cyrexecdir}/nntpd
|
||||
%if %{_withldap}
|
||||
%attr(0755,root,root) %{_cyrexecdir}/ptdump
|
||||
%attr(0755,root,root) %{_cyrexecdir}/ptexpire
|
||||
%attr(0755,root,root) %{_cyrexecdir}/ptloader
|
||||
%{_cyrexecdir}/ptdump
|
||||
%{_cyrexecdir}/ptexpire
|
||||
%{_cyrexecdir}/ptloader
|
||||
%endif
|
||||
%if %{DEL_WRAP}
|
||||
%attr(2755,%{_cyrususer},%{_cyrusgroup}) %{_cyrexecdir}/deliver-wrapper
|
||||
@ -751,9 +686,7 @@ fi
|
||||
%{_mandir}/man8/*
|
||||
%doc COPYRIGHT README
|
||||
%doc doc/*
|
||||
%if %{use_etc_pki}
|
||||
%dir %{pki_dir}
|
||||
%endif
|
||||
%dir %{_sysconfdir}/pki/%{name}
|
||||
%attr(0640,root,%{_cyrusgroup}) %ghost %config(missingok,noreplace) %verify(not md5 size mtime) %{ssl_pem_file}
|
||||
|
||||
%files devel
|
||||
|
Loading…
Reference in New Issue
Block a user