@@ -5,22 +5,21 @@ Summary: Smart card library and applications
55
66License: LGPL-2.1 -or-later AND BSD-3-Clause
77URL: https://github.com/OpenSC/OpenSC/wiki
8- Source0: https://github.com/OpenSC/OpenSC/releases/download/%{version }/%{name }-%{version }.tar.gz
9- Source1: opensc.module
8+ Source0: https://github.com/OpenSC/OpenSC/releases/download/%{version }/%{name }-%{version }.tar.xz
109
1110BuildRequires: make
1211BuildRequires: pcsc-lite-devel
1312BuildRequires: readline-devel
1413BuildRequires: openssl-devel
1514BuildRequires: /usr/bin/xsltproc
1615BuildRequires: docbook-style-xsl
17- BuildRequires: autoconf automake libtool gcc
16+ BuildRequires: meson gcc
1817%if 0%{?fedora } || 0%{?rhel } > 10
1918BuildRequires: bash-completion-devel
2019%else
2120BuildRequires: bash-completion
2221%endif
23- BuildRequires: zlib-ng-devel
22+ BuildRequires: zlib-ng-compat- devel
2423BuildRequires: p11-kit-devel
2524# For tests
2625BuildRequires: libcmocka-devel
@@ -77,67 +76,45 @@ cp -p src/scconf/README.scconf .
7776# No {_libdir} here to avoid multilib conflicts; it's just an example
7877sed -i -e 's|/usr/local /towitoko/lib/|/usr/lib/ctapi/|' etc/opensc.conf.example.in
7978
80-
81- %build
82- autoreconf -fvi
83- %ifarch %{ix86 }
84- sed -i -e ' s/opensc.conf/opensc-%{_arch}.conf/g' src/libopensc/Makefile.in
79+ %conf
80+ %meson -Dopenssl= enabled \
81+ %if ! 0%{?rhel }
82+ -Dopenpace= enabled \
8583%endif
86- sed -i -e ' s|"/lib /usr/lib\b|"/%{_lib} %{_libdir}|' configure # lib64 rpaths
87- %set_build_flags
88- CFLAGS=" $CFLAGS -Wstrict-aliasing=2 -Wno-deprecated-declarations"
89- %configure --disable-static \
90- --disable-autostart-items \
91- --disable-notify \
92- --disable-assert \
93- --enable-pcsc \
94- --enable-cmocka \
95- --enable-sm
96- %make_build
84+ -Dreadline= enabled \
85+ -Dzlib= enabled \
86+ -Dtests= true \
87+ -Ddriver= pcsc \
88+ -Ddoc= true \
89+ -Dman= true
9790
91+ %build
92+ %meson_build
9893
9994%check
100- make check || (cat tests/* .log src/tests/unittests/* .log && exit 1)
101-
95+ %meson_test
10296
10397%install
104- %make_install
105- install -Dpm 644 %{SOURCE1 } $RPM_BUILD_ROOT %{_datadir }/p11-kit/modules/opensc.module
106-
107- %ifarch %{ix86 }
108- # To avoid multilib issues, move these files on 32b intel architectures
109- rm -f $RPM_BUILD_ROOT%{_sysconfdir }/opensc.conf
110- install -Dpm 644 etc/opensc.conf $RPM_BUILD_ROOT%{_sysconfdir }/opensc-%{_arch }.conf
111- rm -f $RPM_BUILD_ROOT%{_mandir }/man5/opensc.conf.5
112- install -Dpm 644 doc/files/opensc.conf.5 $RPM_BUILD_ROOT%{_mandir }/man5/opensc-%{_arch }.conf.5
113- # use NEWS file timestamp as reference for configuration file
114- touch -r NEWS $RPM_BUILD_ROOT%{_sysconfdir }/opensc-%{_arch }.conf
115- touch -r NEWS $RPM_BUILD_ROOT%{_mandir }/man5/opensc-%{_arch }.conf.5
116- %else
117- # For backward compatibility, symlink the old location to the new files
118- ln -s %{_sysconfdir }/opensc.conf $RPM_BUILD_ROOT%{_sysconfdir }/opensc-%{_arch }.conf
119- %endif
120-
121- find $RPM_BUILD_ROOT%{_libdir } -type f -name "*.la" | xargs rm
98+ %meson_install
12299
123100rm -rf $RPM_BUILD_ROOT%{_datadir }/doc/opensc
124101
125102# Upstream considers libopensc API internal and no longer ships
126103# public headers and pkgconfig files.
127104# Remove the symlink as nothing is supposed to link against libopensc.
128- rm -f $RPM_BUILD_ROOT%{_libdir }/libopensc.so
105+ rm $RPM_BUILD_ROOT%{_libdir }/libopensc.so
129106# remove the .pc file so we do not confuse users #1673139
130- rm -f $RPM_BUILD_ROOT%{_libdir }/pkgconfig/*.pc
131- rm -f $RPM_BUILD_ROOT%{_libdir }/libsmm-local .so
107+ rm $RPM_BUILD_ROOT%{_libdir }/pkgconfig/*.pc
108+ rm $RPM_BUILD_ROOT%{_libdir }/libsmm-local .so
132109
133110%if 0%{?rhel }
134- rm -rf %{buildroot }%{_bindir }/npa-tool
135- rm -rf %{buildroot }%{_mandir }/man1/npa-tool.1*
111+ rm %{buildroot }%{_bindir }/npa-tool
112+ rm %{buildroot }%{_mandir }/man1/npa-tool.1*
136113%endif
137114
138115# the pkcs11-register is not applicable to Fedora/RHEL where we use p11-kit
139- rm -rf %{buildroot }%{_bindir }/pkcs11-register
140- rm -rf %{buildroot }%{_mandir }/man1/pkcs11-register.1*
116+ rm %{buildroot }%{_bindir }/pkcs11-register
117+ rm %{buildroot }%{_mandir }/man1/pkcs11-register.1*
141118
142119# Remove the notification files
143120rm %{buildroot }%{_datadir }/applications/org.opensc.notify.desktop
0 commit comments