enable rpm build

master
Marc Wäckerlin 9 years ago
parent 8dc609f5ca
commit fc1a2168a1
  1. 5
      ChangeLog
  2. 43
      ax_init_standard_project.m4
  3. 35
      bootstrap.sh
  4. 29
      libpcscxx.spec.in

@ -1,3 +1,8 @@
2015-07-27 08:35 marc
* ChangeLog, ax_check_qt.m4, ax_init_standard_project.m4,
bootstrap.sh: better check for header
2015-07-27 06:33 marc 2015-07-27 06:33 marc
* configure.ac: remove test output * configure.ac: remove test output

@ -3,45 +3,46 @@
## 1 2 3 4 5 6 7 8 ## 1 2 3 4 5 6 7 8
## 45678901234567890123456789012345678901234567890123456789012345678901234567890 ## 45678901234567890123456789012345678901234567890123456789012345678901234567890
# m4_esyscmd_s does not exist on centos 5 and 6
m4_define([mrw_esyscmd_s], [m4_normalize(m4_esyscmd([$1]))])
# define least version number from subversion's revision number: # define least version number from subversion's revision number:
# it is taken modulo 256 due to a bug on Apple's MacOSX # it is taken modulo 256 due to a bug on Apple's MacOSX
m4_define(x_least, m4_esyscmd_s( m4_define(x_least, mrw_esyscmd_s([
SVN_REVISION="ERROR-UNDEFINED-REVISION-to-be-built-in-subdirectory-of-svn-checkout" SVN_REVISION="ERROR-UNDEFINED-REVISION-to-be-built-in-subdirectory-of-svn-checkout"
for path in . .. ../..; do for path in . .. ../..; do
if svn info $path 2>&1 > /dev/null; then if svn info $path 2>&1 > /dev/null; then
SVN_REVISION=$(LANG= svn info $path | sed -n 's/Last Changed Rev: //p') SVN_REVISION=$(LANG= svn info $path | sed -n 's/Last Changed Rev: //p')
(cd $path && svn2cl)
break; break;
fi fi
done done
# Mac does not support LEAST > 255 # Mac does not support LEAST > 255
echo $ECHO_N $(($SVN_REVISION%256)) echo $ECHO_N $(($SVN_REVISION%256))
)) ]))
# define version number from subversion's revision number: # define version number from subversion's revision number:
# it is taken modulo 256 due to a bug on Apple's MacOSX # it is taken modulo 256 due to a bug on Apple's MacOSX
# add to x_minor if revision number is > 256 # add to x_minor if revision number is > 256
m4_define(x_minor_fixed, m4_esyscmd_s( m4_define(x_minor_fixed, mrw_esyscmd_s([
SVN_REVISION="ERROR-UNDEFINED-REVISION-to-be-built-in-subdirectory-of-svn-checkout" SVN_REVISION="ERROR-UNDEFINED-REVISION-to-be-built-in-subdirectory-of-svn-checkout"
for path in . .. ../..; do for path in . .. ../..; do
if svn info $path 2>&1 > /dev/null; then if svn info $path 2>&1 > /dev/null; then
SVN_REVISION=$(LANG= svn info $path | sed -n 's/Last Changed Rev: //p') SVN_REVISION=$(LANG= svn info $path | sed -n 's/Last Changed Rev: //p')
(cd $path && svn2cl)
break; break;
fi fi
done done
# Mac does not support LEAST > 255 # Mac does not support LEAST > 255
echo $ECHO_N $((x_minor+$SVN_REVISION/256)) echo $ECHO_N $((x_minor+$SVN_REVISION/256))
)) ]))
# setup version number # setup version number
m4_define(x_version, m4_esyscmd_s( m4_define(x_version, mrw_esyscmd_s([
echo $ECHO_N x_major.x_minor_fixed.x_least echo $ECHO_N x_major.x_minor_fixed.x_least
)) ]))
## bugreport mail address is taken from <user@host> in first line of AUTHORS ## bugreport mail address is taken from <user@host> in first line of AUTHORS
m4_define(x_bugreport, m4_esyscmd_s( m4_define(x_bugreport, mrw_esyscmd_s([
head -1 AUTHORS | \ head -1 AUTHORS | \
sed -n 's,.*<\([-_.a-z0-9A-Z]*@[-_.a-z0-9A-Z]*\)>.*,\1,gp' sed -n 's,.*<\([-_.a-z0-9A-Z]*@[-_.a-z0-9A-Z]*\)>.*,\1,gp'
)) ]))
m4_include(ax_check_qt.m4) m4_include(ax_check_qt.m4)
@ -116,7 +117,7 @@ AC_DEFUN([AX_INIT_STANDARD_PROJECT], [
esac esac
AM_CONDITIONAL(MINGW, test "$MINGW" = "yes") AM_CONDITIONAL(MINGW, test "$MINGW" = "yes")
AM_CONDITIONAL(MAC, test "$MAC" = "yes") AM_CONDITIONAL(MAC, test "$MAC" = "yes")
AM_CPPFLAGS+=" '-DMAKE_STRING(X)=\#X' '-DNAMESPACE=${PACKAGE_NAME//-/_}'" AM_CPPFLAGS+=" '-DMAKE_STRING(X)=\#X' '-DNAMESPACE=${PACKAGE_TARNAME//[^a-zA-Z0-9]/_}'"
AX_SUBST(NUMBERS) AX_SUBST(NUMBERS)
AX_SUBST(HOME) AX_SUBST(HOME)
README=$(tail -n +3 README) README=$(tail -n +3 README)
@ -164,7 +165,6 @@ AC_DEFUN([AX_INIT_STANDARD_PROJECT], [
test -f makefile.in && cat >> makefile.in <<EOF test -f makefile.in && cat >> makefile.in <<EOF
#### Begin: Appended by $0 #### Begin: Appended by $0
EXTRA_DIST = bootstrap.sh EXTRA_DIST = bootstrap.sh
doc_DATA = AUTHORS NEWS README COPYING INSTALL ChangeLog
clean-standard-project-targets: clean-standard-project-targets:
-rm -rf \${PACKAGE_NAME}-\${PACKAGE_VERSION} -rm -rf \${PACKAGE_NAME}-\${PACKAGE_VERSION}
-rm \${PACKAGE_TARNAME}-\${PACKAGE_VERSION}.tar.gz -rm \${PACKAGE_TARNAME}-\${PACKAGE_VERSION}.tar.gz
@ -190,8 +190,9 @@ AC_DEFUN([AX_USE_CXX], [
AM_CPPFLAGS+=' -I ${top_srcdir}/src -I ${top_builddir}/src -I ${srcdir} -I ${builddir}' AM_CPPFLAGS+=' -I ${top_srcdir}/src -I ${top_builddir}/src -I ${srcdir} -I ${builddir}'
AM_LDFLAGS+=' -L ${top_srcdir}/src -L ${top_builddir}/src' AM_LDFLAGS+=' -L ${top_srcdir}/src -L ${top_builddir}/src'
# Get rid of that stupid -O2 -g opions! # Get rid of those stupid -g -O2 options!
CXXFLAGS="${CXXFLAGS:-}" CXXFLAGS="${CXXFLAGS//-g -O2/}"
CFLAGS="${CFLAGS//-g -O2/}"
# pass compile flags to make distcheck # pass compile flags to make distcheck
AM_DISTCHECK_CONFIGURE_FLAGS="CXXFLAGS='${CXXFLAGS}' CPPFLAGS='${CPPFLAGS}' CFLAGS='${CFLAGS}' LDFLAGS='${LDFLAGS}'" AM_DISTCHECK_CONFIGURE_FLAGS="CXXFLAGS='${CXXFLAGS}' CPPFLAGS='${CPPFLAGS}' CFLAGS='${CFLAGS}' LDFLAGS='${LDFLAGS}'"
@ -311,14 +312,16 @@ EOF
# use this in configure.ac to support RPM packages # use this in configure.ac to support RPM packages
AC_DEFUN([AX_USE_RPM_PACKAGING], [ AC_DEFUN([AX_USE_RPM_PACKAGING], [
# m4_include(ax_rpm_rules.m4)
AC_CONFIG_FILES([${PACKAGE_NAME}.spec]) AC_CONFIG_FILES([${PACKAGE_NAME}.spec])
#AX_ADD_MAKEFILE_TARGET_DEP([clean-am], [clean-debian-targets], [makefile.in]) #AX_ADD_MAKEFILE_TARGET_DEP([clean-am], [clean-rpm-targets], [makefile.in])
AX_ADD_MAKEFILE_TARGET_DEP([.PHONY], [rpm], [makefile.in]) AX_ADD_MAKEFILE_TARGET_DEP([distclean-am], [distclean-rpm-targets], [makefile.in])
test -f makefile.in && cat >> makefile.in <<EOF test -f makefile.in && cat >> makefile.in <<EOF
#### Begin: Appended by $0 #### Begin: Appended by $0
EXTRA_DIST += \${PACKAGE_NAME}.spec.in
rpm: dist rpm: dist
rpmbuild -ba --define "_topdir \$(pwd)" --define "_sourcedir \$(pwd)" \${PACKAGE_NAME}.spec rpmbuild -ba --define "_topdir \$\$(pwd)" --define "_sourcedir \$\$(pwd)" \${PACKAGE_NAME}.spec
distclean-rpm-targets:
-rm \${PACKAGE_NAME}.spec
#### End: $0 #### End: $0
EOF EOF
]) ])
@ -364,7 +367,7 @@ doc: doxyfile
clean-documentation: clean-documentation:
-rm doxygen.errors @PDF_DOC@ -rm doxygen.errors @PDF_DOC@
distclean-documentation: distclean-documentation:
-rm -r html latex -rm -r html
-rm @PACKAGE_NAME@.doxytag -rm @PACKAGE_NAME@.doxytag
maintainer-clean-documentation: maintainer-clean-documentation:
-rm makefile.in -rm makefile.in
@ -374,7 +377,7 @@ install-data-documentation:
cp -r html \$(DESTDIR)\${docdir}/ cp -r html \$(DESTDIR)\${docdir}/
uninstall-documentation: uninstall-documentation:
-chmod -R u+w \$(DESTDIR)\${docdir} -chmod -R u+w \$(DESTDIR)\${docdir}
-rm -rf \$(DESTDIR)\${docdir}/* -rm -rf \$(DESTDIR)\${docdir}/html
#### End: $0 #### End: $0
EOF EOF
]) ])

@ -391,7 +391,7 @@ ${HEADER}m4_define(x_package_name, ${DEFAULT_PROJECT_NAME}) # project's name
m4_define(x_major, 0) # project's major version m4_define(x_major, 0) # project's major version
m4_define(x_minor, 0) # project's minor version m4_define(x_minor, 0) # project's minor version
m4_include(ax_init_standard_project.m4) m4_include(ax_init_standard_project.m4)
AC_INIT(x_package_name, x_version, x_package_name) AC_INIT(x_package_name, x_version, x_bugreport, x_package_name)
AM_INIT_AUTOMAKE([1.9 tar-pax]) AM_INIT_AUTOMAKE([1.9 tar-pax])
AX_INIT_STANDARD_PROJECT AX_INIT_STANDARD_PROJECT
@ -724,7 +724,7 @@ to --condition AX_USE_RPM_PACKAGING ${PACKAGE_NAME}.spec.in <<EOF
Summary: @DESCRIPTION@ Summary: @DESCRIPTION@
Name: @PACKAGE_NAME@ Name: @PACKAGE_NAME@
Version: @VERSION@ Version: @VERSION@
Release: 1 Release: @BUILD_NUMBER@%{?dist}
License: LGPL License: LGPL
Group: $(if testtag AX_USE_LIBTOOL; then Group: $(if testtag AX_USE_LIBTOOL; then
echo Development/Libraries/C++; echo Development/Libraries/C++;
@ -732,17 +732,16 @@ else
echo Applications/...; echo Applications/...;
fi) fi)
Source0: %{name}-%{version}.tar.gz Source0: %{name}-%{version}.tar.gz
BuildRequires: pkg-config, subversion, autotools-devel, lsb-release $(if testtag AX_USE_DOXYGEN; then echo -n ", doxygen, graphviz, mscgen"; fi; if testtag AX_CXX_QT || testtag AX_CXX_CHECK_QT; then echo -n ", qtbase5-devel | libqt4-devel, qtbase5-devel-tools | qt4-devel-tools"; fi) BuildRequires: gnupg, subversion, automake, autoconf $(if testtag AX_USE_DOXYGEN; then echo -n ", doxygen, graphviz"; fi; if testtag AX_CXX_QT || testtag AX_CXX_CHECK_QT; then echo -n ", qtbase5-devel | libqt4-devel, qtbase5-devel-tools | qt4-devel-tools"; fi)
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
$(if testtag AX_USE_CPPUNIT; then %if 0%{?fedora} || 0%{?rhel} || 0%{?rhl} || 0%{?centos} || 0%{?centos_ver} || 0%{?centos_version}
cat <<EOF2 BuildRequires: pkgconfig, redhat-lsb$(if testtag AX_USE_CPPUNIT; then echo -n ", cppunit-devel"; fi)
%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version}
BuildRequires: cppunit-devel
%else%if 0%{?suse_version} || 0%{?sles_version} %else%if 0%{?suse_version} || 0%{?sles_version}
BuildRequires: libcppunit-devel BuildRequires: pkg-config, lsb-release$(if testtag AX_USE_CPPUNIT; then echo -n ", libcppunit-devel"; fi)
%endif%endif %endif%endif
EOF2 %if 0%{?fedora} || 0%{?rhel} || 0%{?rhl}
fi) $(if testtag AX_USE_DOXYGEN; then echo -n "BuildRequires: mscgen"; fi)
%endif
%description %description
@README@ @README@
@ -754,8 +753,8 @@ fi)
%prep %prep
%setup -q %setup -q
./configure --prefix=/usr \ ./configure --prefix=/usr \\
--docdir=/usr/share/doc/packages/@PACKAGE_NAME@ \ --docdir=/usr/share/doc/packages/@PACKAGE_NAME@ \\
--libdir=/usr/%_lib --libdir=/usr/%_lib
%build %build
@ -769,9 +768,10 @@ rm -rf \$RPM_BUILD_ROOT
%files %files
%defattr(-,root,root,-) %defattr(-,root,root,-)
/usr/bin/*
$(if testtag AX_USE_LIBTOOL; then $(if testtag AX_USE_LIBTOOL; then
echo '/usr/%_lib/@PACKAGE_NAME@.so.*' echo '/usr/%_lib/@PACKAGE_NAME@.so.*'
else
/usr/bin/
fi) fi)
%doc %doc
/usr/share/doc/packages/@PACKAGE_NAME@/AUTHORS /usr/share/doc/packages/@PACKAGE_NAME@/AUTHORS
@ -784,7 +784,7 @@ fi)
$(if testtag AX_USE_LIBTOOL; then $(if testtag AX_USE_LIBTOOL; then
cat <<EOF2 cat <<EOF2
%package devel %package devel
Summary: C++ Wrapper around OpenSSL, PCSC and Cryptoki (development files) Summary: @DESCRIPTION@
Group: Development/Libraries/C++ Group: Development/Libraries/C++
Requires: @PACKAGE_NAME@ = @VERSION@ Requires: @PACKAGE_NAME@ = @VERSION@
@ -797,13 +797,11 @@ This Package contains all files required for developement.
%defattr(-,root,root,-) %defattr(-,root,root,-)
/usr/%_lib/@PACKAGE_NAME@.so /usr/%_lib/@PACKAGE_NAME@.so
/usr/%_lib/@PACKAGE_NAME@.a /usr/%_lib/@PACKAGE_NAME@.a
/usr/%_lib/pkgconfig
/usr/%_lib/@PACKAGE_NAME@.la /usr/%_lib/@PACKAGE_NAME@.la
/usr/%_lib/pkgconfig
/usr/include/ /usr/include/
/usr/share/pkgconfig
%doc %doc
/usr/share/doc/packages/@PACKAGE_NAME@/html /usr/share/doc/packages/@PACKAGE_NAME@/html
/usr/share/doc/packages/@PACKAGE_NAME@/@PACKAGE_NAME@.spec
EOF2 EOF2
fi) fi)
@ -817,6 +815,8 @@ done
to makefile.am<<EOF to makefile.am<<EOF
${HEADER}SUBDIRS =${SUBDIRS} ${HEADER}SUBDIRS =${SUBDIRS}
doc_DATA = AUTHORS NEWS README COPYING INSTALL ChangeLog
MAINTAINERCLEANFILES = makefile.in MAINTAINERCLEANFILES = makefile.in
EOF EOF
to --condition AX_USE_LIBTOOL src/${PACKAGE_NAME}.pc.in <<EOF to --condition AX_USE_LIBTOOL src/${PACKAGE_NAME}.pc.in <<EOF
@ -839,6 +839,7 @@ if test -f makefile; then
fi fi
#### Bootstrap Before Configure #### #### Bootstrap Before Configure ####
run --no-check svn2cl
run aclocal run aclocal
run libtoolize --force run libtoolize --force
run automake -a run automake -a

@ -1,29 +1,30 @@
Summary: C++ Wrapper around OpenSSL, PCSC and Cryptoki Summary: @DESCRIPTION@
Name: @PACKAGE_NAME@ Name: @PACKAGE_NAME@
Version: @VERSION@ Version: @VERSION@
Release: 1 Release: @BUILD_NUMBER@%{?dist}
License: LGPL License: LGPL
Group: Development/Libraries/C++ Group: Development/Libraries/C++
URL: https://dev.marc.waeckerlin.org/projects/@PACKAGE_NAME@
Source0: %{name}-%{version}.tar.gz Source0: %{name}-%{version}.tar.gz
BuildRequires: subversion gcc-c++ doxygen graphviz texlive automake autoconf libtool make pcsc-lite-devel BuildRequires: gnupg, subversion, automake, autoconf , doxygen, graphviz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version} %if 0%{?fedora} || 0%{?rhel} || 0%{?rhl} || 0%{?centos} || 0%{?centos_ver} || 0%{?centos_version}
BuildRequires: cppunit-devel openssl-devel BuildRequires: pkgconfig, redhat-lsb
%else%if 0%{?suse_version} || 0%{?sles_version} %else%if 0%{?suse_version} || 0%{?sles_version}
BuildRequires: libcppunit-devel libopenssl-devel BuildRequires: pkg-config, lsb-release
%endif%endif %endif%endif
%if 0%{?fedora} || 0%{?rhel} || 0%{?rhl}
BuildRequires: mscgen
%endif
%description %description
@README@ @README@
This package contains only the shared libraries required at runtime. This package contains only the shared libraries required at runtime.
%prep %prep
%setup -q %setup -q
CPPFLAGS="-std=c++0x -I/usr/include/PCSC -I/usr/include/pkcs11-helper-1.0" \ ./configure --prefix=/usr \
./configure --prefix=/usr \
--docdir=/usr/share/doc/packages/@PACKAGE_NAME@ \ --docdir=/usr/share/doc/packages/@PACKAGE_NAME@ \
--libdir=/usr/%_lib --libdir=/usr/%_lib
@ -38,7 +39,6 @@ rm -rf $RPM_BUILD_ROOT
%files %files
%defattr(-,root,root,-) %defattr(-,root,root,-)
/usr/bin/*
/usr/%_lib/@PACKAGE_NAME@.so.* /usr/%_lib/@PACKAGE_NAME@.so.*
%doc %doc
/usr/share/doc/packages/@PACKAGE_NAME@/AUTHORS /usr/share/doc/packages/@PACKAGE_NAME@/AUTHORS
@ -49,7 +49,7 @@ rm -rf $RPM_BUILD_ROOT
/usr/share/doc/packages/@PACKAGE_NAME@/README /usr/share/doc/packages/@PACKAGE_NAME@/README
%package devel %package devel
Summary: C++ Wrapper around OpenSSL, PCSC and Cryptoki (development files) Summary: @DESCRIPTION@
Group: Development/Libraries/C++ Group: Development/Libraries/C++
Requires: @PACKAGE_NAME@ = @VERSION@ Requires: @PACKAGE_NAME@ = @VERSION@
@ -62,12 +62,11 @@ This Package contains all files required for developement.
%defattr(-,root,root,-) %defattr(-,root,root,-)
/usr/%_lib/@PACKAGE_NAME@.so /usr/%_lib/@PACKAGE_NAME@.so
/usr/%_lib/@PACKAGE_NAME@.a /usr/%_lib/@PACKAGE_NAME@.a
/usr/%_lib/pkgconfig
/usr/%_lib/@PACKAGE_NAME@.la /usr/%_lib/@PACKAGE_NAME@.la
/usr/%_lib/pkgconfig
/usr/include/ /usr/include/
/usr/share/pkgconfig
%doc %doc
/usr/share/doc/packages/@PACKAGE_NAME@/html /usr/share/doc/packages/@PACKAGE_NAME@/html
/usr/share/doc/packages/@PACKAGE_NAME@/@PACKAGE_NAME@.spec
%changelog %changelog

Loading…
Cancel
Save