From: Arvin Schnell Date: Mon, 9 May 2011 12:12:47 +0000 (+0200) Subject: - get library version from LIBVERSION file X-Git-Tag: v0.1.3~389 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f163d4165947e442a1580663d9e59226556a2fa7;p=thirdparty%2Fsnapper.git - get library version from LIBVERSION file --- diff --git a/LIBVERSION b/LIBVERSION new file mode 100644 index 00000000..3eefcb9d --- /dev/null +++ b/LIBVERSION @@ -0,0 +1 @@ +1.0.0 diff --git a/Makefile.am b/Makefile.am index b326d6c9..a605786c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -8,7 +8,7 @@ AUTOMAKE_OPTIONS = foreign dist-bzip2 no-dist-gzip doc_DATA = AUTHORS COPYING -EXTRA_DIST = $(doc_DATA) VERSION +EXTRA_DIST = $(doc_DATA) VERSION LIBVERSION snapper-$(VERSION).tar.bz2: dist-bzip2 diff --git a/configure.in b/configure.in index 383fcf91..cba60363 100644 --- a/configure.in +++ b/configure.in @@ -3,6 +3,16 @@ AC_INIT(snapper/Snapper.h) VERSION=`cat ./VERSION` +LIBVERSION=`cat ./LIBVERSION` +LIBVERSION_MAJOR=`cut -d . -f 1 ./LIBVERSION` +LIBVERSION_MINOR=`cut -d . -f 2 ./LIBVERSION` +LIBVERSION_PATCHLEVEL=`cut -d . -f 3 ./LIBVERSION` + +LIBVERSION_CURRENT=`expr $LIBVERSION_MAJOR + $LIBVERSION_MINOR` +LIBVERSION_REVISON=`expr $LIBVERSION_PATCHLEVEL` +LIBVERSION_AGE=`expr $LIBVERSION_MINOR` +LIBVERSION_INFO=$LIBVERSION_CURRENT:$LIBVERSION_REVISON:$LIBVERSION_AGE + AM_INIT_AUTOMAKE(snapper, $VERSION) AM_CONFIG_HEADER(config.h) @@ -25,6 +35,8 @@ docdir=\${prefix}/share/doc/packages/snapper fillupdir=/var/adm/fillup-templates AC_SUBST(VERSION) +AC_SUBST(LIBVERSION_MAJOR) +AC_SUBST(LIBVERSION_INFO) AC_SUBST(docdir) AC_SUBST(fillupdir) diff --git a/snapper.spec.in b/snapper.spec.in index bf1f4155..580fb3bd 100644 --- a/snapper.spec.in +++ b/snapper.spec.in @@ -12,7 +12,7 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build Source: snapper-%{version}.tar.bz2 Prefix: /usr BuildRequires: gcc-c++ boost-devel blocxx-devel doxygen dejagnu libxml2-devel -Requires: libsnapper0 = %version +Requires: libsnapper@LIBVERSION_MAJOR@ = %version Recommends: cron logrotate Summary: Tool for filesystem snapshot management @@ -55,20 +55,20 @@ rm -rf "$RPM_BUILD_ROOT" /etc/cron.hourly/suse.de-snapper /etc/cron.daily/suse.de-snapper -%package -n libsnapper0 +%package -n libsnapper@LIBVERSION_MAJOR@ Summary: Library for filesystem snapshot management Group: System/Libraries Requires: btrfsprogs diffutils util-linux PreReq: %fillup_prereq -%description -n libsnapper0 +%description -n libsnapper@LIBVERSION_MAJOR@ This package contains libsnapper, a library for filesystem snapshot management. Authors: -------- Arvin Schnell -%files -n libsnapper0 +%files -n libsnapper@LIBVERSION_MAJOR@ %defattr(-,root,root) %{_libdir}/libsnapper.so.* %dir %{_sysconfdir}/snapper @@ -85,15 +85,15 @@ Authors: %dir %{prefix}/lib/snapper/bin %{prefix}/lib/snapper/bin/compare-dirs -%post -n libsnapper0 +%post -n libsnapper@LIBVERSION_MAJOR@ /sbin/ldconfig %{fillup_only -n snapper} -%postun -n libsnapper0 +%postun -n libsnapper@LIBVERSION_MAJOR@ /sbin/ldconfig %package -n libsnapper-devel -Requires: libsnapper0 = %version +Requires: libsnapper@LIBVERSION_MAJOR@ = %version Requires: gcc-c++ libstdc++-devel boost-devel blocxx-devel libxml2-devel Summary: Header files and documentation for libsnapper Group: Development/Languages/C and C++ diff --git a/snapper/Makefile.am b/snapper/Makefile.am index 997cab51..8fd1d93a 100644 --- a/snapper/Makefile.am +++ b/snapper/Makefile.am @@ -24,7 +24,7 @@ libsnapper_la_SOURCES = \ SnapperTypes.h \ SnapperDefines.h -libsnapper_la_LDFLAGS = -version-info 0:0 +libsnapper_la_LDFLAGS = -version-info @LIBVERSION_INFO@ libsnapper_la_LIBADD = -lblocxx -lxml2 pkgincludedir = $(includedir)/snapper