new make target rpm; builds versionnumber; closes #1

master
Marc Wäckerlin 13 years ago
parent 8fc790f8be
commit b593a5d0b1
  1. 42
      configure.in
  2. 10
      doc/examples/makefile.am
  3. 23
      doc/makefile.am
  4. 66
      libpcscxx.spec.in
  5. 30
      makefile.am
  6. 15
      src/makefile.am

@ -1,4 +1,19 @@
# $Id$
AC_ALIAS([AC_DEFINE_DIR], [AX_DEFINE_DIR])
AC_DEFUN([AX_DEFINE_DIR], [
prefix_NONE=
exec_prefix_NONE=
test "x$prefix" = xNONE && prefix_NONE=yes && prefix=$ac_default_prefix
test "x$exec_prefix" = xNONE && exec_prefix_NONE=yes && exec_prefix=$prefix
dnl In Autoconf 2.60, ${datadir} refers to ${datarootdir}, which in turn
dnl refers to ${prefix}. Thus we have to use `eval' twice.
eval ax_define_dir="\"[$]$2\""
eval ax_define_dir="\"$ax_define_dir\""
AC_SUBST($1, "$ax_define_dir")
AC_DEFINE_UNQUOTED($1, "$ax_define_dir", [$3])
test "$prefix_NONE" && prefix=NONE
test "$exec_prefix_NONE" && exec_prefix=NONE
])
AC_INIT([README])
SRC_DIR=src
@ -11,29 +26,35 @@ m4_define(x_minor, 0)
PACKAGENAME=x_packagename
MAJOR=x_major
MINOR=x_minor
LEAST="ERROR-UNDEFINED-REVISION-to-be-built-in-subdirectory-of-svn-checkout"
for path in . .. ../..; do
if svn info $path 2>&1 > /dev/null; then
BUILDDATE=$(date "+%d.%m.%Y/%H.%M")
if svn info . 2>&1 > /dev/null; then
LEAST=$(LANG= svn info $path | sed -n 's/Revision: //p')
break;
else
LEAST=[$(pwd | sed -n 's,^.*/'${PACKAGENAME}'-'${MAJOR}'\.'${MINOR}'\.\([0-9]*\).*$,\1,p')]
if test -z "${LEAST}"; then
LEAST="ERROR CANNOT DETERMINE REVISION NUMBER from $(pwd)"
fi
done
fi
AM_INIT_AUTOMAKE($PACKAGENAME, $MAJOR.$MINOR.$LEAST, [marc@waeckerlin.org])
# files to create
AC_CONFIG_FILES([makefile
AC_CONFIG_FILES([makefile ${PACKAGENAME}.spec
src/makefile
doc/doxyfile doc/examples/makefile doc/makefile
src/libpcscxx.pc debian/changelog])
src/${PACKAGENAME}.pc debian/changelog])
# copy M4 to shell
AC_SUBST(MAJOR)
AC_SUBST(MINOR)
AC_SUBST(LEAST)
AC_SUBST(BUILDDATE)
# libtool versioning
LIB_MAJOR=m4_eval(x_major+x_minor)
LIB_MINOR=$LEAST
LIB_MINOR=${LEAST}
LIB_LEAST=x_minor
LIB_VERSION="${LIB_MAJOR}:${LIB_MINOR}:${LIB_LEAST}"
AC_SUBST(LIB_VERSION)
@ -41,6 +62,10 @@ AC_SUBST(LIB_VERSION)
# home
AC_SUBST(HOME)
# datadir for languages
AX_DEFINE_DIR([DATADIR], [datadir])
#AC_SUBST(DATADIR)
# macros
README=README
AC_SUBST_FILE(README)
@ -64,6 +89,7 @@ AC_PROG_MAKE_SET
AC_PROG_LIBTOOL
AC_CHECK_PROG(have_doxygen, doxygen, yes, no)
AC_CHECK_PROG(have_dot, dot, yes, no)
PKG_PROG_PKG_CONFIG
AC_ARG_ENABLE(pedantic,
[AS_HELP_STRING([--enable-pedantic],
@ -101,8 +127,6 @@ AC_SUBST(PACKAGENAME)
AC_SUBST(AM_CXXFLAGS)
AC_SUBST(AM_CPPFLAGS)
AC_SUBST(LIBS)
AC_SUBST(QMAKE)
AC_SUBST(QMAKE_OPTIONS)
# create output
AC_OUTPUT

@ -31,13 +31,13 @@ endif
pcsc_demo_SOURCES = pcsc-demo.cxx
pcsc_demo_LDFLAGS = -L${top_builddir}/src
pcsc_demo_LDADD = -lcryptoki++
pcsc_demo_LDADD = -lpcscxx
if MINGW32
pcsc_demo_LDADD += /opt/local/i586-mingw32msvc/lib/winscard.a
endif
cryptoki_demo_SOURCES = cryptoki-demo.cxx
cryptoki_demo_LDADD = -lcryptoki++
cryptoki_demo_LDADD = -lpcscxx
cryptoki_demo_LDFLAGS = -L${top_builddir}/src
if MINGW32
cryptoki_demo_LDADD += -leay32
@ -45,21 +45,21 @@ endif
openssl_tcp_demo_SOURCES = openssl-tcp-demo.cxx
openssl_tcp_demo_LDFLAGS = -L${top_builddir}/src
openssl_tcp_demo_LDADD = -lcryptoki++
openssl_tcp_demo_LDADD = -lpcscxx
if MINGW32
openssl_tcp_demo_LDADD += /opt/local/i586-mingw32msvc/lib/ssleay32.a /opt/local/i586-mingw32msvc/lib/libeay32.a
endif
openssl_ssl_demo_SOURCES = openssl-ssl-demo.cxx
openssl_ssl_demo_LDFLAGS = -L${top_builddir}/src
openssl_ssl_demo_LDADD = -lcryptoki++
openssl_ssl_demo_LDADD = -lpcscxx
if MINGW32
openssl_ssl_demo_LDADD += /opt/local/i586-mingw32msvc/lib/ssleay32.a /opt/local/i586-mingw32msvc/lib/libeay32.a
endif
openssl_engine_demo_SOURCES = openssl-engine-demo.cxx
openssl_engine_demo_LDFLAGS = -L${top_builddir}/src
openssl_engine_demo_LDADD = -lcryptoki++
openssl_engine_demo_LDADD = -lpcscxx
if MINGW32
openssl_engine_demo_LDADD += /opt/local/i586-mingw32msvc/lib/ssleay32.a /opt/local/i586-mingw32msvc/lib/libeay32.a
endif

@ -6,15 +6,11 @@
## 45678901234567890123456789012345678901234567890123456789012345678901234567890
SUBDIRS = examples
develdir = ${pkgdatadir}/doc
devel_DATA = html/index.html
ALL_SRC = ${top_srcdir}/src/*.[ch]xx ${top_srcdir}/src/*.doc
#${top_srcdir}/test/*.[ch]xx
# ${top_srcdir}/src/*.doc
DIRS = html
# latex
#latex
all: ${DIRS}
@ -24,7 +20,7 @@ all: ${DIRS}
deps = ${top_srcdir}/COPYING ${top_srcdir}/README \
${top_srcdir}/INSTALL ${top_srcdir}/NEWS ${top_srcdir}/ChangeLog
${devel_DATA}: ${ALL_SRC} doxyfile ${deps}
html: ${ALL_SRC} doxyfile ${deps}
doxygen doxyfile
if PEDANTIC
test \! -s doxygen.errors
@ -39,13 +35,14 @@ MAINTAINERCLEANFILES = makefile.in
distclean-local:
- rm -r html latex
dist-hook: ${devel_DATA}
cp -r html ${distdir}/
dist-hook: html
# cp -r html latex ${distdir}/
install-data-hook:
chmod -R u+w ${develdir}
cp -r html/* ${develdir}/
test -d $(DESTDIR)${docdir} || mkdir -p $(DESTDIR)${docdir}
chmod -R u+w $(DESTDIR)${docdir}
cp -r html $(DESTDIR)${docdir}/
uninstall-hook:
-chmod -R u+w ${develdir}
-rm -rf ${develdir}/*
-chmod -R u+w $(DESTDIR)${docdir}
-rm -rf $(DESTDIR)${docdir}/*

@ -0,0 +1,66 @@
Summary: C++ Wrapper around OpenSSL, PCSC and Cryptoki
Name: @PACKAGENAME@
Version: @VERSION@
Release: 1
License: LGPL
Group: Development/Libraries/C++
URL: https://dev.marc.waeckerlin.org/projects/@PACKAGENAME@
Source0: %{name}-%{version}.tar.gz
BuildRequires: subversion libcppunit-devel gcc-c++ doxygen graphviz texlive automake autoconf libtool make libopenssl-devel pcsc-lite-devel boost-devel
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
%description
@README@
This package contains only the shared libraries required at runtime.
%prep
%setup -q
./configure --prefix=/usr \
--docdir=/usr/share/doc/packages/@PACKAGENAME@ \
--libdir=/usr/lib
%build
make
%install
DESTDIR=$RPM_BUILD_ROOT make install
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
/usr/lib/@PACKAGENAME@.so.*
%doc
/usr/share/doc/packages/@PACKAGENAME@/AUTHORS
/usr/share/doc/packages/@PACKAGENAME@/COPYING
/usr/share/doc/packages/@PACKAGENAME@/ChangeLog
/usr/share/doc/packages/@PACKAGENAME@/INSTALL
/usr/share/doc/packages/@PACKAGENAME@/NEWS
/usr/share/doc/packages/@PACKAGENAME@/README
%package devel
Summary: C++ Wrapper around OpenSSL, PCSC and Cryptoki (development files)
Group: Development/Libraries/C++
Requires: @PACKAGENAME@ = @VERSION@
%description devel
@README@
This Package contains all files required for developement.
%files devel
%defattr(-,root,root,-)
/usr/lib/@PACKAGENAME@.so
/usr/lib/@PACKAGENAME@.a
/usr/lib/pkgconfig
/usr/lib/@PACKAGENAME@.la
/usr/include/
/usr/share/pkgconfig
%doc
/usr/share/doc/packages/@PACKAGENAME@/html
/usr/share/doc/packages/@PACKAGENAME@/@PACKAGENAME@.spec
%changelog

@ -24,8 +24,7 @@ deb: dist
cd @PACKAGE@-@VERSION@ && dpkg-buildpackage
rm -rf @PACKAGE@-@VERSION@
infosdir = ${pkgdatadir}
infos_DATA = AUTHORS NEWS README COPYING INSTALL ChangeLog # @PACKAGENAME@.spec
doc_DATA = AUTHORS NEWS README COPYING INSTALL ChangeLog @PACKAGENAME@.spec
RPMS = /usr/src/packages/RPMS/i586/@PACKAGENAME@-@MAJOR@.@MINOR@.@LEAST@-1.i586.rpm \
/usr/src/packages/RPMS/i586/@PACKAGENAME@-devel-@MAJOR@.@MINOR@.@LEAST@-1.i586.rpm \
@ -41,15 +40,21 @@ tag: distcheck
cvs ci -R .
cvs tag -FR REL_@PACKAGENAME@-@MAJOR@-@MINOR@-@LEAST@ .
#rpm: dist
# cp @PACKAGENAME@-@MAJOR@.@MINOR@.@LEAST@.tar.gz \
# /usr/src/packages/SOURCES/
# rpmbuild -ba --clean @PACKAGENAME@.spec
rpm: dist
cp @PACKAGENAME@-@MAJOR@.@MINOR@.@LEAST@.tar.gz \
/usr/src/packages/SOURCES/
rpmbuild -ba --clean @PACKAGENAME@.spec
deps = ${top_srcdir}/COPYING ${top_srcdir}/README ${top_srcdir}/INSTALL ${top_srcdir}/NEWS ${top_srcdir}/ChangeLog
clean-local:
- rm doxygen.err lib@PACKAGENAME@.doxytag
- rm @PACKAGENAME@-dev_@MAJOR@.@MINOR@.@LEAST@-*.deb \
@PACKAGENAME@_@MAJOR@.@MINOR@.@LEAST@-*.changes \
@PACKAGENAME@_@MAJOR@.@MINOR@.@LEAST@-1.tar.gz \
@PACKAGENAME@_@MAJOR@.@MINOR@.@LEAST@-1.dsc \
@PACKAGENAME@-@MAJOR@.@MINOR@.@LEAST@.tar.gz \
@PACKAGENAME@_@MAJOR@.@MINOR@.@LEAST@-*.deb
distclean-local:
- rm -r ${top_builddir}/@DOC_DIR@/html/* ${top_builddir}/@DOC_DIR@/latex/*
@ -59,16 +64,3 @@ distclean-local:
- rm aclocal.m4 config.guess config.sub configure \
depcomp install-sh ltmain.sh makefile makefile.in \
missing mkinstalldirs
dist-hook:
test -d ${distdir}/@DOC_DIR@/html || \
mkdir -p ${distdir}/@DOC_DIR@/html
cp ${top_builddir}/@DOC_DIR@/html/* ${distdir}/@DOC_DIR@/html/.
install-data-hook:
chmod -R u+w ${pkgdatadir}/@DOC_DIR@
cp -rf ${top_builddir}/@DOC_DIR@/html ${pkgdatadir}/@DOC_DIR@/
#uninstall-hook:
# chmod -R u+w ${pkgdatadir}/doc
# rm -rf ${pkgdatadir}/doc

@ -25,19 +25,20 @@ pkgconfig_DATA = libpcscxx.pc
pkgconfig2dir = $(datarootdir)/pkgconfig
pkgconfig2_DATA = $(pkgconfig_DATA)
EXTRA_DIST = $(pkgconfig_DATA).in
EXTRA_DIST = $(pkgconfig_DATA).in ${top_srcdir}/src/*.doc
lib_LTLIBRARIES = libcryptoki++.la
lib_LTLIBRARIES = libpcscxx.la
libcryptoki___la_SOURCES = cryptoki.cxx cryptoki.hxx pcsc.cxx \
libpcscxx_la_SOURCES = cryptoki.cxx cryptoki.hxx pcsc.cxx \
version.cxx openssl-engine.cxx
libcryptoki___la_LIBADD = -lssl -lcrypto
libpcscxx_la_LDFLAGS = -version-info ${LIB_VERSION}
libpcscxx_la_LIBADD = -lssl -lcrypto
if MINGW32
libcryptoki___la_LIBADD += -lgdi32 -lws2_32
libpcscxx_la_LIBADD += -lgdi32 -lws2_32
else
libcryptoki___la_LIBADD += -ldl
libpcscxx_la_LIBADD += -ldl
if !MAC
libcryptoki___la_LIBADD += -lpcsclite
libpcscxx_la_LIBADD += -lpcsclite
endif
endif

Loading…
Cancel
Save