Skip to content

Commit

Permalink
- first steps handling snapshot info files
Browse files Browse the repository at this point in the history
  • Loading branch information
aschnell committed Jan 10, 2011
1 parent def27e5 commit ea71856
Show file tree
Hide file tree
Showing 28 changed files with 2,242 additions and 1 deletion.
15 changes: 14 additions & 1 deletion .gitignore
@@ -1 +1,14 @@
BUILD
Makefile.in
Makefile
.deps
.libs
aclocal.m4
autom4te.cache
config.*
configure
depcomp
install-sh
libtool
ltmain.sh
missing
stamp-h1
1 change: 1 addition & 0 deletions AUTHORS
@@ -0,0 +1 @@
Arvin Schnell <aschnell@suse.de>
339 changes: 339 additions & 0 deletions COPYING

Large diffs are not rendered by default.

23 changes: 23 additions & 0 deletions Makefile.am
@@ -0,0 +1,23 @@
#
# Makefile.am for snapper
#

SUBDIRS = snapper examples

AUTOMAKE_OPTIONS = foreign dist-bzip2 no-dist-gzip

doc_DATA = AUTHORS COPYING

EXTRA_DIST = $(doc_DATA) VERSION


snapper-$(VERSION).tar.bz2: dist-bzip2

package-local: snapper-$(VERSION).tar.bz2
rm -f package/snapper-*.tar.bz2
rm -f package/*~
rm -f package/*.bak
mv snapper-$(VERSION).tar.bz2 package/

package: package-local

20 changes: 20 additions & 0 deletions Makefile.repo
@@ -0,0 +1,20 @@
#
# Makefile.repo for libsnapper
#

configure: all
./configure

all:
aclocal
autoconf
autoheader
autoreconf --force --install

install: configure
make
make install

reconf: all
./config.status --recheck
./config.status
1 change: 1 addition & 0 deletions VERSION
@@ -0,0 +1 @@
0.0.1
36 changes: 36 additions & 0 deletions configure.in
@@ -0,0 +1,36 @@

AC_INIT(snapper/Snapper.h)

VERSION=`cat ./VERSION`

AM_INIT_AUTOMAKE(snapper, $VERSION)
AM_CONFIG_HEADER(config.h)

AC_DISABLE_STATIC

AC_PROG_CXX
AC_PROG_LIBTOOL
AM_PROG_LIBTOOL

AC_PREFIX_DEFAULT(/usr)

dnl Automake 1.11 enables silent compilation
dnl Disable it by "configure --disable-silent-rules" or "make V=1"
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])

CFLAGS="${CFLAGS} -Wall -Wformat=2 -Wmissing-prototypes"
CXXFLAGS="${CXXFLAGS} -std=c++0x -DHAVE_CXX0X -Wall -Wextra -Wformat=2 -Wnon-virtual-dtor -Wno-unused-parameter"

docdir=\${prefix}/share/doc/packages/snapper
fillupdir=/var/adm/fillup-templates

AC_SUBST(VERSION)
AC_SUBST(docdir)
AC_SUBST(fillupdir)

AC_OUTPUT(
Makefile
snapper/Makefile
examples/Makefile
package/snapper.spec:snapper.spec.in
)
4 changes: 4 additions & 0 deletions examples/.gitignore
@@ -0,0 +1,4 @@
List.o
List
Create.o
Create
22 changes: 22 additions & 0 deletions examples/Create.cc
@@ -0,0 +1,22 @@

#include <stdlib.h>
#include <iostream>

#include <snapper/Snapper.h>

using namespace snapper;
using namespace std;

int
main(int argc, char** argv)
{
createSingleSnapshot("test");

unsigned int pre_id = createPreSnapshot("test undo");

createPostSnapshot(pre_id);

listSnapshots();

exit(EXIT_SUCCESS);
}
16 changes: 16 additions & 0 deletions examples/List.cc
@@ -0,0 +1,16 @@

#include <stdlib.h>
#include <iostream>

#include <snapper/Snapper.h>

using namespace snapper;
using namespace std;

int
main(int argc, char** argv)
{
listSnapshots();

exit(EXIT_SUCCESS);
}
23 changes: 23 additions & 0 deletions examples/Makefile.am
@@ -0,0 +1,23 @@
#
# Makefile.am for libsnapper/examples
#

INCLUDES = -I$(top_srcdir)

LDADD = ../snapper/libsnapper.la

noinst_PROGRAMS = List Create

List_SOURCES = List.cc

Create_SOURCES = Create.cc

exampledir = $(docdir)/examples

example_DATA = List.cc Create.cc

EXTRA_DIST = $(example_DATA) Makefile.example

install-data-local:
/usr/bin/install -d -p -m 755 $(DESTDIR)$(exampledir)
/usr/bin/install -p -m 644 Makefile.example $(DESTDIR)$(exampledir)/Makefile
33 changes: 33 additions & 0 deletions examples/Makefile.example
@@ -0,0 +1,33 @@

PROGRAMS = TestDisk TestDiskLog TestProbing TestLvm TestMd TestLoop \
SaveGraph ShowBytes

all: $(PROGRAMS)

TestDisk: TestDisk.cc
g++ $< -o $@ -Wall -O2 -lstorage

TestDiskLog: TestDiskLog.cc
g++ $< -o $@ -Wall -O2 -lstorage

TestProbing: TestProbing.cc
g++ $< -o $@ -Wall -O2 -lstorage

TestLvm: TestLvm.cc
g++ $< -o $@ -Wall -O2 -lstorage

TestMd: TestMd.cc
g++ $< -o $@ -Wall -O2 -lstorage

TestLoop: TestLoop.cc
g++ $< -o $@ -Wall -O2 -lstorage

SaveGraph: SaveGraph.cc
g++ $< -o $@ -Wall -O2 -lstorage

ShowBytes: ShowBytes.cc
g++ $< -o $@ -Wall -O2 -lstorage

clean:
rm $(PROGRAMS)

2 changes: 2 additions & 0 deletions package/.gitignore
@@ -0,0 +1,2 @@
snapper-*.tar.bz2
snapper.spec
5 changes: 5 additions & 0 deletions package/snapper.changes
@@ -0,0 +1,5 @@
-------------------------------------------------------------------
Mon Jan 10 14:55:25 CET 2011 - aschnell@suse.de

- started development

98 changes: 98 additions & 0 deletions package/snapper.spec
@@ -0,0 +1,98 @@
#
# spec file for package snapper (Version 0.0.1)
#
# norootforbuild

Name: snapper
Version: 0.0.1
Release: 0
License: GPL
Group: System/Libraries
BuildRoot: %{_tmppath}/%{name}-%{version}-build
Source: snapper-%{version}.tar.bz2
Source1: snapper-rpmlintrc

prefix: /usr

BuildRequires: gcc-c++ boost-devel blocxx-devel doxygen dejagnu libxml2-devel

Requires: btrfs-progs

PreReq: %fillup_prereq
Summary: Library for snapper management

%description
This package contains snapper, a library for filesystem snapshot management.

Authors:
--------
Arvin Schnell <aschnell@suse.de>

%prep
%setup -n snapper-%{version}

%build
export CFLAGS="$RPM_OPT_FLAGS -DNDEBUG"
export CXXFLAGS="$RPM_OPT_FLAGS -DNDEBUG"

aclocal
libtoolize --force --automake --copy
autoheader
automake --add-missing --copy
autoconf

%{?suse_update_config:%{suse_update_config -f}}
./configure --libdir=%{_libdir} --prefix=%{prefix} --mandir=%{_mandir} --disable-silent-rules
make %{?jobs:-j%jobs}

%check
LOCALEDIR=$RPM_BUILD_ROOT/usr/share/locale make check

%install
make install DESTDIR="$RPM_BUILD_ROOT"

install -d -m 755 $RPM_BUILD_ROOT/var/lock/snapper

%{find_lang} snapper

%clean
rm -rf "$RPM_BUILD_ROOT"

%files -f snapper.lang
%defattr(-,root,root)
%{_libdir}/libsnapper.so.*
%dir /var/lock/libsnapper
/var/adm/fillup-templates/sysconfig.snapper-libsnapper
%doc %dir %{prefix}/share/doc/packages/libsnapper
%doc %{prefix}/share/doc/packages/snapper/AUTHORS
%doc %{prefix}/share/doc/packages/snapper/COPYING

%post
/sbin/ldconfig
%{fillup_only -an snapper}

%postun
/sbin/ldconfig

%package devel
Requires: libsnapper = %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++

%description devel
This package contains header files and documentation for developing with
libsnapper.

Authors:
--------
Arvin Schnell <aschnell@suse.de>

%files devel
%defattr(-,root,root)
%{_libdir}/libsnapper.la
%{_libdir}/libsnapper.so
%{prefix}/include/snapper
%doc %{prefix}/share/doc/packages/libsnapper/autodocs
%doc %{prefix}/share/doc/packages/libsnapper/examples

0 comments on commit ea71856

Please sign in to comment.