From 5c8fcae72125ae46ab02d20b9139ce1e20aca8e9 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Elan=20Ruusam=C3=A4e?= Date: Wed, 16 Jan 2013 21:45:01 +0200 Subject: [PATCH] as fileinfo extension embeds magic database, rebuild it during build --- file-magic.patch | 11 +++++++++++ php.spec | 7 +++++++ 2 files changed, 18 insertions(+) create mode 100644 file-magic.patch diff --git a/file-magic.patch b/file-magic.patch new file mode 100644 index 0000000..3320726 --- /dev/null +++ b/file-magic.patch @@ -0,0 +1,11 @@ +somewhy php devs have embedded magic database into php extension. yuck! + +rebuild data file for now +--- php-5.3.20/ext/fileinfo/Makefile.frag 2012-12-19 08:55:19.000000000 +0200 ++++ php-5.3.20/ext/fileinfo/Makefile.frag 2013-01-16 11:11:51.444547648 +0200 +@@ -1,2 +1,5 @@ + + $(builddir)/libmagic/apprentice.lo: $(srcdir)/data_file.c ++MIME_MAGIC_DB ?= /usr/share/misc/magic.mgc ++$(srcdir)/data_file.c: $(MIME_MAGIC_DB) $(SAPI_CLI_PATH) ++ $(SAPI_CLI_PATH) $(srcdir)/create_data_file.php $< > $@ diff --git a/php.spec b/php.spec index 03a1c55..e0be840 100644 --- a/php.spec +++ b/php.spec @@ -202,6 +202,7 @@ Patch64: %{orgname}-m4.patch Patch65: system-libzip.patch Patch66: %{orgname}-db.patch Patch67: php-litespeed.patch +Patch68: file-magic.patch URL: http://www.php.net/ %{?with_interbase:%{!?with_interbase_inst:BuildRequires: Firebird-devel >= 1.0.2.908-2}} %{?with_pspell:BuildRequires: aspell-devel >= 2:0.50.0} @@ -215,6 +216,7 @@ BuildRequires: db-devel >= 4.0 BuildRequires: elfutils-devel %{?with_enchant:BuildRequires: enchant-devel >= 1.1.3} #BuildRequires: fcgi-devel +BuildRequires: file %{?with_kerberos5:BuildRequires: heimdal-devel} %{?with_system_libzip:BuildRequires: libzip-devel >= 0.10-3} BuildRequires: mysql-devel @@ -1958,9 +1960,14 @@ cp -p php.ini-production php.ini %{__rm} -r sapi/litespeed gzip -dc %{SOURCE15} | tar xf - -C sapi/ %patch67 -p1 +%patch68 -p1 sed -i -e '/PHP_ADD_LIBRARY_WITH_PATH/s#xmlrpc,#xmlrpc-epi,#' ext/xmlrpc/config.m4 +# somewhy php devs have embedded magic database into php extension. yuck! +# rebuild data file for now +mv ext/fileinfo/data_file.c{,.php-src} + # cleanup backups after patching find '(' -name '*~' -o -name '*.orig' ')' -print0 | xargs -0 -r -l512 rm -f -- 2.44.0