pw3270.spec.in 5.51 KB
#
# "Software pw3270, desenvolvido com base nos códigos fontes do WC3270  e X3270
# (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a
# aplicativos mainframe. Registro no INPI sob o nome G3270.
#
#  Copyright (C) <2008> <Banco do Brasil S.A.>
#
# Este programa é software livre. Você pode redistribuí-lo e/ou modificá-lo sob
# os termos da GPL v.2 - Licença Pública Geral  GNU,  conforme  publicado  pela
# Free Software Foundation.
#
# Este programa é distribuído na expectativa de  ser  útil,  mas  SEM  QUALQUER
# GARANTIA; sem mesmo a garantia implícita de COMERCIALIZAÇÃO ou  de  ADEQUAÇÃO
# A QUALQUER PROPÓSITO EM PARTICULAR. Consulte a Licença Pública Geral GNU para
# obter mais detalhes.
#
# Você deve ter recebido uma cópia da Licença Pública Geral GNU junto com este
# programa;  se  não, escreva para a Free Software Foundation, Inc., 59 Temple
# Place, Suite 330, Boston, MA, 02111-1307, USA
#
# Contatos:
#
# perry.werneck@gmail.com	(Alexandre Perry de Souza Werneck)
# erico.mendonca@gmail.com	(Erico Mascarenhas Mendonça)
# licinio@bb.com.br		(Licínio Luis Branco)
# kraucer@bb.com.br		(Kraucer Fernandes Mazuco)
#


#---[ Check for distro ]----------------------------------------------------------------------------------------------

%define _rel		@PACKAGE_LEVEL@

%define _release	%{_rel}
%define _distro		Linux
%define _redhat		%(test -e /etc/redhat-release && echo 1 || echo 0)
%define _bldreq		gtk3-devel libopenssl-devel

%if 0%{?suse_version}
	%define _release %{_rel}.suse%{suse_version}
	%define _distro SuSE Linux %{suse_version}
	%if %{?suse_version} < 1200
		%define _bldreq gtk2-devel >= 2.16 libopenssl-devel
	%endif
%endif

%if 0%{?fedora}
	%define _release %{_rel}.fc%{fedora}
	%define _redhat 0
	%define _distro Fedora %{fedora}
	%define _bldreq gtk2-devel openssl-devel
%endif

%if 0%{?_redhat}
	%define _redhat_prefix	%(grep -q "Red Hat Linux" /etc/redhat-release && echo rhl || echo el)
	%define _redhat_vernum	%(rpm -qf --queryformat %{VERSION} /etc/redhat-release|tr -d '.')
	%define _release	%{_rel}.%{_redhat_prefix}%{_redhat_vernum}
	%define _distro		%{_redhat_prefix} %{_redhat_vernum}
	%define _bldreq gtk2-devel openssl-devel
%endif

#---[ Packaging ]-----------------------------------------------------------------------------------------------------

Name:           @PACKAGE@
License:        GPL-2.0
Group:          System/X11/Terminals
Version:        @PACKAGE_VERSION@
Release:        %_release
Summary:        IBM 3270 Terminal emulator for gtk
Source:         %{name}-%{version}.tar.bz2
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:	autoconf >= 2.61 automake gcc-c++ sed pkgconfig %{_bldreq} gettext-devel findutils coreutils desktop-file-utils

%description
IBM 3270 terminal emulator gtk. It can be used to communicate with
any IBM host that supports 3270-style connections over TELNET.

Revision @PACKAGE_REVISION@ from @PACKAGE_SOURCE@

%package devel
Summary:	Files required for development of %{name} plugins
Group:		Development/Libraries/C and C++
Requires:	%{name} = @PACKAGE_VERSION@

%description devel
Development files for %{name}

Revision @PACKAGE_REVISION@ from @PACKAGE_SOURCE@

%package -n lib3270
Summary:	3270 Communication library for %{name}
Group:		Development/Libraries/C and C++
Requires:       openssl

%description -n lib3270
tn3270 protocol library for %{name}

Revision @PACKAGE_REVISION@ from @PACKAGE_SOURCE@

%package -n lib3270-devel
Summary:	Devel for 3270 Communication library for %{name}
Group:		Development/Libraries/C and C++
Requires:	lib3270 = @PACKAGE_VERSION@

%description -n lib3270-devel
devel for tn3270 protocol library for %{name}

Revision @PACKAGE_REVISION@ from @PACKAGE_SOURCE@

#---[ Build & Install ]-----------------------------------------------------------------------------------------------

%prep

%setup -q -n %{name}-%{version}
find . -exec touch {} \;
aclocal
autoconf
./configure --enable-pic --prefix=%{_prefix} --bindir=%{_bindir} --datadir=%{_datadir} --includedir=%{_includedir} --libdir=%{_libdir}

%build
make clean
make all

%install
rm -rf $RPM_BUILD_ROOT
cd %{_builddir}/%{name}-%{version}
%makeinstall
%find_lang %{name} langfiles

%clean
rm -rf $RPM_BUILD_ROOT

#---[ Files ]---------------------------------------------------------------------------------------------------------

%files -f langfiles
%defattr(-,root,root)
%doc AUTHORS LICENSE
%{_mandir}/*/*

# Main application
%dir %{_datadir}/@PACKAGE_NAME@
%dir %{_datadir}/@PACKAGE_NAME@/ui
%{_datadir}/applications/@PACKAGE_NAME@.desktop

%{_bindir}/@PACKAGE_NAME@
%{_libdir}/libpw3270.so.@MAJOR_VERSION@
%{_libdir}/libpw3270.so.@VERSION@

%{_datadir}/@PACKAGE_NAME@/ui/00default.xml
%{_datadir}/@PACKAGE_NAME@/@PACKAGE_NAME@.png
%{_datadir}/@PACKAGE_NAME@/@PACKAGE_NAME@-logo.png

%files -n lib3270
%defattr(-,root,root)
%{_libdir}/lib3270.so.@MAJOR_VERSION@
%{_libdir}/lib3270.so.@VERSION@

%files -n lib3270-devel
%defattr(-,root,root)
%{_includedir}/lib3270.h
%{_includedir}/pw3270.h
%{_includedir}/v3270.h
%{_includedir}/lib3270
%{_datadir}/@PACKAGE_NAME@/ui/99debug.xml
%{_libdir}/pkgconfig/*.pc
%{_libdir}/lib3270.so
%{_libdir}/libpw3270.so

#---[ Scripts ]-------------------------------------------------------------------------------------------------------

%post
/sbin/ldconfig
exit 0

%postun
/sbin/ldconfig
exit 0

%post -n lib3270
/sbin/ldconfig
exit 0

%postun -n lib3270
/sbin/ldconfig
exit 0