Commit 1e4047bc5a5a687e5e37427b113d66d2565b410f

Authored by perry.werneck@gmail.com
1 parent bbb897bd

Ajustando empacotamento do módulo PHP

@@ -157,6 +157,13 @@ $(BINDIR)/Release/$(PACKAGE_NAME).oxt: @@ -157,6 +157,13 @@ $(BINDIR)/Release/$(PACKAGE_NAME).oxt:
157 @$(MKDIR) `dirname $@` 157 @$(MKDIR) `dirname $@`
158 @cp src/loffice/.bin/Release/$(PACKAGE_NAME).oxt $@ 158 @cp src/loffice/.bin/Release/$(PACKAGE_NAME).oxt $@
159 159
  160 +php: $(BINDIR)/Release/tn3270.so
  161 +
  162 +$(BINDIR)/Release/tn3270.so:
  163 + @$(MAKE) -C src/php Release
  164 + @$(MKDIR) `dirname $@`
  165 + @cp src/php/.bin/Release/php3270.so $@
  166 +
160 #---[ Debug targets ]---------------------------------------------------------- 167 #---[ Debug targets ]----------------------------------------------------------
161 168
162 Debug: $(BINDIR)/Debug/$(PACKAGE_TARNAME)$(EXEEXT) \ 169 Debug: $(BINDIR)/Debug/$(PACKAGE_TARNAME)$(EXEEXT) \
@@ -341,6 +348,9 @@ install-sdk: @@ -341,6 +348,9 @@ install-sdk:
341 install-oxt: 348 install-oxt:
342 @$(MAKE) BINDIR=../../.bin LIB3270_CFLAGS="-I../../src/include" -C src/loffice install 349 @$(MAKE) BINDIR=../../.bin LIB3270_CFLAGS="-I../../src/include" -C src/loffice install
343 350
  351 +install-php:
  352 + @$(MAKE) -C src/php install
  353 +
344 install-plugin-rexx: 354 install-plugin-rexx:
345 @$(MAKE) BINDIR=../../../.bin LIB3270_CFLAGS="-I../../src/include" -C src/plugins/rx3270 install 355 @$(MAKE) BINDIR=../../../.bin LIB3270_CFLAGS="-I../../src/include" -C src/plugins/rx3270 install
346 356
@@ -359,6 +369,7 @@ clean: @@ -359,6 +369,7 @@ clean:
359 @make -C src/plugins/rx3270 clean 369 @make -C src/plugins/rx3270 clean
360 @make -C src/plugins/dbus3270 clean 370 @make -C src/plugins/dbus3270 clean
361 @make -C src/loffice clean 371 @make -C src/loffice clean
  372 + @make -C src/php clean
362 @make -C src/classlib clean 373 @make -C src/classlib clean
363 @rm -f $(PACKAGE_NAME).png 374 @rm -f $(PACKAGE_NAME).png
364 @rm -f $(PACKAGE_NAME)-logo.png 375 @rm -f $(PACKAGE_NAME)-logo.png
@@ -387,6 +387,7 @@ if test -z "${PHPCONFIG}"; then @@ -387,6 +387,7 @@ if test -z "${PHPCONFIG}"; then
387 AC_MSG_NOTICE([Program php-config not found. Use --with-php-config=path to specify absolute path to the php-config tool.]) 387 AC_MSG_NOTICE([Program php-config not found. Use --with-php-config=path to specify absolute path to the php-config tool.])
388 else 388 else
389 AC_DEFINE(HAVE_PHP) 389 AC_DEFINE(HAVE_PHP)
  390 + EXTENSIONS="$EXTENSIONS php"
390 fi 391 fi
391 392
392 AC_SUBST(PHPCONFIG) 393 AC_SUBST(PHPCONFIG)
@@ -5,7 +5,7 @@ msgid "" @@ -5,7 +5,7 @@ msgid ""
5 msgstr "" 5 msgstr ""
6 "Project-Id-Version: pw3270 5.0\n" 6 "Project-Id-Version: pw3270 5.0\n"
7 "Report-Msgid-Bugs-To: \n" 7 "Report-Msgid-Bugs-To: \n"
8 -"POT-Creation-Date: 2014-04-07 08:52-0300\n" 8 +"POT-Creation-Date: 2014-04-11 15:48-0300\n"
9 "PO-Revision-Date: 2014-02-17 08:05-0300\n" 9 "PO-Revision-Date: 2014-02-17 08:05-0300\n"
10 "Last-Translator: Perry Werneck <perry.werneck@gmail.com>\n" 10 "Last-Translator: Perry Werneck <perry.werneck@gmail.com>\n"
11 "Language-Team: Portugues <>\n" 11 "Language-Team: Portugues <>\n"
pw3270.spec.in
@@ -34,8 +34,13 @@ @@ -34,8 +34,13 @@
34 %define _release %{_rel} 34 %define _release %{_rel}
35 %define _distro Linux 35 %define _distro Linux
36 %define _redhat %(test -e /etc/redhat-release && echo 1 || echo 0) 36 %define _redhat %(test -e /etc/redhat-release && echo 1 || echo 0)
  37 +%define _php %(which php-config 2> /dev/null > /dev/null && echo 1 || echo 0)
