[packages/php-dompdf] install config to /etc
glen
glen at pld-linux.org
Tue Mar 31 16:02:59 CEST 2015
commit 5372d32ac2f344aed0438aa7afffa409f6063188
Author: Elan Ruusamäe <glen at delfi.ee>
Date: Tue Mar 31 17:02:18 2015 +0300
install config to /etc
config.patch | 26 ++++++++++++++++++++++++++
php-dompdf.spec | 9 ++++++++-
2 files changed, 34 insertions(+), 1 deletion(-)
---
diff --git a/php-dompdf.spec b/php-dompdf.spec
index e3039ab..436375c 100644
--- a/php-dompdf.spec
+++ b/php-dompdf.spec
@@ -12,6 +12,7 @@ License: LGPL v2.1
Group: Development/Languages/PHP
Source0: https://github.com/dompdf/dompdf/releases/download/v%{version}/dompdf-%{version}.zip
# Source0-md5: 7ac81b1a96d4311cd47d756b48d01de4
+Patch0: config.patch
URL: http://dompdf.github.io/
BuildRequires: /usr/bin/php
BuildRequires: rpm-php-pearprov >= 4.4.2-11
@@ -39,6 +40,7 @@ BuildRoot: %{tmpdir}/%{name}-%{version}-root-%(id -u -n)
%define _noautoreq %{?_noautophp} %{?_noautopear}
%define _appdir %{php_data_dir}/%{pkgname}
+%define _sysconfdir /etc/%{pkgname}
%description
dompdf is an HTML to PDF converter. At its heart, dompdf is (mostly)
@@ -50,11 +52,14 @@ HTML elements. It also supports most presentational HTML attributes.
%prep
%setup -qc
mv %{pkgname}/* .
+%patch0 -p1
%install
rm -rf $RPM_BUILD_ROOT
-install -d $RPM_BUILD_ROOT%{_appdir}
+install -d $RPM_BUILD_ROOT{%{_appdir},%{_sysconfdir}}
cp -a dompdf.php load_font.php include lib $RPM_BUILD_ROOT%{_appdir}
+cp -p dompdf_config.inc.php $RPM_BUILD_ROOT%{_sysconfdir}
+ln -s %{_sysconfdir}/dompdf_config.inc.php $RPM_BUILD_ROOT%{_appdir}
install -d $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
cp -a www/* $RPM_BUILD_ROOT%{_examplesdir}/%{name}-%{version}
@@ -65,5 +70,7 @@ rm -rf $RPM_BUILD_ROOT
%files
%defattr(644,root,root,755)
%doc README.md CONTRIBUTING.md
+%dir %attr(750,root,http) %{_sysconfdir}
+%attr(640,root,http) %config(noreplace) %verify(not md5 mtime size) %{_sysconfdir}/dompdf_config.inc.php
%{_appdir}
%{_examplesdir}/%{name}-%{version}
diff --git a/config.patch b/config.patch
new file mode 100644
index 0000000..d2c8657
--- /dev/null
+++ b/config.patch
@@ -0,0 +1,26 @@
+From: =?utf-8?q?David_Pr=C3=A9vot?= <taffit at debian.org>
+Date: Wed, 16 Oct 2013 15:47:22 -0400
+Subject: Adapt main path
+MIME-Version: 1.0
+Content-Type: text/plain; charset="utf-8"
+Content-Transfer-Encoding: 8bit
+
+Don’t try to guess the actual path from the configuration file moved in
+/etc for the Debian package.
+---
+ dompdf_config.inc.php | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/dompdf_config.inc.php b/dompdf_config.inc.php
+index 51fbcb5..a6593ee 100644
+--- a/dompdf_config.inc.php
++++ b/dompdf_config.inc.php
+@@ -16,7 +16,7 @@ PHP_VERSION >= 5.0 or die("DOMPDF requires PHP 5.0+");
+ /**
+ * The root of your DOMPDF installation
+ */
+-define("DOMPDF_DIR", str_replace(DIRECTORY_SEPARATOR, '/', realpath(dirname(__FILE__))));
++define("DOMPDF_DIR", "/usr/share/php/dompdf");
+
+ /**
+ * The location of the DOMPDF include directory
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/packages/php-dompdf.git/commitdiff/5372d32ac2f344aed0438aa7afffa409f6063188
More information about the pld-cvs-commit
mailing list