enable rpm build
This commit is contained 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
|
||||
|
||||
* configure.ac: remove test output
|
||||
|
@@ -3,45 +3,46 @@
|
||||
## 1 2 3 4 5 6 7 8
|
||||
## 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:
|
||||
# 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"
|
||||
for path in . .. ../..; do
|
||||
if svn info $path 2>&1 > /dev/null; then
|
||||
SVN_REVISION=$(LANG= svn info $path | sed -n 's/Last Changed Rev: //p')
|
||||
(cd $path && svn2cl)
|
||||
break;
|
||||
fi
|
||||
done
|
||||
# Mac does not support LEAST > 255
|
||||
echo $ECHO_N $(($SVN_REVISION%256))
|
||||
))
|
||||
]))
|
||||
# define version number from subversion's revision number:
|
||||
# it is taken modulo 256 due to a bug on Apple's MacOSX
|
||||
# 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"
|
||||
for path in . .. ../..; do
|
||||
if svn info $path 2>&1 > /dev/null; then
|
||||
SVN_REVISION=$(LANG= svn info $path | sed -n 's/Last Changed Rev: //p')
|
||||
(cd $path && svn2cl)
|
||||
break;
|
||||
fi
|
||||
done
|
||||
# Mac does not support LEAST > 255
|
||||
echo $ECHO_N $((x_minor+$SVN_REVISION/256))
|
||||
))
|
||||
]))
|
||||
# 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
|
||||
))
|
||||
]))
|
||||
|
||||
## 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 | \
|
||||
sed -n 's,.*<\([-_.a-z0-9A-Z]*@[-_.a-z0-9A-Z]*\)>.*,\1,gp'
|
||||
))
|
||||
]))
|
||||
|
||||
m4_include(ax_check_qt.m4)
|
||||
|
||||
@@ -116,7 +117,7 @@ AC_DEFUN([AX_INIT_STANDARD_PROJECT], [
|
||||
esac
|
||||
AM_CONDITIONAL(MINGW, test "$MINGW" = "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(HOME)
|
||||
README=$(tail -n +3 README)
|
||||
@@ -164,7 +165,6 @@ AC_DEFUN([AX_INIT_STANDARD_PROJECT], [
|
||||
test -f makefile.in && cat >> makefile.in <<EOF
|
||||
#### Begin: Appended by $0
|
||||
EXTRA_DIST = bootstrap.sh
|
||||
doc_DATA = AUTHORS NEWS README COPYING INSTALL ChangeLog
|
||||
clean-standard-project-targets:
|
||||
-rm -rf \${PACKAGE_NAME}-\${PACKAGE_VERSION}
|
||||
-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_LDFLAGS+=' -L ${top_srcdir}/src -L ${top_builddir}/src'
|
||||
|
||||
# Get rid of that stupid -O2 -g opions!
|
||||
CXXFLAGS="${CXXFLAGS:-}"
|
||||
# Get rid of those stupid -g -O2 options!
|
||||
CXXFLAGS="${CXXFLAGS//-g -O2/}"
|
||||
CFLAGS="${CFLAGS//-g -O2/}"
|
||||
|
||||
# pass compile flags to make distcheck
|
||||
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
|
||||
AC_DEFUN([AX_USE_RPM_PACKAGING], [
|
||||
# m4_include(ax_rpm_rules.m4)
|
||||
AC_CONFIG_FILES([${PACKAGE_NAME}.spec])
|
||||
#AX_ADD_MAKEFILE_TARGET_DEP([clean-am], [clean-debian-targets], [makefile.in])
|
||||
AX_ADD_MAKEFILE_TARGET_DEP([.PHONY], [rpm], [makefile.in])
|
||||
#AX_ADD_MAKEFILE_TARGET_DEP([clean-am], [clean-rpm-targets], [makefile.in])
|
||||
AX_ADD_MAKEFILE_TARGET_DEP([distclean-am], [distclean-rpm-targets], [makefile.in])
|
||||
test -f makefile.in && cat >> makefile.in <<EOF
|
||||
#### Begin: Appended by $0
|
||||
EXTRA_DIST += \${PACKAGE_NAME}.spec.in
|
||||
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
|
||||
EOF
|
||||
])
|
||||
@@ -364,7 +367,7 @@ doc: doxyfile
|
||||
clean-documentation:
|
||||
-rm doxygen.errors @PDF_DOC@
|
||||
distclean-documentation:
|
||||
-rm -r html latex
|
||||
-rm -r html
|
||||
-rm @PACKAGE_NAME@.doxytag
|
||||
maintainer-clean-documentation:
|
||||
-rm makefile.in
|
||||
@@ -374,7 +377,7 @@ install-data-documentation:
|
||||
cp -r html \$(DESTDIR)\${docdir}/
|
||||
uninstall-documentation:
|
||||
-chmod -R u+w \$(DESTDIR)\${docdir}
|
||||
-rm -rf \$(DESTDIR)\${docdir}/*
|
||||
-rm -rf \$(DESTDIR)\${docdir}/html
|
||||
#### End: $0
|
||||
EOF
|
||||
])
|
||||
|
35
bootstrap.sh
35
bootstrap.sh
@@ -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_minor, 0) # project's minor version
|
||||
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])
|
||||
AX_INIT_STANDARD_PROJECT
|
||||
|
||||
@@ -724,7 +724,7 @@ to --condition AX_USE_RPM_PACKAGING ${PACKAGE_NAME}.spec.in <<EOF
|
||||
Summary: @DESCRIPTION@
|
||||
Name: @PACKAGE_NAME@
|
||||
Version: @VERSION@
|
||||
Release: 1
|
||||
Release: @BUILD_NUMBER@%{?dist}
|
||||
License: LGPL
|
||||
Group: $(if testtag AX_USE_LIBTOOL; then
|
||||
echo Development/Libraries/C++;
|
||||
@@ -732,17 +732,16 @@ else
|
||||
echo Applications/...;
|
||||
fi)
|
||||
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
|
||||
$(if testtag AX_USE_CPPUNIT; then
|
||||
cat <<EOF2
|
||||
%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version}
|
||||
BuildRequires: cppunit-devel
|
||||
%if 0%{?fedora} || 0%{?rhel} || 0%{?rhl} || 0%{?centos} || 0%{?centos_ver} || 0%{?centos_version}
|
||||
BuildRequires: pkgconfig, redhat-lsb$(if testtag AX_USE_CPPUNIT; then echo -n ", cppunit-devel"; fi)
|
||||
%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
|
||||
EOF2
|
||||
fi)
|
||||
%if 0%{?fedora} || 0%{?rhel} || 0%{?rhl}
|
||||
$(if testtag AX_USE_DOXYGEN; then echo -n "BuildRequires: mscgen"; fi)
|
||||
%endif
|
||||
|
||||
%description
|
||||
@README@
|
||||
@@ -754,8 +753,8 @@ fi)
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
./configure --prefix=/usr \
|
||||
--docdir=/usr/share/doc/packages/@PACKAGE_NAME@ \
|
||||
./configure --prefix=/usr \\
|
||||
--docdir=/usr/share/doc/packages/@PACKAGE_NAME@ \\
|
||||
--libdir=/usr/%_lib
|
||||
|
||||
%build
|
||||
@@ -769,9 +768,10 @@ rm -rf \$RPM_BUILD_ROOT
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
/usr/bin/*
|
||||
$(if testtag AX_USE_LIBTOOL; then
|
||||
echo '/usr/%_lib/@PACKAGE_NAME@.so.*'
|
||||
else
|
||||
/usr/bin/
|
||||
fi)
|
||||
%doc
|
||||
/usr/share/doc/packages/@PACKAGE_NAME@/AUTHORS
|
||||
@@ -784,7 +784,7 @@ fi)
|
||||
$(if testtag AX_USE_LIBTOOL; then
|
||||
cat <<EOF2
|
||||
%package devel
|
||||
Summary: C++ Wrapper around OpenSSL, PCSC and Cryptoki (development files)
|
||||
Summary: @DESCRIPTION@
|
||||
Group: Development/Libraries/C++
|
||||
Requires: @PACKAGE_NAME@ = @VERSION@
|
||||
|
||||
@@ -797,13 +797,11 @@ This Package contains all files required for developement.
|
||||
%defattr(-,root,root,-)
|
||||
/usr/%_lib/@PACKAGE_NAME@.so
|
||||
/usr/%_lib/@PACKAGE_NAME@.a
|
||||
/usr/%_lib/pkgconfig
|
||||
/usr/%_lib/@PACKAGE_NAME@.la
|
||||
/usr/%_lib/pkgconfig
|
||||
/usr/include/
|
||||
/usr/share/pkgconfig
|
||||
%doc
|
||||
/usr/share/doc/packages/@PACKAGE_NAME@/html
|
||||
/usr/share/doc/packages/@PACKAGE_NAME@/@PACKAGE_NAME@.spec
|
||||
EOF2
|
||||
fi)
|
||||
|
||||
@@ -817,6 +815,8 @@ done
|
||||
to makefile.am<<EOF
|
||||
${HEADER}SUBDIRS =${SUBDIRS}
|
||||
|
||||
doc_DATA = AUTHORS NEWS README COPYING INSTALL ChangeLog
|
||||
|
||||
MAINTAINERCLEANFILES = makefile.in
|
||||
EOF
|
||||
to --condition AX_USE_LIBTOOL src/${PACKAGE_NAME}.pc.in <<EOF
|
||||
@@ -839,6 +839,7 @@ if test -f makefile; then
|
||||
fi
|
||||
|
||||
#### Bootstrap Before Configure ####
|
||||
run --no-check svn2cl
|
||||
run aclocal
|
||||
run libtoolize --force
|
||||
run automake -a
|
||||
|
@@ -1,29 +1,30 @@
|
||||
Summary: C++ Wrapper around OpenSSL, PCSC and Cryptoki
|
||||
Summary: @DESCRIPTION@
|
||||
Name: @PACKAGE_NAME@
|
||||
Version: @VERSION@
|
||||
Release: 1
|
||||
Release: @BUILD_NUMBER@%{?dist}
|
||||
License: LGPL
|
||||
Group: Development/Libraries/C++
|
||||
URL: https://dev.marc.waeckerlin.org/projects/@PACKAGE_NAME@
|
||||
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
|
||||
%if 0%{?fedora} || 0%{?rhel_version} || 0%{?centos_version}
|
||||
BuildRequires: cppunit-devel openssl-devel
|
||||
%if 0%{?fedora} || 0%{?rhel} || 0%{?rhl} || 0%{?centos} || 0%{?centos_ver} || 0%{?centos_version}
|
||||
BuildRequires: pkgconfig, redhat-lsb
|
||||
%else%if 0%{?suse_version} || 0%{?sles_version}
|
||||
BuildRequires: libcppunit-devel libopenssl-devel
|
||||
BuildRequires: pkg-config, lsb-release
|
||||
%endif%endif
|
||||
|
||||
%if 0%{?fedora} || 0%{?rhel} || 0%{?rhl}
|
||||
BuildRequires: mscgen
|
||||
%endif
|
||||
|
||||
%description
|
||||
@README@
|
||||
|
||||
This package contains only the shared libraries required at runtime.
|
||||
|
||||
|
||||
%prep
|
||||
%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@ \
|
||||
--libdir=/usr/%_lib
|
||||
|
||||
@@ -38,7 +39,6 @@ rm -rf $RPM_BUILD_ROOT
|
||||
|
||||
%files
|
||||
%defattr(-,root,root,-)
|
||||
/usr/bin/*
|
||||
/usr/%_lib/@PACKAGE_NAME@.so.*
|
||||
%doc
|
||||
/usr/share/doc/packages/@PACKAGE_NAME@/AUTHORS
|
||||
@@ -49,7 +49,7 @@ rm -rf $RPM_BUILD_ROOT
|
||||
/usr/share/doc/packages/@PACKAGE_NAME@/README
|
||||
|
||||
%package devel
|
||||
Summary: C++ Wrapper around OpenSSL, PCSC and Cryptoki (development files)
|
||||
Summary: @DESCRIPTION@
|
||||
Group: Development/Libraries/C++
|
||||
Requires: @PACKAGE_NAME@ = @VERSION@
|
||||
|
||||
@@ -62,12 +62,11 @@ This Package contains all files required for developement.
|
||||
%defattr(-,root,root,-)
|
||||
/usr/%_lib/@PACKAGE_NAME@.so
|
||||
/usr/%_lib/@PACKAGE_NAME@.a
|
||||
/usr/%_lib/pkgconfig
|
||||
/usr/%_lib/@PACKAGE_NAME@.la
|
||||
/usr/%_lib/pkgconfig
|
||||
/usr/include/
|
||||
/usr/share/pkgconfig
|
||||
%doc
|
||||
/usr/share/doc/packages/@PACKAGE_NAME@/html
|
||||
/usr/share/doc/packages/@PACKAGE_NAME@/@PACKAGE_NAME@.spec
|
||||
|
||||
%changelog
|
||||
|
||||
|
Reference in New Issue
Block a user