37 %define _bldreq gtk3-devel libopenssl-devel 38 %define _bldreq gtk3-devel libopenssl-devel
38 39
  40 +%if 0%{?_php}
  41 + %define phpmajor %(php-config --version | cut -d. -f1)
  42 +%endif
  43 +
39 %if 0%{?suse_version} 44 %if 0%{?suse_version}
40 %define _release %{_rel}.suse%{suse_version} 45 %define _release %{_rel}.suse%{suse_version}
41 %define _distro SuSE Linux %{suse_version} 46 %define _distro SuSE Linux %{suse_version}
@@ -77,6 +82,8 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -77,6 +82,8 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build
77 Requires: openssl shared-mime-info lib3270 = @PACKAGE_VERSION@ 82 Requires: openssl shared-mime-info lib3270 = @PACKAGE_VERSION@
78 Provides: lib@PACKAGE@ = @PACKAGE_VERSION@ lib@PACKAGE@.so = @PACKAGE_VERSION@ 83 Provides: lib@PACKAGE@ = @PACKAGE_VERSION@ lib@PACKAGE@.so = @PACKAGE_VERSION@
79 Distribution: %_distro 84 Distribution: %_distro
  85 +
  86 +BuildRequires: which
80 BuildRequires: autoconf >= 2.61 87 BuildRequires: autoconf >= 2.61
81 BuildRequires: automake 88 BuildRequires: automake
82 BuildRequires: gcc-c++ 89 BuildRequires: gcc-c++
@@ -95,6 +102,10 @@ BuildRequires: libreoffice-sdk @@ -95,6 +102,10 @@ BuildRequires: libreoffice-sdk
95 BuildRequires: ucpp 102 BuildRequires: ucpp
96 %endif 103 %endif
97 104
  105 +%if 0%{?_php}
  106 +BuildRequires: php-devel
  107 +%endif
  108 +
98 BuildRequires: rsvg-view 109 BuildRequires: rsvg-view
99 110
100 %description 111 %description
@@ -170,6 +181,21 @@ allowing rexx scripts to access tn3270e hosts. @@ -170,6 +181,21 @@ allowing rexx scripts to access tn3270e hosts.
170 Revision @PACKAGE_REVISION@ from @PACKAGE_SOURCE@ 181 Revision @PACKAGE_REVISION@ from @PACKAGE_SOURCE@
171 %endif 182 %endif
172 183
  184 +%if 0%{?_php}
  185 +
  186 +%package -n php%{phpmajor}-tn3270
  187 +Summary: PHP%{phpmajor} Extension Module implementing tn3270 protocol
  188 +Group: Development/Libraries/PHP
  189 +Requires: lib3270 = @PACKAGE_VERSION@
  190 +
  191 +%description -n php%{phpmajor}-tn3270
  192 +This is an extension for acessing 3270 hosts directly
  193 +from PHP apps.
  194 +
  195 +Revision @PACKAGE_REVISION@ from @PACKAGE_SOURCE@
  196 +
  197 +%endif
  198 +
173 #---[ Build & Install ]----------------------------------------------------------------------------------------------- 199 #---[ Build & Install ]-----------------------------------------------------------------------------------------------
174 200
175 %prep 201 %prep
@@ -185,9 +211,9 @@ export FFLAGS=&quot;$RPM_OPT_FLAGS&quot; @@ -185,9 +211,9 @@ export FFLAGS=&quot;$RPM_OPT_FLAGS&quot;
185 %if 0%{?_office} 211 %if 0%{?_office}
186 export OFFICE_HOME=%{_libdir}/libreoffice 212 export OFFICE_HOME=%{_libdir}/libreoffice
187 export OO_SDK_HOME=%{_libdir}/libreoffice/sdk 213 export OO_SDK_HOME=%{_libdir}/libreoffice/sdk
188 -%configure 214 +%configure --sysconfdir=%{_sysconfdir}
189 %else 215 %else
190 -%configure --disable-office 216 +%configure --disable-office --sysconfdir=%{_sysconfdir}
191 %endif 217 %endif
192 218
193 %build 219 %build
@@ -272,6 +298,13 @@ rm -rf $RPM_BUILD_ROOT @@ -272,6 +298,13 @@ rm -rf $RPM_BUILD_ROOT
272 %{_datadir}/pw3270/ui/80rexx.xml 298 %{_datadir}/pw3270/ui/80rexx.xml
273 %endif 299 %endif
274 300
  301 +%if 0%{?_php}
  302 +%files -n php%{phpmajor}-tn3270
  303 +%defattr(-,root,root)
  304 +%{_sysconfdir}/php%{phpmajor}/conf.d/tn3270.ini
  305 +%{_libdir}/php%{phpmajor}/extensions/tn3270.so
  306 +%endif
  307 +
275 #---[ Scripts ]------------------------------------------------------------------------------------------------------- 308 #---[ Scripts ]-------------------------------------------------------------------------------------------------------
276 309
277 %post 310 %post