From 1e4047bc5a5a687e5e37427b113d66d2565b410f Mon Sep 17 00:00:00 2001 From: perry.werneck@gmail.com Date: Fri, 11 Apr 2014 19:02:13 +0000 Subject: [PATCH] Ajustando empacotamento do módulo PHP --- Makefile.in | 11 +++++++++++ configure.ac | 1 + po/pt_BR.po | 2 +- pw3270.spec.in | 37 +++++++++++++++++++++++++++++++++++-- 4 files changed, 48 insertions(+), 3 deletions(-) diff --git a/Makefile.in b/Makefile.in index d2b43d2..d942f1d 100644 --- a/Makefile.in +++ b/Makefile.in @@ -157,6 +157,13 @@ $(BINDIR)/Release/$(PACKAGE_NAME).oxt: @$(MKDIR) `dirname $@` @cp src/loffice/.bin/Release/$(PACKAGE_NAME).oxt $@ +php: $(BINDIR)/Release/tn3270.so + +$(BINDIR)/Release/tn3270.so: + @$(MAKE) -C src/php Release + @$(MKDIR) `dirname $@` + @cp src/php/.bin/Release/php3270.so $@ + #---[ Debug targets ]---------------------------------------------------------- Debug: $(BINDIR)/Debug/$(PACKAGE_TARNAME)$(EXEEXT) \ @@ -341,6 +348,9 @@ install-sdk: install-oxt: @$(MAKE) BINDIR=../../.bin LIB3270_CFLAGS="-I../../src/include" -C src/loffice install +install-php: + @$(MAKE) -C src/php install + install-plugin-rexx: @$(MAKE) BINDIR=../../../.bin LIB3270_CFLAGS="-I../../src/include" -C src/plugins/rx3270 install @@ -359,6 +369,7 @@ clean: @make -C src/plugins/rx3270 clean @make -C src/plugins/dbus3270 clean @make -C src/loffice clean + @make -C src/php clean @make -C src/classlib clean @rm -f $(PACKAGE_NAME).png @rm -f $(PACKAGE_NAME)-logo.png diff --git a/configure.ac b/configure.ac index 2519efb..958431d 100644 --- a/configure.ac +++ b/configure.ac @@ -387,6 +387,7 @@ if test -z "${PHPCONFIG}"; then AC_MSG_NOTICE([Program php-config not found. Use --with-php-config=path to specify absolute path to the php-config tool.]) else AC_DEFINE(HAVE_PHP) + EXTENSIONS="$EXTENSIONS php" fi AC_SUBST(PHPCONFIG) diff --git a/po/pt_BR.po b/po/pt_BR.po index 8c6dc9d..912d745 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: pw3270 5.0\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2014-04-07 08:52-0300\n" +"POT-Creation-Date: 2014-04-11 15:48-0300\n" "PO-Revision-Date: 2014-02-17 08:05-0300\n" "Last-Translator: Perry Werneck \n" "Language-Team: Portugues <>\n" diff --git a/pw3270.spec.in b/pw3270.spec.in index eb0f281..a76847e 100644 --- a/pw3270.spec.in +++ b/pw3270.spec.in @@ -34,8 +34,13 @@ %define _release %{_rel} %define _distro Linux %define _redhat %(test -e /etc/redhat-release && echo 1 || echo 0) +%define _php %(which php-config 2> /dev/null > /dev/null && echo 1 || echo 0) %define _bldreq gtk3-devel libopenssl-devel +%if 0%{?_php} + %define phpmajor %(php-config --version | cut -d. -f1) +%endif + %if 0%{?suse_version} %define _release %{_rel}.suse%{suse_version} %define _distro SuSE Linux %{suse_version} @@ -77,6 +82,8 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build Requires: openssl shared-mime-info lib3270 = @PACKAGE_VERSION@ Provides: lib@PACKAGE@ = @PACKAGE_VERSION@ lib@PACKAGE@.so = @PACKAGE_VERSION@ Distribution: %_distro + +BuildRequires: which BuildRequires: autoconf >= 2.61 BuildRequires: automake BuildRequires: gcc-c++ @@ -95,6 +102,10 @@ BuildRequires: libreoffice-sdk BuildRequires: ucpp %endif +%if 0%{?_php} +BuildRequires: php-devel +%endif + BuildRequires: rsvg-view %description @@ -170,6 +181,21 @@ allowing rexx scripts to access tn3270e hosts. Revision @PACKAGE_REVISION@ from @PACKAGE_SOURCE@ %endif +%if 0%{?_php} + +%package -n php%{phpmajor}-tn3270 +Summary: PHP%{phpmajor} Extension Module implementing tn3270 protocol +Group: Development/Libraries/PHP +Requires: lib3270 = @PACKAGE_VERSION@ + +%description -n php%{phpmajor}-tn3270 +This is an extension for acessing 3270 hosts directly +from PHP apps. + +Revision @PACKAGE_REVISION@ from @PACKAGE_SOURCE@ + +%endif + #---[ Build & Install ]----------------------------------------------------------------------------------------------- %prep @@ -185,9 +211,9 @@ export FFLAGS="$RPM_OPT_FLAGS" %if 0%{?_office} export OFFICE_HOME=%{_libdir}/libreoffice export OO_SDK_HOME=%{_libdir}/libreoffice/sdk -%configure +%configure --sysconfdir=%{_sysconfdir} %else -%configure --disable-office +%configure --disable-office --sysconfdir=%{_sysconfdir} %endif %build @@ -272,6 +298,13 @@ rm -rf $RPM_BUILD_ROOT %{_datadir}/pw3270/ui/80rexx.xml %endif +%if 0%{?_php} +%files -n php%{phpmajor}-tn3270 +%defattr(-,root,root) +%{_sysconfdir}/php%{phpmajor}/conf.d/tn3270.ini +%{_libdir}/php%{phpmajor}/extensions/tn3270.so +%endif + #---[ Scripts ]------------------------------------------------------------------------------------------------------- %post -- libgit2 0.21.2