summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRemi Collet <fedora@famillecollet.com>2013-01-12 16:02:49 +0100
committerRemi Collet <fedora@famillecollet.com>2013-01-12 16:02:49 +0100
commita6449732dce6c3c9fb2aaad5547d4a4fc37b8f6a (patch)
treeb83b766052afcd4436f36dad1f2c9894d809fc0c
parent932861a2c8b5a927e8aec93e98d75e3c429afa54 (diff)
php-horde-imp: ready
-rw-r--r--Makefile4
-rw-r--r--php-horde-imp.spec89
2 files changed, 76 insertions, 17 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..13af741
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,4 @@
+SRCDIR := $(shell pwd)
+NAME := $(shell basename $(SRCDIR))
+include ../../../common/Makefile
+
diff --git a/php-horde-imp.spec b/php-horde-imp.spec
index c9c7374..3b9718f 100644
--- a/php-horde-imp.spec
+++ b/php-horde-imp.spec
@@ -20,6 +20,10 @@ BuildRequires: php-common >= 5.3.0
BuildRequires: php-pear(PEAR) >= 1.7.0
BuildRequires: php-channel(%{pear_channel})
BuildRequires: php-pear(%{pear_channel}/Horde_Role) >= 1.0.0
+# To run unit tests
+BuildRequires: php-pear(%{pear_channel}/Horde_Test) >= 2.1.0
+BuildRequires: php-pear(%{pear_channel}/Horde_Core) >= 2.0.0
+BuildRequires: php-pear(%{pear_channel}/Horde_Itip) >= 2.0.0
Requires(post): %{__pear}
Requires(postun): %{__pear}
@@ -111,7 +115,9 @@ Conflicts: php-pear(%{pear_channel}/Horde_Text_Filter_Csstidy) >= 3.0.0
Requires: php-pear(%{pear_channel}/Horde_Vfs) >= 2.0.0
Conflicts: php-pear(%{pear_channel}/Horde_Vfs) >= 3.0.0
-Provides: php-pear(%{pear_channel}/imp) = %{version}
+Provides: php-pear(%{pear_channel}/%{pear_name}) = %{version}
+Obsoletes: imp < 5
+Provides: imp = %{version}
%description
@@ -124,32 +130,72 @@ normally found only in desktop email clients.
%prep
%setup -q -c
-[ -f package2.xml ] || mv package.xml package2.xml
-mv package2.xml %{pear_name}-%{version}/%{name}.xml
+
+cat <<EOF | tee httpd.conf
+<DirectoryMatch %{pear_hordedir}/%{pear_name}/(config|lib|locale)>
+ Deny from all
+</DirectoryMatch>
+EOF
+
cd %{pear_name}-%{version}
+# Don't install .po and .pot files
+# Remove checksum for .mo, as we regenerate them
+sed -e '/%{pear_name}.po/d' \
+ -e '/htaccess/d' \
+ -e '/%{pear_name}.mo/s/md5sum=.*name=/name=/' \
+ ../package.xml >%{name}.xml
%build
cd %{pear_name}-%{version}
-# Empty build section, most likely nothing required.
+
+# Regenerate the locales
+for po in $(find locale -name \*.po)
+do
+ msgfmt $po -o $(dirname $po)/$(basename $po .po).mo
+done
%install
cd %{pear_name}-%{version}
-rm -rf $RPM_BUILD_ROOT
-%{__pear} install --nodeps --packagingroot $RPM_BUILD_ROOT %{name}.xml
+rm -rf %{buildroot}
+%{__pear} install --nodeps --packagingroot %{buildroot} %{name}.xml
# Clean up unnecessary files
-rm -rf $RPM_BUILD_ROOT%{pear_metadir}/.??*
+rm -rf %{buildroot}%{pear_metadir}/.??*
# Install XML package description
-mkdir -p $RPM_BUILD_ROOT%{pear_xmldir}
-install -pm 644 %{name}.xml $RPM_BUILD_ROOT%{pear_xmldir}
+mkdir -p %{buildroot}%{pear_xmldir}
+install -pm 644 %{name}.xml %{buildroot}%{pear_xmldir}
+
+# Install Apache configuration
+install -Dpm 0644 ../httpd.conf %{buildroot}%{_sysconfdir}/httpd/conf.d/%{name}.conf
+
+# Move configuration to /etc
+mkdir -p %{buildroot}%{_sysconfdir}/horde
+mv %{buildroot}%{pear_hordedir}/%{pear_name}/config \
+ %{buildroot}%{_sysconfdir}/horde/%{pear_name}
+ln -s %{_sysconfdir}/horde/%{pear_name} %{buildroot}%{pear_hordedir}/%{pear_name}/config
+
+# Locales
+for loc in locale/?? locale/??_??
+do
+ lang=$(basename $loc)
+ echo "%%lang(${lang%_*}) %{pear_hordedir}/%{pear_name}/$loc"
+done | tee ../%{pear_name}.lang
+
+
+%check
+cd %{pear_name}-%{version}/test/Imp
+phpunit\
+ -d include_path=%{buildroot}%{pear_phpdir}:.:%{pear_phpdir} \
+ -d date.timezone=UTC \
+ .
%clean
-rm -rf $RPM_BUILD_ROOT
+rm -rf %{buildroot}
%post
@@ -163,20 +209,29 @@ if [ $1 -eq 0 ] ; then
fi
-%files
+%files -f %{pear_name}.lang
%defattr(-,root,root,-)
%doc %{pear_docdir}/%{pear_name}
-
-
%{pear_xmldir}/%{name}.xml
-# Expand this as needed to avoid owning dirs owned by our dependencies
-# and to avoid unowned dirs
-
-
+%config(noreplace) %{_sysconfdir}/httpd/conf.d/%{name}.conf
+%attr(0770,apache,apache) %dir %{_sysconfdir}/horde/%{pear_name}
+%attr(0640,apache,apache) %config %{_sysconfdir}/horde/%{pear_name}/*.dist
+%attr(0660,apache,apache) %config(noreplace) %{_sysconfdir}/horde/%{pear_name}/*.php
+%attr(0660,apache,apache) %config %{_sysconfdir}/horde/%{pear_name}/*.xml
%{pear_testdir}/imp
%{_bindir}/imp-bounce-spam
%{_bindir}/imp-mailbox-decode
%{_bindir}/imp-query-imap-cache
+%dir %{pear_hordedir}/%{pear_name}
+%dir %{pear_hordedir}/%{pear_name}/locale
+%{pear_hordedir}/%{pear_name}/*.php
+%{pear_hordedir}/%{pear_name}/config
+%{pear_hordedir}/%{pear_name}/js
+%{pear_hordedir}/%{pear_name}/lib
+%{pear_hordedir}/%{pear_name}/migration
+%{pear_hordedir}/%{pear_name}/templates
+%{pear_hordedir}/%{pear_name}/themes
+
%changelog
* Sat Jan 12 2013 Remi Collet <RPMS@FamilleCollet.com> - 6.0.3-1