]> git.ipfire.org Git - thirdparty/snapper.git/commitdiff
- get library version from LIBVERSION file
authorArvin Schnell <aschnell@suse.de>
Mon, 9 May 2011 12:12:47 +0000 (14:12 +0200)
committerArvin Schnell <aschnell@suse.de>
Mon, 9 May 2011 12:12:47 +0000 (14:12 +0200)
LIBVERSION [new file with mode: 0644]
Makefile.am
configure.in
snapper.spec.in
snapper/Makefile.am

diff --git a/LIBVERSION b/LIBVERSION
new file mode 100644 (file)
index 0000000..3eefcb9
--- /dev/null
@@ -0,0 +1 @@
+1.0.0
index b326d6c981635b4c59f35992e710512a090ddabb..a605786c73459d1fb6c605272c1c54cd09aeeaa5 100644 (file)
@@ -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
index 383fcf911b70b790ed0b187175e1563a8717681e..cba603639d241f7e83cfdc15b5db6803b88295d2 100644 (file)
@@ -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)
 
index bf1f41559bc0306fff15b47abee59245caeca1a2..580fb3bdb80e7add2c6749779bf290b2cd74324b 100644 (file)
@@ -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 <aschnell@suse.de>
 
-%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++
index 997cab51e555b5ad744df901b3e2748a7e8ea2b2..8fd1d93a32aa4fae3ce96465f41e8c5d7adcbab2 100644 (file)
@@ -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