Skip to content

Commit ea71856

Browse files
committed
- first steps handling snapshot info files
1 parent def27e5 commit ea71856

28 files changed

+2242
-1
lines changed

.gitignore

+14-1
Original file line numberDiff line numberDiff line change
@@ -1 +1,14 @@
1-
BUILD
1+
Makefile.in
2+
Makefile
3+
.deps
4+
.libs
5+
aclocal.m4
6+
autom4te.cache
7+
config.*
8+
configure
9+
depcomp
10+
install-sh
11+
libtool
12+
ltmain.sh
13+
missing
14+
stamp-h1

AUTHORS

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Arvin Schnell <[email protected]>

COPYING

+339
Large diffs are not rendered by default.

Makefile.am

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#
2+
# Makefile.am for snapper
3+
#
4+
5+
SUBDIRS = snapper examples
6+
7+
AUTOMAKE_OPTIONS = foreign dist-bzip2 no-dist-gzip
8+
9+
doc_DATA = AUTHORS COPYING
10+
11+
EXTRA_DIST = $(doc_DATA) VERSION
12+
13+
14+
snapper-$(VERSION).tar.bz2: dist-bzip2
15+
16+
package-local: snapper-$(VERSION).tar.bz2
17+
rm -f package/snapper-*.tar.bz2
18+
rm -f package/*~
19+
rm -f package/*.bak
20+
mv snapper-$(VERSION).tar.bz2 package/
21+
22+
package: package-local
23+

Makefile.repo

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
#
2+
# Makefile.repo for libsnapper
3+
#
4+
5+
configure: all
6+
./configure
7+
8+
all:
9+
aclocal
10+
autoconf
11+
autoheader
12+
autoreconf --force --install
13+
14+
install: configure
15+
make
16+
make install
17+
18+
reconf: all
19+
./config.status --recheck
20+
./config.status

VERSION

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
0.0.1

configure.in

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
2+
AC_INIT(snapper/Snapper.h)
3+
4+
VERSION=`cat ./VERSION`
5+
6+
AM_INIT_AUTOMAKE(snapper, $VERSION)
7+
AM_CONFIG_HEADER(config.h)
8+
9+
AC_DISABLE_STATIC
10+
11+
AC_PROG_CXX
12+
AC_PROG_LIBTOOL
13+
AM_PROG_LIBTOOL
14+
15+
AC_PREFIX_DEFAULT(/usr)
16+
17+
dnl Automake 1.11 enables silent compilation
18+
dnl Disable it by "configure --disable-silent-rules" or "make V=1"
19+
m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
20+
21+
CFLAGS="${CFLAGS} -Wall -Wformat=2 -Wmissing-prototypes"
22+
CXXFLAGS="${CXXFLAGS} -std=c++0x -DHAVE_CXX0X -Wall -Wextra -Wformat=2 -Wnon-virtual-dtor -Wno-unused-parameter"
23+
24+
docdir=\${prefix}/share/doc/packages/snapper
25+
fillupdir=/var/adm/fillup-templates
26+
27+
AC_SUBST(VERSION)
28+
AC_SUBST(docdir)
29+
AC_SUBST(fillupdir)
30+
31+
AC_OUTPUT(
32+
Makefile
33+
snapper/Makefile
34+
examples/Makefile
35+
package/snapper.spec:snapper.spec.in
36+
)

examples/.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
List.o
2+
List
3+
Create.o
4+
Create

examples/Create.cc

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
2+
#include <stdlib.h>
3+
#include <iostream>
4+
5+
#include <snapper/Snapper.h>
6+
7+
using namespace snapper;
8+
using namespace std;
9+
10+
int
11+
main(int argc, char** argv)
12+
{
13+
createSingleSnapshot("test");
14+
15+
unsigned int pre_id = createPreSnapshot("test undo");
16+
17+
createPostSnapshot(pre_id);
18+
19+
listSnapshots();
20+
21+
exit(EXIT_SUCCESS);
22+
}

examples/List.cc

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
#include <stdlib.h>
3+
#include <iostream>
4+
5+
#include <snapper/Snapper.h>
6+
7+
using namespace snapper;
8+
using namespace std;
9+
10+
int
11+
main(int argc, char** argv)
12+
{
13+
listSnapshots();
14+
15+
exit(EXIT_SUCCESS);
16+
}

examples/Makefile.am

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
#
2+
# Makefile.am for libsnapper/examples
3+
#
4+
5+
INCLUDES = -I$(top_srcdir)
6+
7+
LDADD = ../snapper/libsnapper.la
8+
9+
noinst_PROGRAMS = List Create
10+
11+
List_SOURCES = List.cc
12+
13+
Create_SOURCES = Create.cc
14+
15+
exampledir = $(docdir)/examples
16+
17+
example_DATA = List.cc Create.cc
18+
19+
EXTRA_DIST = $(example_DATA) Makefile.example
20+
21+
install-data-local:
22+
/usr/bin/install -d -p -m 755 $(DESTDIR)$(exampledir)
23+
/usr/bin/install -p -m 644 Makefile.example $(DESTDIR)$(exampledir)/Makefile

examples/Makefile.example

+33
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
2+
PROGRAMS = TestDisk TestDiskLog TestProbing TestLvm TestMd TestLoop \
3+
SaveGraph ShowBytes
4+
5+
all: $(PROGRAMS)
6+
7+
TestDisk: TestDisk.cc
8+
g++ $< -o $@ -Wall -O2 -lstorage
9+
10+
TestDiskLog: TestDiskLog.cc
11+
g++ $< -o $@ -Wall -O2 -lstorage
12+
13+
TestProbing: TestProbing.cc
14+
g++ $< -o $@ -Wall -O2 -lstorage
15+
16+
TestLvm: TestLvm.cc
17+
g++ $< -o $@ -Wall -O2 -lstorage
18+
19+
TestMd: TestMd.cc
20+
g++ $< -o $@ -Wall -O2 -lstorage
21+
22+
TestLoop: TestLoop.cc
23+
g++ $< -o $@ -Wall -O2 -lstorage
24+
25+
SaveGraph: SaveGraph.cc
26+
g++ $< -o $@ -Wall -O2 -lstorage
27+
28+
ShowBytes: ShowBytes.cc
29+
g++ $< -o $@ -Wall -O2 -lstorage
30+
31+
clean:
32+
rm $(PROGRAMS)
33+

package/.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
snapper-*.tar.bz2
2+
snapper.spec

package/snapper.changes

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
-------------------------------------------------------------------
2+
Mon Jan 10 14:55:25 CET 2011 - [email protected]
3+
4+
- started development
5+

package/snapper.spec

+98
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
#
2+
# spec file for package snapper (Version 0.0.1)
3+
#
4+
# norootforbuild
5+
6+
Name: snapper
7+
Version: 0.0.1
8+
Release: 0
9+
License: GPL
10+
Group: System/Libraries
11+
BuildRoot: %{_tmppath}/%{name}-%{version}-build
12+
Source: snapper-%{version}.tar.bz2
13+
Source1: snapper-rpmlintrc
14+
15+
prefix: /usr
16+
17+
BuildRequires: gcc-c++ boost-devel blocxx-devel doxygen dejagnu libxml2-devel
18+
19+
Requires: btrfs-progs
20+
21+
PreReq: %fillup_prereq
22+
Summary: Library for snapper management
23+
24+
%description
25+
This package contains snapper, a library for filesystem snapshot management.
26+
27+
Authors:
28+
--------
29+
Arvin Schnell <[email protected]>
30+
31+
%prep
32+
%setup -n snapper-%{version}
33+
34+
%build
35+
export CFLAGS="$RPM_OPT_FLAGS -DNDEBUG"
36+
export CXXFLAGS="$RPM_OPT_FLAGS -DNDEBUG"
37+
38+
aclocal
39+
libtoolize --force --automake --copy
40+
autoheader
41+
automake --add-missing --copy
42+
autoconf
43+
44+
%{?suse_update_config:%{suse_update_config -f}}
45+
./configure --libdir=%{_libdir} --prefix=%{prefix} --mandir=%{_mandir} --disable-silent-rules
46+
make %{?jobs:-j%jobs}
47+
48+
%check
49+
LOCALEDIR=$RPM_BUILD_ROOT/usr/share/locale make check
50+
51+
%install
52+
make install DESTDIR="$RPM_BUILD_ROOT"
53+
54+
install -d -m 755 $RPM_BUILD_ROOT/var/lock/snapper
55+
56+
%{find_lang} snapper
57+
58+
%clean
59+
rm -rf "$RPM_BUILD_ROOT"
60+
61+
%files -f snapper.lang
62+
%defattr(-,root,root)
63+
%{_libdir}/libsnapper.so.*
64+
%dir /var/lock/libsnapper
65+
/var/adm/fillup-templates/sysconfig.snapper-libsnapper
66+
%doc %dir %{prefix}/share/doc/packages/libsnapper
67+
%doc %{prefix}/share/doc/packages/snapper/AUTHORS
68+
%doc %{prefix}/share/doc/packages/snapper/COPYING
69+
70+
%post
71+
/sbin/ldconfig
72+
%{fillup_only -an snapper}
73+
74+
%postun
75+
/sbin/ldconfig
76+
77+
%package devel
78+
Requires: libsnapper = %version
79+
Requires: gcc-c++ libstdc++-devel boost-devel blocxx-devel libxml2-devel
80+
Summary: Header files and documentation for libsnapper
81+
Group: Development/Languages/C and C++
82+
83+
%description devel
84+
This package contains header files and documentation for developing with
85+
libsnapper.
86+
87+
Authors:
88+
--------
89+
Arvin Schnell <[email protected]>
90+
91+
%files devel
92+
%defattr(-,root,root)
93+
%{_libdir}/libsnapper.la
94+
%{_libdir}/libsnapper.so
95+
%{prefix}/include/snapper
96+
%doc %{prefix}/share/doc/packages/libsnapper/autodocs
97+
%doc %{prefix}/share/doc/packages/libsnapper/examples
98+

0 commit comments

Comments
 (0)