Replace PHP4 -> PHP since we also support upcoming PHP versions
[squirrelmail.git] / contrib / RPM / squirrelmail.spec
1 ##
2 # $Id$
3 %define spec_release 1
4
5 ##
6 # Rebuild with:
7 # rpmbuild --rebuild --define 'rhl7 1' squirrelmail-1.4.x.src.rpm
8 # to build for rhl7.
9
10 %{!?rhl7:%define rhl7 0}
11 %if %{rhl7}
12 %define webserver apache
13 %define rpm_release %{spec_release}.7.x
14 %else
15 %define webserver httpd
16 %define rpm_release %{spec_release}
17 %endif
18
19 Summary: SquirrelMail webmail client
20 Name: squirrelmail
21 Version: 1.4.0
22 Release: %{rpm_release}
23 License: GPL
24 URL: http://www.squirrelmail.org/
25 Vendor: squirrelmail.org
26 Group: Applications/Internet
27 Source: %{name}-%{version}.tar.bz2
28 BuildRoot: %{_tmppath}/%{name}-%{version}-root
29 BuildArch: noarch
30 Requires: %{webserver}, php >= 4.1.0, perl, tmpwatch >= 2.8, aspell
31 Requires: /usr/sbin/sendmail
32 Prereq: %{webserver}, perl
33 BuildPrereq: perl
34
35 %description
36 SquirrelMail is a standards-based webmail package written in PHP. It
37 includes built-in pure PHP support for the IMAP and SMTP protocols, and
38 all pages render in pure HTML 4.0 (with no Javascript) for maximum
39 compatibility across browsers. It has very few requirements and is very
40 easy to configure and install. SquirrelMail has all the functionality
41 you would want from an email client, including strong MIME support,
42 address books, and folder manipulation.
43
44 %prep
45 %setup -q
46 %{__rm} -f plugins/make_archive.pl
47
48 # Rearrange the documentation
49 %{__mv} AUTHORS ChangeLog COPYING INSTALL README UPGRADE doc/
50 %{__mv} ReleaseNotes doc/ReleaseNotes.txt
51 %{__mv} themes/README.themes doc/
52 for f in `find plugins -name "README*" -or -name INSTALL \
53 -or -name CHANGES -or -name HISTORY`; do
54 %{__mkdir_p} doc/`dirname $f`
55 %{__mv} $f $_
56 done
57 %{__mv} doc/plugins/squirrelspell/doc/README doc/plugins/squirrelspell
58 %{__rm} -rf doc/plugins/squirrelspell/doc
59 %{__mv} plugins/squirrelspell/doc/* doc/plugins/squirrelspell
60 %{__rm} -f doc/plugins/squirrelspell/index.php
61 %{__rm} -rf plugins/squirrelspell/doc
62
63 # Fixup various files
64 echo "left_refresh=300" >> data/default_pref
65 for f in contrib/RPM/squirrelmail.cron contrib/RPM/config.php.redhat; do
66 %{__perl} -pi \
67 -e "s|__ATTDIR__|%{_localstatedir}/spool/squirrelmail/attach/|g;" \
68 -e "s|__PREFSDIR__|%{_localstatedir}/lib/squirrelmail/prefs/|g;" $f
69 done
70
71 # Fix the version
72 %{__perl} -pi -e "s|^(\s*\\\$version\s*=\s*).*|\1'%{version}-%{release}';|g"\
73 functions/strings.php
74
75 %install
76 rm -rf %{buildroot}
77 %{__mkdir_p} -m 755 %{buildroot}%{_sysconfdir}/squirrelmail
78 %{__mkdir_p} -m 755 %{buildroot}%{_localstatedir}/lib/squirrelmail/prefs
79 %{__mkdir_p} -m 755 %{buildroot}%{_localstatedir}/spool/squirrelmail/attach
80 %{__mkdir_p} -m 755 %{buildroot}%{_datadir}/squirrelmail
81
82 # install default_pref
83 %{__install} -m 644 data/default_pref \
84 %{buildroot}%{_localstatedir}/lib/squirrelmail/prefs/
85
86 # install the config files
87 %{__mkdir_p} -m 755 %{buildroot}%{_datadir}/squirrelmail/config
88 %{__install} -m 644 contrib/RPM/config.php.redhat \
89 %{buildroot}%{_sysconfdir}/squirrelmail/config.php
90 %{__ln_s} %{_sysconfdir}/squirrelmail/config.php \
91 %{buildroot}%{_datadir}/squirrelmail/config/config.php
92 %{__install} -m 644 config/config_local.php \
93 %{buildroot}%{_sysconfdir}/squirrelmail/config_local.php
94 %{__ln_s} %{_sysconfdir}/squirrelmail/config_local.php \
95 %{buildroot}%{_datadir}/squirrelmail/config/config_local.php
96 %{__rm} -f config/config_local.php config/config.php
97 %{__install} -m 644 config/*.php %{buildroot}%{_datadir}/squirrelmail/config/
98 %{__install} -m 755 config/*.pl %{buildroot}%{_datadir}/squirrelmail/config/
99
100 # install index.php
101 %{__install} -m 644 index.php %{buildroot}%{_datadir}/squirrelmail/
102
103 # Copy over the rest
104 for DIR in class functions help images include locale plugins src themes; do
105 %{__cp} -rp $DIR %{buildroot}%{_datadir}/squirrelmail/
106 done
107
108 # install the cron script
109 %{__mkdir_p} -m 755 %{buildroot}%{_sysconfdir}/cron.daily
110 %{__install} -m 755 contrib/RPM/squirrelmail.cron \
111 %{buildroot}/%{_sysconfdir}/cron.daily/
112
113 %if %{rhl7}
114 # symlink from /var/www/html/webmail to /usr/share/squirrelmail
115 %{__mkdir_p} -m 755 %{buildroot}/var/www/html
116 %{__ln_s} %{_datadir}/squirrelmail %{buildroot}/var/www/html/webmail
117 %else
118 # install the config file
119 %{__mkdir_p} %{buildroot}%{_sysconfdir}/httpd/conf.d
120 %{__install} -m 644 contrib/RPM/squirrelmail.conf \
121 %{buildroot}%{_sysconfdir}/httpd/conf.d/
122 %endif
123
124 %clean
125 %{__rm} -rf %{buildroot}
126
127 %files
128 %defattr(-,root,root)
129 %config %dir %{_sysconfdir}/squirrelmail
130 %config(noreplace) %{_sysconfdir}/squirrelmail/*
131 %if %{rhl7}
132 /var/www/html/webmail
133 %else
134 %config(noreplace) %{_sysconfdir}/httpd/conf.d/*.conf
135 %endif
136 %doc doc/*
137 %dir %{_datadir}/squirrelmail
138 %{_datadir}/squirrelmail/index.php
139 %{_datadir}/squirrelmail/class
140 %{_datadir}/squirrelmail/functions
141 %{_datadir}/squirrelmail/help
142 %{_datadir}/squirrelmail/images
143 %{_datadir}/squirrelmail/include
144 %{_datadir}/squirrelmail/locale
145 %{_datadir}/squirrelmail/src
146 %{_datadir}/squirrelmail/themes
147 %{_datadir}/squirrelmail/config
148 %dir %{_datadir}/squirrelmail/plugins
149 %{_datadir}/squirrelmail/plugins/*
150 %dir %{_localstatedir}/lib/squirrelmail
151 %dir %{_localstatedir}/spool/squirrelmail
152 %attr(0770, root, apache) %dir %{_localstatedir}/lib/squirrelmail/prefs
153 %attr(0730, root, apache) %dir %{_localstatedir}/spool/squirrelmail/attach
154 %{_localstatedir}/lib/squirrelmail/prefs/default_pref
155 %{_sysconfdir}/cron.daily/squirrelmail.cron
156
157 %changelog
158 * Tue Mar 26 2003 Konstantin Riabitsev <icon@duke.edu> 1.4.0-1
159 - Build for 1.4.0
160
161 * Thu Feb 13 2003 Konstantin Riabitsev <icon@duke.edu> 1.4.0-0.2pre
162 - Initial release for 1.4.0 prerelease
163
164 * Tue Feb 04 2003 Konstantin Riabitsev <icon@duke.edu> 1.2.11-1
165 - Upping version number.
166
167 * Tue Oct 29 2002 Konstantin Riabitsev <icon@duke.edu> 1.2.9-1
168 - Upping version number.
169
170 * Sat Sep 14 2002 Konstantin Riabitsev <icon@duke.edu> 1.2.8-1
171 - adopted RH's spec file so we don't duplicate effort.
172 - Removed rh'ized splash screen.
173 - Adding fallbacks for building rhl7 version as well with the same
174 specfile. Makes the spec file not as clean, but hey.
175 - remove workarounds for #68669 (rh bugzilla), since 1.2.8 works with
176 register_globals = Off.
177 - Hardwiring localhost into the default config file. Makes sense.
178 - No more such file MIRRORS.
179 - Adding aspell as one of the req's, since squirrelspell is enabled by
180 default
181 - Added Vendor: line to distinguish ourselves from RH.
182 - Doing the uglies with the release numbers.
183
184 * Tue Aug 6 2002 Preston Brown <pbrown@redhat.com> 1.2.7-4
185 - replacement splash screen.
186
187 * Mon Jul 22 2002 Gary Benson <gbenson@redhat.com> 1.2.7-3
188 - get rid of long lines in the specfile.
189 - remove symlink in docroot and use an alias in conf.d instead.
190 - work with register_globals off (#68669)
191
192 * Tue Jul 09 2002 Gary Benson <gbenson@redhat.com> 1.2.7-2
193 - hardwire the hostname (well, localhost) into the config file (#67635)
194
195 * Mon Jun 24 2002 Gary Benson <gbenson@redhat.com> 1.2.7-1
196 - hardwire the locations into the config file and cron file.
197 - install squirrelmail-cleanup.cron as squirrelmail.cron.
198 - make symlinks relative.
199 - upgrade to 1.2.7.
200 - more dependency fixes.
201
202 * Fri Jun 21 2002 Gary Benson <gbenson@redhat.com>
203 - summarize the summary, fix deps, and remove some redundant stuff.
204 - tidy up the prep section.
205 - replace directory definitions with standard RHL ones.
206
207 * Fri Jun 21 2002 Tim Powers <timp@redhat.com> 1.2.6-3
208 - automated rebuild
209
210 * Wed Jun 19 2002 Preston Brown <pbrown@redhat.com> 1.2.6-2
211 - adopted Konstantin Riabitsev <icon@duke.edu>'s package for Red Hat
212 Linux. Nice job Konstantin!