From 815c4338f1fc5194e910d90e63d6f7622eb86141 Mon Sep 17 00:00:00 2001 From: Perry Werneck Date: Wed, 18 Jan 2017 17:02:23 -0200 Subject: [PATCH] Ajustes para empacotamento. --- Makefile.in | 27 +++++++++++++++++++++++++++ rpm/pw3270.spec | 443 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- 2 files changed, 117 insertions(+), 353 deletions(-) diff --git a/Makefile.in b/Makefile.in index 58a312e..7da88a0 100644 --- a/Makefile.in +++ b/Makefile.in @@ -61,6 +61,7 @@ INSTALL_PROGRAM=@INSTALL_PROGRAM@ MKDIR=@MKDIR_P@ MSGCAT=@MSGCAT@ AMTAR=@AMTAR@ +RPMBUILD=@RPMBUILD@ #---[ Rules ]------------------------------------------------------------------ @@ -190,6 +191,22 @@ bz2: \ tar: \ $(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar +rpm: \ + $(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar.bz2 + + @$(MKDIR) $(BASEDIR)/rpm + @$(MKDIR) $(BASEDIR)/rpm/SPECS + @$(MKDIR) $(BASEDIR)/rpm/SOURCES + @$(MKDIR) $(BASEDIR)/rpm/SRPMS + @$(MKDIR) $(BASEDIR)/rpm/RPMS + @$(MKDIR) $(BASEDIR)/rpm/BUILD + @$(MKDIR) $(BASEDIR)/rpm/BUILDROOT + @umask 002 ; $(RPMBUILD) \ + --define="_topdir $(BASEDIR)/rpm" \ + --define="_packager $(USER)@$(HOSTNAME)" \ + --clean \ + -ta $(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar.bz2 + $(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar: \ $(SRCDIR) @@ -235,6 +252,16 @@ $(SRCDIR): \ debian/* \ $(SRCDIR)/debian + @$(MKDIR) $(SRCDIR)/scripts + @$(INSTALL_DATA) \ + scripts/* \ + $(SRCDIR)/scripts + + @$(MKDIR) $(SRCDIR)/sdk + @$(INSTALL_DATA) \ + sdk/*.in \ + $(SRCDIR)/sdk + @$(INSTALL_DATA) \ rpm/*.spec \ $(SRCDIR) diff --git a/rpm/pw3270.spec b/rpm/pw3270.spec index 2b43bb7..d895b3a 100644 --- a/rpm/pw3270.spec +++ b/rpm/pw3270.spec @@ -1,5 +1,5 @@ # -# spec file for package @PACKAGE@ +# spec file for package pw3270 # # Copyright (c) 2015 SUSE LINUX GmbH, Nuernberg, Germany. # Copyright (C) <2008> @@ -16,42 +16,46 @@ # Please submit bugfixes or comments via http://bugs.opensuse.org/ # -%define LIBVERSION @MAJOR_VERSION@_@MINOR_VERSION@ +#---[ Versions ]------------------------------------------------------------------------------------------------------ -# -# References: -# -# https://en.opensuse.org/openSUSE:Build_Service_cross_distribution_howto#Detect_a_distribution_flavor_for_special_code -# +%define MAJOR_VERSION 5 +%define MINOR_VERSION 1 -%define _dbus 1 -%define _office 0 -%define _php 0 -%define _ooRexx 1 -%define _java 0 -%define _python 1 +#---[ Selected modules ]---------------------------------------------------------------------------------------------- -%define _distro linux +%define _libvrs %{MAJOR_VERSION}_%{MINOR_VERSION} +%define _dbus 1 #---[ Packaging ]----------------------------------------------------------------------------------------------------- -Name: @PACKAGE@ -Version: @PACKAGE_VERSION@ -Release: @PACKAGE_LEVEL@ +Name: pw3270 +Version: 5.1 +Release: 0 Summary: IBM 3270 Terminal emulator for GTK License: GPL-2.0 Group: System/X11/Terminals Url: https://portal.softwarepublico.gov.br/social/pw3270/ -Source: %{name}-%{version}.tar.bz2 +Source: pw3270-%{version}.tar.bz2 +#Source1: %{name}.rpmlintrc BuildRoot: %{_tmppath}/%{name}-%{version}-build -Requires: lib3270 = %{version} +Requires: lib3270-%{_libvrs} = %{version} Requires: shared-mime-info -Provides: lib@PACKAGE@ = %{version} -Provides: lib@PACKAGE@.so = %{version} +Provides: libpw3270 = %{version} +Provides: libpw3270.so = %{version} + +#--[ Setup by distribution ]------------------------------------------------------------------------------------------ +# +# References: +# +# https://en.opensuse.org/openSUSE:Build_Service_cross_distribution_howto#Detect_a_distribution_flavor_for_special_code +# + +%define _distro linux + #--[ Red HAT ]-------------------------------------------------------------------------------------------------------- @@ -62,26 +66,8 @@ Provides: lib@PACKAGE@.so = %{version} BuildRequires: dbus-devel BuildRequires: dbus-glib-devel BuildRequires: openssl-devel - -%define _office 0 -%define _php 0 - -%if 0%{?rhel_version} >= 0700 - -# RHEL 7.0 - BuildRequires: gtk3-devel -%else - -# RHEL 6.0 -%define _python 0 - -BuildRequires: gtk2-devel -BuildRequires: java-1.6.0-devel - -%endif - %endif #--[ CentOS ]--------------------------------------------------------------------------------------------------------- @@ -93,30 +79,8 @@ BuildRequires: java-1.6.0-devel BuildRequires: pkgconfig(dbus-1) BuildRequires: pkgconfig(dbus-glib-1) BuildRequires: pkgconfig(openssl) - -%if 0%{?centos_version} >= 0700 - -# CentOS 7 - -%define _php 5 -BuildRequires: php-devel - -%define _office 0 - BuildRequires: pkgconfig(gtk+-3.0) -%else - -# CentOS 6 - -%define _office 0 -%define _python 0 - -BuildRequires: gtk2-devel -BuildRequires: java-1.8.0-devel - -%endif - %endif #--[ Fedora ]--------------------------------------------------------------------------------------------------------- @@ -127,25 +91,8 @@ BuildRequires: java-1.8.0-devel BuildRequires: pkgconfig(dbus-1) BuildRequires: pkgconfig(dbus-glib-1) -BuildRequires: pkgconfig(gtk+-3.0) BuildRequires: pkgconfig(openssl) - -%define _php 5 -BuildRequires: php-devel - -%if 0%{?fedora} >= 21 - -# Fedora 21 fails on libreoffice sdk -%define _office 0 - -%else - -#%define _office 0 -#BuildRequires: libreoffice-sdk -#BuildRequires: libreoffice-ure -#BuildRequires: librsvg2-tools - -%endif +BuildRequires: pkgconfig(gtk+-3.0) %endif @@ -154,43 +101,19 @@ BuildRequires: php-devel %if 0%{?suse_version} # https://en.opensuse.org/openSUSE:Packaging_Conventions_RPM_Macros#.25sles_version -%if 0%{?sles_version} - %define _distro sles%{sles_version} - %define _office 0 -%else -%if 0%{?sled_version} - %define _distro sled%{sled_version} - %define _office 0 +%if 0%{?is_opensuse} + %define _distro opensuse%{suse_version} %else %define _distro suse%{suse_version} %endif -%endif - BuildRequires: libopenssl-devel BuildRequires: rsvg-view -# OpenSUSE >= 12.2 enable GTK3 & D-Bus -%if 0%{?suse_version} >= 1220 - BuildRequires: pkgconfig(dbus-1) BuildRequires: pkgconfig(dbus-glib-1) BuildRequires: pkgconfig(gtk+-3.0) -%else - -%define _dbus 0 -%define _python 0 -BuildRequires: gtk2-devel - -%endif - -# OpenSUSE >= 13.1 uses PHP5 -%if 0%{?suse_version} >= 1310 -%define _php 5 -BuildRequires: php%{_php}-devel -%endif - %endif #--------------------------------------------------------------------------------------------------------------------- @@ -199,28 +122,6 @@ BuildRequires: autoconf >= 2.61 BuildRequires: automake BuildRequires: binutils BuildRequires: coreutils - -%if 0%{?_ooRexx} -BuildRequires: ooRexx-devel >= 4.2.0 -%endif - -%if 0%{?_python} -BuildRequires: python -BuildRequires: python-devel - -%define pythonextpath %(python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()") -%endif - -%if 0%{?_php} -%define _phpextdir %(php-config --extension-dir) -%define _phpconf %(php-config | sed 's@ @\\n@g' | grep "^--with-config-file-scan-dir=" | cut -d= -f2) -%endif - -%if 0%{?_java} -BuildRequires: java-devel -BuildRequires: javapackages-tools -%endif - BuildRequires: desktop-file-utils BuildRequires: findutils BuildRequires: gcc-c++ @@ -236,13 +137,13 @@ Based on the original x3270 code, pw3270 was originally created for Banco do Bra #--[ lib3270 ]-------------------------------------------------------------------------------------------------------- -%package -n lib3270-%LIBVERSION +%package -n lib3270-%{_libvrs} Summary: 3270 Communication library for %{name} Group: Development/Libraries/C and C++ Requires: openssl -Provides: lib3270 +Provides: lib3270 = %{version} -%description -n lib3270-%LIBVERSION +%description -n lib3270-%{_libvrs} Open-source GTK-based IBM 3270 terminal emulator with many advanced features. It can be used to communicate with any IBM host that supports 3270-style connections over TELNET. This package contains the tn3270 protocol library for %{name} @@ -252,19 +153,22 @@ This package contains the tn3270 protocol library for %{name} %package -n lib3270-devel Summary: Devel for 3270 Communication library for %{name} Group: Development/Libraries/C and C++ -Requires: lib3270-%LIBVERSION = %{version} +Requires: lib3270 = %{version} %description -n lib3270-devel Open-source GTK-based IBM 3270 terminal emulator with many advanced features. It can be used to communicate with any IBM host that supports 3270-style connections over TELNET. This package contains the development files for tn3270 protocol library for %{name} -%package -n @PACKAGE@-devel +%package -n %{name}-devel Summary: Files required for development of %{name} plugins Group: Development/Libraries/C and C++ + Requires: lib3270-devel = %{version} -Requires: @PACKAGE@ = %{version} +Requires: %{name} = %{version} + +Provides: pw3270-devel = %{MAJOR_VERSION}.%{MINOR_VERSION} -%description -n @PACKAGE@-devel +%description -n %{name}-devel Open-source GTK-based IBM 3270 terminal emulator with many advanced features. It can be used to communicate with any IBM host that supports 3270-style connections over TELNET. This package contains the development files for %{name} @@ -282,97 +186,16 @@ Requires: dbus-1 Plugin exporting a DBUS object from every %{name} open session. %endif -%if 0%{?_ooRexx} -%package -n %{name}-plugin-rexx -Summary: Rexx class for 3270 access -Group: Development/Languages/Other -Requires: lib3270 = %{version} -Requires: ooRexx >= 4.1 - -%description -n %{name}-plugin-rexx -This package provides Rexx class and associated libraries -allowing rexx scripts to access tn3270e hosts. -%endif - -#--[ Extensions ]----------------------------------------------------------------------------------------------------- - -%if 0%{?_office} -%package -n %{name}-libreoffice -Summary: 3270 host access extension for libreoffice -Group: Productivity/Office/Suite -Requires: lib3270 = %{version} -Requires: libreoffice - -%description -n %{name}-libreoffice -This package provides 3270 access object to StarBasic. -%endif - -%if 0%{?_php} -%package -n php%{_php}-tn3270 -Summary: PHP%{_php} Extension Module implementing tn3270 protocol -Group: Development/Libraries/PHP -Requires: lib3270 = %{version} - -%description -n php%{_php}-tn3270 -This is an extension for acessing 3270 hosts directly -from PHP apps. -%endif - -%if 0%{?_python} -%package -n python-tn3270 -Summary: Python Extension Module implementing tn3270 protocol -Group: Development/Libraries/Python -Requires: lib3270 = %{version} - -%description -n python-tn3270 -This is an extension for acessing 3270 hosts directly -from python apps. -%endif - -%if 0%{?_java} -%package java -Summary: Java class to interact with @PACKAGE@ -Group: Development/Libraries/Java -Requires: javapackages-tools -Requires: lib3270 = %{version} - -%description java -Java class for lib3270/@PACKAGE@ interaction. - -%package plugin-java -Summary: Java plugin for %{name} -Group: Development/Libraries/Java -Requires: %{name} = %{version} -Requires: %{name}-java = %{version} - -%description plugin-java -This package provides a plugin allowing calling of java classes -from @PACKAGE@ application. - -%package javadoc -Summary: Javadoc for %{name} -Group: Documentation -Requires: jpackage-utils - -%description javadoc -API documentation for %{name}. -%endif - #---[ Build & Install ]----------------------------------------------------------------------------------------------- %prep -echo "Distribution: %{_distro}" +%setup -q -n pw3270-%{version} -%if 0%{?_php} - echo " * PHP%{_php} is enabled" -%endif -%if 0%{?_dbus} - echo " * DBUS is enabled" -%endif +echo "m4_define([SVN_REVISION], %{release})" > revision.m4 +echo "m4_define([SVN_URL], http://softwarepublico.gov.br/gitlab/pw3270/principal.git)" >> revision.m4 +echo "m4_define([APP_LEVEL], 0)" >> revision.m4 -%setup -q -n %{name}-%{version} -find . -exec touch {} \; aclocal autoconf @@ -380,62 +203,42 @@ export CFLAGS="$RPM_OPT_FLAGS" export CXXFLAGS="$RPM_OPT_FLAGS" export FFLAGS="$RPM_OPT_FLAGS" -%if 0%{?_java} -export JAVA_HOME=%{java_home} -echo "JAVA_HOME=$JAVA_HOME" -echo "javadocdir=%{_javadocdir}" -%endif - -%configure --disable-strip \ - --enable-pic \ - --with-jnidir="%{_jnidir}" \ - --with-jvmjardir="%{_jvmjardir}" \ - --with-javadocdir="%{_javadocdir}" +%configure %build make clean make all %install -export NO_BRP_CHECK_BYTECODE_VERSION=true - -make DESTDIR=$RPM_BUILD_ROOT install +%makeinstall -find $RPM_BUILD_ROOT +%find_lang pw3270 langfiles -%find_lang %{name} langfiles - -cat > @PACKAGE@.desktop << EOF +cat > pw3270.desktop << EOF [Desktop Entry] X-SuSE-translate=true -GenericName=@PACKAGE@ +GenericName=pw3270 Name=3270 Terminal Comment=IBM 3270 Terminal emulator -Exec=@PACKAGE@ -Icon=%{_datadir}/@PACKAGE@/@PACKAGE@.png +Exec=pw3270 +Icon=%{_datadir}/pw3270/pw3270.png Terminal=false Type=Application StartupNotify=true EOF -chmod 644 @PACKAGE@.desktop +chmod 644 pw3270.desktop desktop-file-install --mode 644 \ --dir $RPM_BUILD_ROOT/%{_datadir}/applications \ --add-category System \ --add-category TerminalEmulator \ - @PACKAGE@.desktop - -%if 0%{?_ooRexx} == 0 -# remove rexx-files from builddir if it's disabled -rm -f ${RPM_BUILD_ROOT}/%{_datadir}/@PACKAGE@/ui/80rexx.xml -%endif + pw3270.desktop -%if 0%{?_java} == 0 -# remove java-files from builddir if it's disabled -rm ${RPM_BUILD_ROOT}/%{_datadir}/@PACKAGE@/ui/*java*.xml -%endif +# Java now lives in another package +rm ${RPM_BUILD_ROOT}/%{_datadir}/pw3270/ui/*java*.xml -find ${RPM_BUILD_ROOT} +# ooRexx now lives in another package +rm ${RPM_BUILD_ROOT}/%{_datadir}/pw3270/ui/*rexx*.xml %clean rm -rf %{buildroot} @@ -445,30 +248,30 @@ rm -rf %{buildroot} %files -f langfiles %defattr(-,root,root) %doc AUTHORS LICENSE -%{_mandir}/*/* +# %{_mandir}/*/* # Main application -%dir %{_datadir}/@PACKAGE@ -%dir %{_datadir}/@PACKAGE@/ui -%{_bindir}/@PACKAGE@ -%{_libdir}/lib@PACKAGE@.so.5 -%{_libdir}/lib@PACKAGE@.so.%version - -%{_datadir}/applications/@PACKAGE@.desktop - -%{_datadir}/@PACKAGE@/ui/00default.xml -%{_datadir}/@PACKAGE@/ui/10functions.xml -%{_datadir}/@PACKAGE@/ui/10keypad.xml -%{_datadir}/@PACKAGE@/colors.conf -%{_datadir}/@PACKAGE@/@PACKAGE@.png -%{_datadir}/@PACKAGE@/@PACKAGE@-logo.png -%{_datadir}/locale/pt_BR/LC_MESSAGES/@PACKAGE@.mo -%dir %{_libdir}/@PACKAGE@-plugins - -%files -n lib3270-%LIBVERSION +%dir %{_datadir}/pw3270 +%dir %{_datadir}/pw3270/ui +%{_bindir}/pw3270 +%{_libdir}/libpw3270.so.%{MAJOR_VERSION} +%{_libdir}/libpw3270.so.%{MAJOR_VERSION}.%{MINOR_VERSION} + +%{_datadir}/applications/pw3270.desktop + +%{_datadir}/pw3270/ui/00default.xml +%{_datadir}/pw3270/ui/10functions.xml +%{_datadir}/pw3270/ui/10keypad.xml +%{_datadir}/pw3270/colors.conf +%{_datadir}/pw3270/pw3270.png +%{_datadir}/pw3270/pw3270-logo.png +%{_datadir}/locale/pt_BR/LC_MESSAGES/pw3270.mo +%dir %{_libdir}/pw3270-plugins + +%files -n lib3270-%{_libvrs} %defattr(-,root,root) -%{_libdir}/lib3270.so.%version -%{_libdir}/lib3270.so.5 +%{_libdir}/lib3270.so.%{MAJOR_VERSION}.%{MINOR_VERSION} +%{_libdir}/lib3270.so.%{MAJOR_VERSION} %files -n lib3270-devel %defattr(-,root,root) @@ -477,81 +280,25 @@ rm -rf %{buildroot} %{_libdir}/pkgconfig/lib3270.pc %{_libdir}/lib3270.so -%files -n @PACKAGE@-devel +%files -n %{name}-devel %defattr(-,root,root) -%{_includedir}/@PACKAGE@ -%{_includedir}/@PACKAGE@.h -%{_datadir}/@PACKAGE@/ui/98trace.xml -%{_datadir}/@PACKAGE@/ui/99debug.xml -%{_libdir}/lib@PACKAGE@.so -%{_libdir}/pkgconfig/@PACKAGE@.pc +%{_includedir}/pw3270 +%{_includedir}/pw3270.h +%{_datadir}/pw3270/ui/98trace.xml +%{_datadir}/pw3270/ui/99debug.xml +%{_libdir}/libpw3270.so +%{_libdir}/pkgconfig/pw3270.pc -%{_libdir}/lib@PACKAGE@cpp.a -%{_includedir}/@PACKAGE@cpp.h +%{_libdir}/libpw3270cpp.a +%{_includedir}/pw3270cpp.h -%dir %{_datadir}/@PACKAGE@/sample -%{_datadir}/@PACKAGE@/sample/* +%dir %{_datadir}/pw3270/sample +%{_datadir}/pw3270/sample/* %if 0%{?_dbus} %files plugin-dbus %defattr(-,root,root) -%{_libdir}/@PACKAGE@-plugins/dbus3270.so -%endif - -%if 0%{?_office} -%files -n %{name}-libreoffice -%defattr(-,root,root) -%dir %{_libdir}/libreoffice/share/extensions/%{name} -%dir %{_libdir}/libreoffice/share/extensions/%{name}/META-INF -%{_libdir}/libreoffice/share/extensions/%{name}/META-INF/manifest.xml -%{_libdir}/libreoffice/share/extensions/%{name}/description.txt -%{_libdir}/libreoffice/share/extensions/%{name}/description.xml -%{_libdir}/libreoffice/share/extensions/%{name}/@PACKAGE@.png -%{_libdir}/libreoffice/share/extensions/%{name}/@PACKAGE@.rdb -%{_libdir}/libreoffice/share/extensions/%{name}/@PACKAGE@.uno.so -%endif - -%if 0%{?_ooRexx} -%files -n %{name}-plugin-rexx -%defattr(-,root,root) -%{_rexxlibdir}/librx3270.so.%version -%{_rexxlibdir}/librx3270.so -%{_rexxclassdir}/rx3270.cls -%{_libdir}/@PACKAGE@-plugins/rx3270.so -%{_datadir}/@PACKAGE@/ui/80rexx.xml -%endif - -%if 0%{?_php} -%files -n php%{_php}-tn3270 -%defattr(-,root,root) -%config %{_phpconf}/tn3270.ini -%{_phpextdir}/*.so -%endif - -%if 0%{?_python} -%files -n python-tn3270 -%defattr(-,root,root) -%{pythonextpath}/py3270.so -%endif - -%if 0%{?_java} -%files java -%defattr(-,root,root) -%dir %{_jnidir} -%dir %{_jvmjardir} - -%{_jnidir}/libjni3270.so -%{_jvmjardir}/@PACKAGE@.jar - -%files plugin-java -%defattr(-,root,root) -%{_libdir}/@PACKAGE@-plugins/j3270.so - -%files javadoc -%defattr(-,root,root) -%dir %{_javadocdir} -%{_javadocdir}/%{name} -%{_datadir}/@PACKAGE@/ui/*java*.xml +%{_libdir}/pw3270-plugins/dbus3270.so %endif #---[ Scripts ]------------------------------------------------------------------------------------------------------- @@ -564,22 +311,12 @@ exit 0 /sbin/ldconfig exit 0 -%post -n lib3270-%LIBVERSION -/sbin/ldconfig -exit 0 - -%postun -n lib3270-%LIBVERSION +%post -n lib3270-%{_libvrs} /sbin/ldconfig exit 0 -%if 0%{?_ooRexx} -%post -n %{name}-plugin-rexx +%postun -n lib3270-%{_libvrs} /sbin/ldconfig exit 0 -%postun -n %{name}-plugin-rexx -/sbin/ldconfig -exit 0 -%endif - %changelog -- libgit2 0.21.2