Update to 1.8.2
- Drop the systemd support patches which are now upstreamed - Package the new pcsc-spay tool in -devel subpackage
This commit is contained in:
parent
58a491a615
commit
0c8cc1580f
File diff suppressed because it is too large
Load Diff
@ -1,94 +0,0 @@
|
||||
From c7f825b2c4a5c7d4ac8abe5690737c2c8fffbfcc Mon Sep 17 00:00:00 2001
|
||||
From: Kalev Lember <kalev@smartlink.ee>
|
||||
Date: Fri, 24 Jun 2011 00:46:13 +0300
|
||||
Subject: [PATCH 2/3] Add --disable-autostart option
|
||||
|
||||
This option disables pcscd autostarting code in the libpcsclite library.
|
||||
|
||||
With systemd socket activation in place, pcscd can be started
|
||||
automatically by systemd when a request arrives on the IPC socket. That
|
||||
makes starting the service as a fork from user library unnecessary.
|
||||
---
|
||||
PCSC/configure.in | 11 +++++++++++
|
||||
PCSC/src/winscard_clnt.c | 6 ++++++
|
||||
2 files changed, 17 insertions(+), 0 deletions(-)
|
||||
|
||||
diff --git a/PCSC/configure.in b/PCSC/configure.in
|
||||
index 831ee88..97e3360 100644
|
||||
--- a/PCSC/configure.in
|
||||
+++ b/PCSC/configure.in
|
||||
@@ -274,6 +274,16 @@ if test x$use_libusb = xyes; then
|
||||
PCSCLITE_FEATURES="${PCSCLITE_FEATURES} libusb"
|
||||
fi
|
||||
|
||||
+# --disable-autostart
|
||||
+AC_ARG_ENABLE(autostart,
|
||||
+ AC_HELP_STRING([--disable-autostart], [disable pcscd automatic startup]),
|
||||
+ [ use_autostart="${enableval}" ], [ use_autostart="yes" ] )
|
||||
+
|
||||
+if test x$use_autostart != xno; then
|
||||
+ AC_DEFINE(ENABLE_AUTOSTART, 1, [Enable pcscd automatic startup])
|
||||
+ PCSCLITE_FEATURES="${PCSCLITE_FEATURES} autostart"
|
||||
+fi
|
||||
+
|
||||
# --enable-embedded
|
||||
AC_ARG_ENABLE(embedded,
|
||||
AC_HELP_STRING([--enable-embedded], [limit RAM and CPU ressources by disabling features (log)]),
|
||||
@@ -381,6 +391,7 @@ ATR parsing messages: ${debugatr}
|
||||
ipcdir: ${ipcdir}
|
||||
use serial: ${use_serial}
|
||||
use usb: ${use_usb}
|
||||
+use autostart: ${use_autostart}
|
||||
|
||||
PCSCLITE_FEATURES: ${PCSCLITE_FEATURES}
|
||||
|
||||
diff --git a/PCSC/src/winscard_clnt.c b/PCSC/src/winscard_clnt.c
|
||||
index 92c8481..982be01 100644
|
||||
--- a/PCSC/src/winscard_clnt.c
|
||||
+++ b/PCSC/src/winscard_clnt.c
|
||||
@@ -444,8 +444,10 @@ LONG SCardEstablishContext(DWORD dwScope, LPCVOID pvReserved1,
|
||||
LPCVOID pvReserved2, LPSCARDCONTEXT phContext)
|
||||
{
|
||||
LONG rv;
|
||||
+#ifdef ENABLE_AUTOSTART
|
||||
int daemon_launched = FALSE;
|
||||
int retries = 0;
|
||||
+#endif
|
||||
|
||||
API_TRACE_IN("%ld, %p, %p", dwScope, pvReserved1, pvReserved2)
|
||||
PROFILE_START
|
||||
@@ -457,6 +459,7 @@ again:
|
||||
/* we reconnected to a daemon or we got called from a forked child */
|
||||
rv = SCardCheckDaemonAvailability();
|
||||
|
||||
+#ifdef ENABLE_AUTOSTART
|
||||
if (SCARD_E_NO_SERVICE == rv)
|
||||
{
|
||||
launch:
|
||||
@@ -517,6 +520,7 @@ launch:
|
||||
goto again;
|
||||
}
|
||||
}
|
||||
+#endif
|
||||
|
||||
if (rv != SCARD_S_SUCCESS)
|
||||
goto end;
|
||||
@@ -526,6 +530,7 @@ launch:
|
||||
pvReserved2, phContext);
|
||||
(void)SCardUnlockThread();
|
||||
|
||||
+#ifdef ENABLE_AUTOSTART
|
||||
/* SCardEstablishContextTH may fail if the previous pcscd crashed
|
||||
* without cleaning /var/run/pcscd/pcscd.comm */
|
||||
if (SCARD_E_NO_SERVICE == rv)
|
||||
@@ -534,6 +539,7 @@ launch:
|
||||
if (retries <= 1)
|
||||
goto launch;
|
||||
}
|
||||
+#endif
|
||||
|
||||
end:
|
||||
PROFILE_END(rv)
|
||||
--
|
||||
1.7.5.4
|
||||
|
||||
@ -1,144 +0,0 @@
|
||||
From 0f85375fd8949e529a6f46c07cdabda74040fd8a Mon Sep 17 00:00:00 2001
|
||||
From: Kalev Lember <kalev@smartlink.ee>
|
||||
Date: Fri, 24 Jun 2011 22:32:33 +0300
|
||||
Subject: [PATCH 3/3] Install systemd service files
|
||||
|
||||
---
|
||||
PCSC/Makefile.am | 5 ++++-
|
||||
PCSC/configure.in | 32 ++++++++++++++++++++++----------
|
||||
PCSC/etc/Makefile.am | 9 +++++++++
|
||||
PCSC/etc/pcscd.service.in | 13 +++++++++++++
|
||||
PCSC/etc/pcscd.socket.in | 8 ++++++++
|
||||
5 files changed, 56 insertions(+), 11 deletions(-)
|
||||
create mode 100644 PCSC/etc/Makefile.am
|
||||
create mode 100644 PCSC/etc/pcscd.service.in
|
||||
create mode 100644 PCSC/etc/pcscd.socket.in
|
||||
|
||||
diff --git a/PCSC/Makefile.am b/PCSC/Makefile.am
|
||||
index 079b58a..c515128 100644
|
||||
--- a/PCSC/Makefile.am
|
||||
+++ b/PCSC/Makefile.am
|
||||
@@ -1,10 +1,13 @@
|
||||
-SUBDIRS = m4 src doc
|
||||
+SUBDIRS = m4 src etc doc
|
||||
|
||||
fix-rights:
|
||||
$(MAKE) -C src $@
|
||||
|
||||
ACLOCAL_AMFLAGS = -I m4
|
||||
|
||||
+DISTCHECK_CONFIGURE_FLAGS = \
|
||||
+ --with-systemdsystemunitdir=$$dc_install_base/$(systemdsystemunitdir)
|
||||
+
|
||||
EXTRA_DIST = DRIVERS SECURITY bootstrap HELP ChangeLog.svn
|
||||
|
||||
DISTCLEANFILES = ChangeLog.svn
|
||||
diff --git a/PCSC/configure.in b/PCSC/configure.in
|
||||
index 97e3360..cc6fe5f 100644
|
||||
--- a/PCSC/configure.in
|
||||
+++ b/PCSC/configure.in
|
||||
@@ -274,6 +274,14 @@ if test x$use_libusb = xyes; then
|
||||
PCSCLITE_FEATURES="${PCSCLITE_FEATURES} libusb"
|
||||
fi
|
||||
|
||||
+AC_ARG_WITH([systemdsystemunitdir],
|
||||
+ AS_HELP_STRING([--with-systemdsystemunitdir=DIR], [Directory for systemd service files]),
|
||||
+ [], [with_systemdsystemunitdir=$($PKG_CONFIG --variable=systemdsystemunitdir systemd)])
|
||||
+if test "x$with_systemdsystemunitdir" != xno; then
|
||||
+ AC_SUBST([systemdsystemunitdir], [$with_systemdsystemunitdir])
|
||||
+fi
|
||||
+AM_CONDITIONAL(HAVE_SYSTEMD, [test -n "$with_systemdsystemunitdir" -a "x$with_systemdsystemunitdir" != xno ])
|
||||
+
|
||||
# --disable-autostart
|
||||
AC_ARG_ENABLE(autostart,
|
||||
AC_HELP_STRING([--disable-autostart], [disable pcscd automatic startup]),
|
||||
@@ -383,17 +391,18 @@ PTHREAD_CFLAGS: ${PTHREAD_CFLAGS}
|
||||
PTHREAD_LIBS: ${PTHREAD_LIBS}
|
||||
PCSC_ARCH: ${PCSC_ARCH}
|
||||
|
||||
-pcscd binary ${PCSCD_BINARY}
|
||||
-libudev support: ${use_libudev}
|
||||
-libusb support: ${use_libusb}
|
||||
-USB drop directory: ${usbdropdir}
|
||||
-ATR parsing messages: ${debugatr}
|
||||
-ipcdir: ${ipcdir}
|
||||
-use serial: ${use_serial}
|
||||
-use usb: ${use_usb}
|
||||
-use autostart: ${use_autostart}
|
||||
+pcscd binary ${PCSCD_BINARY}
|
||||
+libudev support: ${use_libudev}
|
||||
+libusb support: ${use_libusb}
|
||||
+USB drop directory: ${usbdropdir}
|
||||
+ATR parsing messages: ${debugatr}
|
||||
+ipcdir: ${ipcdir}
|
||||
+use serial: ${use_serial}
|
||||
+use usb: ${use_usb}
|
||||
+use autostart: ${use_autostart}
|
||||
+systemd unit directory: ${with_systemdsystemunitdir}
|
||||
|
||||
-PCSCLITE_FEATURES: ${PCSCLITE_FEATURES}
|
||||
+PCSCLITE_FEATURES: ${PCSCLITE_FEATURES}
|
||||
|
||||
EOF
|
||||
|
||||
@@ -406,6 +415,9 @@ doc/doxygen.conf
|
||||
doc/pcscd.8
|
||||
doc/reader.conf.5
|
||||
doc/example/Makefile
|
||||
+etc/Makefile
|
||||
+etc/pcscd.service
|
||||
+etc/pcscd.socket
|
||||
src/Makefile
|
||||
src/libpcsclite.pc
|
||||
src/pcscd.h
|
||||
diff --git a/PCSC/etc/Makefile.am b/PCSC/etc/Makefile.am
|
||||
new file mode 100644
|
||||
index 0000000..6ab04fc
|
||||
--- /dev/null
|
||||
+++ b/PCSC/etc/Makefile.am
|
||||
@@ -0,0 +1,9 @@
|
||||
+if HAVE_SYSTEMD
|
||||
+SCRIPT_IN_FILES = \
|
||||
+ pcscd.service.in \
|
||||
+ pcscd.socket.in
|
||||
+
|
||||
+systemdsystemunit_DATA = \
|
||||
+ pcscd.service \
|
||||
+ pcscd.socket
|
||||
+endif
|
||||
diff --git a/PCSC/etc/pcscd.service.in b/PCSC/etc/pcscd.service.in
|
||||
new file mode 100644
|
||||
index 0000000..4800d32
|
||||
--- /dev/null
|
||||
+++ b/PCSC/etc/pcscd.service.in
|
||||
@@ -0,0 +1,13 @@
|
||||
+[Unit]
|
||||
+Description=PC/SC Smart Card Daemon
|
||||
+Requires=pcscd.socket
|
||||
+After=syslog.target
|
||||
+
|
||||
+[Service]
|
||||
+ExecStart=@sbindir_exp@/pcscd -f
|
||||
+ExecReload=@sbindir_exp@/pcscd -H
|
||||
+StandardOutput=syslog
|
||||
+
|
||||
+[Install]
|
||||
+WantedBy=multi-user.target
|
||||
+Also=pcscd.socket
|
||||
diff --git a/PCSC/etc/pcscd.socket.in b/PCSC/etc/pcscd.socket.in
|
||||
new file mode 100644
|
||||
index 0000000..6fc93da
|
||||
--- /dev/null
|
||||
+++ b/PCSC/etc/pcscd.socket.in
|
||||
@@ -0,0 +1,8 @@
|
||||
+[Unit]
|
||||
+Description=PC/SC Smart Card Daemon Activation Socket
|
||||
+
|
||||
+[Socket]
|
||||
+ListenStream=@ipcdir@/pcscd.comm
|
||||
+
|
||||
+[Install]
|
||||
+WantedBy=sockets.target
|
||||
--
|
||||
1.7.5.4
|
||||
|
||||
@ -1,21 +1,15 @@
|
||||
%global upstream_build 3598
|
||||
%global upstream_build 3695
|
||||
|
||||
Name: pcsc-lite
|
||||
Version: 1.7.4
|
||||
Release: 7%{?dist}
|
||||
Version: 1.8.2
|
||||
Release: 1%{?dist}
|
||||
Summary: PC/SC Lite smart card framework and applications
|
||||
|
||||
Group: System Environment/Daemons
|
||||
License: BSD
|
||||
URL: http://pcsclite.alioth.debian.org/
|
||||
Source0: http://alioth.debian.org/download.php/%{upstream_build}/%{name}-%{version}.tar.bz2
|
||||
# Patches for systemd support
|
||||
# http://archives.neohapsis.com/archives/dev/muscle/2011-q2/0138.html
|
||||
Patch0: 0001-Support-systemd-socket-activation.patch
|
||||
Patch1: 0002-Add-disable-autostart-option.patch
|
||||
Patch2: 0003-Install-systemd-service-files.patch
|
||||
|
||||
BuildRequires: automake libtool
|
||||
BuildRequires: libudev-devel
|
||||
BuildRequires: doxygen
|
||||
BuildRequires: graphviz
|
||||
@ -64,11 +58,6 @@ Requires: %{name}-libs = %{version}-%{release}
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch0 -p2 -b .socket_activation
|
||||
%patch1 -p2 -b .noautostart
|
||||
%patch2 -p2 -b .service_files
|
||||
|
||||
autoreconf -f
|
||||
|
||||
# Convert to utf-8
|
||||
for file in ChangeLog; do
|
||||
@ -81,7 +70,6 @@ done
|
||||
%build
|
||||
%configure \
|
||||
--disable-static \
|
||||
--disable-autostart \
|
||||
--enable-usbdropdir=%{_libdir}/pcsc/drivers
|
||||
make %{?_smp_mflags}
|
||||
doxygen doc/doxygen.conf ; rm -f doc/api/*.{map,md5}
|
||||
@ -161,15 +149,23 @@ fi
|
||||
%{_libdir}/libpcsclite.so.*
|
||||
|
||||
%files devel
|
||||
%{_bindir}/pcsc-spy
|
||||
%{_includedir}/PCSC/
|
||||
%{_libdir}/libpcsclite.so
|
||||
%{_libdir}/libpcscspy.so*
|
||||
%{_libdir}/pkgconfig/libpcsclite.pc
|
||||
%{_mandir}/man1/pcsc-spy.1*
|
||||
|
||||
%files doc
|
||||
%doc doc/api/ doc/example/pcsc_demo.c
|
||||
|
||||
|
||||
%changelog
|
||||
* Mon Feb 06 2012 Kalev Lember <kalevlember@gmail.com> - 1.8.2-1
|
||||
- Update to 1.8.2
|
||||
- Drop the systemd support patches which are now upstreamed
|
||||
- Package the new pcsc-spay tool in -devel subpackage
|
||||
|
||||
* Fri Jan 13 2012 Fedora Release Engineering <rel-eng@lists.fedoraproject.org> - 1.7.4-7
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_17_Mass_Rebuild
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user