[packages/stoken] - updated to 0.91 - added sh patch (fixes build when configure shell is ksh) - added java interface

qboosh qboosh at pld-linux.org
Sat Feb 18 21:42:12 CET 2017


commit 6d48841e2d6e43cc9e0a21cc02152a2028ddbc84
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sat Feb 18 21:43:59 2017 +0100

    - updated to 0.91
    - added sh patch (fixes build when configure shell is ksh)
    - added java interface
    - gtk+ GUI is now gtk+3 based

 stoken-sh.patch | 11 +++++++++
 stoken.spec     | 74 ++++++++++++++++++++++++++++++++++++++++++++++++++++-----
 2 files changed, 79 insertions(+), 6 deletions(-)
---
diff --git a/stoken.spec b/stoken.spec
index bad4318..8e63cc5 100644
--- a/stoken.spec
+++ b/stoken.spec
@@ -1,15 +1,27 @@
+#
+# Conditional build:
+%bcond_without	gtk	# GTK+ 3 based GUI
+%bcond_without	java	# JNI bindings
+#
 Summary:	Software Token for Linux/UNIX
 Summary(pl.UTF-8):	Token programowy dla systemów Linux/UNIX
 Name:		stoken
-Version:	0.2
-Release:	2
+Version:	0.91
+Release:	1
 License:	LGPL v2.1+
 Group:		Libraries
 Source0:	http://downloads.sourceforge.net/stoken/%{name}-%{version}.tar.gz
-# Source0-md5:	d815783d7198f1181c1a72e3d730d367
+# Source0-md5:	584432f22032f0a8a719272fa2329bcd
+Patch0:		%{name}-sh.patch
 URL:		http://stoken.sourceforge.net/
-BuildRequires:	gtk+2-devel >= 2.0
+%{?with_java:BuildRequires:	ant}
+BuildRequires:	autoconf >= 2.61
+BuildRequires:	automake >= 1:1.11
+%{?with_gtk:BuildRequires:	gtk+3-devel >= 3.0}
+%{?with_java:BuildRequires:	jdk}
 BuildRequires:	libtomcrypt-devel
+BuildRequires:	libtool >= 2:2
+BuildRequires:	libxml2-devel >= 2
 BuildRequires:	pkgconfig >= 1:0.27
 BuildRoot:	%{tmpdir}/%{name}-%{version}-root-%(id -u -n)
 
@@ -60,14 +72,42 @@ Static stoken library.
 %description static -l pl.UTF-8
 Statyczna biblioteka stoken.
 
+%package -n java-stoken
+Summary:	JNI interface for stoken library
+Summary(pl.UTF-8):	Interfejs JNI do biblioteki stoken
+License:	BSD
+Group:		Libraries/Java
+Requires:	%{name} = %{version}-%{release}
+
+%description -n java-stoken
+JNI interface for stoken library.
+
+%description -n java-stoken -l pl.UTF-8
+Interfejs JNI do biblioteki stoken.
+
 %prep
 %setup -q
+%patch0 -p1
 
 %build
-%configure
+%{__libtoolize}
+%{__aclocal} -I m4
+%{__autoconf}
+%{__autoheader}
+%{__automake}
+%configure \
+	--disable-silent-rules \
+	%{!?with_gtk:--without-gtk} \
+	%{?with_java:--with-java}
 
 %{__make}
 
+%if %{with java}
+cd java
+install -d dist
+%ant
+%endif
+
 %install
 rm -rf $RPM_BUILD_ROOT
 
@@ -77,26 +117,38 @@ rm -rf $RPM_BUILD_ROOT
 # obsoleted by pkg-config
 %{__rm} $RPM_BUILD_ROOT%{_libdir}/libstoken.la
 
+%if %{with java}
+%{__rm} $RPM_BUILD_ROOT%{_libdir}/libstoken-wrapper.{la,a}
+install -D java/dist/stoken-wrapper.jar $RPM_BUILD_ROOT%{_javadir}/stoken-wrapper.jar
+%endif
+
 %clean
 rm -rf $RPM_BUILD_ROOT
 
 %post	-p /sbin/ldconfig
 %postun	-p /sbin/ldconfig
 
+%post	-n java-stoken -p /sbin/ldconfig
+%postun	-n java-stoken -p /sbin/ldconfig
+
 %files
 %defattr(644,root,root,755)
-%doc README TODO
+%doc CHANGES README.md TODO
 %attr(755,root,root) %{_bindir}/stoken
 %attr(755,root,root) %{_libdir}/libstoken.so.*.*.*
 %attr(755,root,root) %ghost %{_libdir}/libstoken.so.1
 %{_mandir}/man1/stoken.1*
 
+%if %{with gtk}
 %files gui
 %defattr(644,root,root,755)
 %attr(755,root,root) %{_bindir}/stoken-gui
+%{_datadir}/stoken
 %{_desktopdir}/stoken-gui.desktop
+%{_desktopdir}/stoken-gui-small.desktop
 %{_pixmapsdir}/stoken-gui.png
 %{_mandir}/man1/stoken-gui.1*
+%endif
 
 %files devel
 %defattr(644,root,root,755)
@@ -107,3 +159,13 @@ rm -rf $RPM_BUILD_ROOT
 %files static
 %defattr(644,root,root,755)
 %{_libdir}/libstoken.a
+
+%if %{with java}
+%files -n java-stoken
+%defattr(644,root,root,755)
+%doc java/src/com/example/LibTest.java
+%attr(755,root,root) %{_libdir}/libstoken-wrapper.so.*.*.*
+%attr(755,root,root) %ghost %{_libdir}/libstoken-wrapper.so.0
+%attr(755,root,root) %{_libdir}/libstoken-wrapper.so
+%{_javadir}/stoken-wrapper.jar
+%endif
diff --git a/stoken-sh.patch b/stoken-sh.patch
new file mode 100644
index 0000000..b4887ca
--- /dev/null
+++ b/stoken-sh.patch
@@ -0,0 +1,11 @@
+Changing shell from ksh to bash between configure and libtool calls breaks
+libtool (with ksh it's configured to use ksh print builtin).
+--- stoken-0.91/Makefile.am.orig	2017-01-09 07:05:30.000000000 +0100
++++ stoken-0.91/Makefile.am	2017-02-18 20:29:24.544009782 +0100
+@@ -1,6 +1,5 @@
+ AUTOMAKE_OPTIONS	= foreign subdir-objects
+ ACLOCAL_AMFLAGS		= -I m4
+-SHELL			= /bin/bash
+ 
+ AM_CPPFLAGS		= -DDATA_DIR=\"$(datadir)\"
+ AM_CFLAGS		= $(CRYPTO_CFLAGS) $(LIBXML2_CFLAGS) $(WFLAGS)
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/stoken.git/commitdiff/6d48841e2d6e43cc9e0a21cc02152a2028ddbc84



More information about the pld-cvs-commit mailing list