Skip to contentSkip to conversation

btrfs-progs: Create libbtrfs and package it up

PATCH In review Jeff Mahoney 6 participants 12 messages Jun 13, 2008 – Jun 14, 2008

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

cover btrfs-progs: Create libbtrfs and package it up

Hi Chris -

Here's the patch set I mentioned earlier.

It consists of 4 patches and a script. Otherwise it'd be a lot more patches that only move files around. The end result after running the script is a directory tree that looks like this:

btrfs-progs/lib
btrfs-progs/src/debug
btrfs-progs/src/fsck
btrfs-progs/src/test
btrfs-progs/src/util
btrfs-progs/src/convert
btrfs-progs/src/mkfs

lib contains the objects that used to be $(COMMON_OBJS), but are now a full-fledged shared library with supporting includes to be installed in /usr/include/btrfs. Headers are also placed in lib so that patches indended for the kernel can also apply to the library without a lot of effort.

* Patch 1: Converts to autotools
* Patch 2: Adds check for sparse support
* Patch 3: Creates libbtrfs and reshuffle programs to use it
* Patch 4: Creates a spec file

I know there are a lot of people out there who hate autotools. I'm not a fan myself, but it does make the checking for optional libraries and the generation of new ones really easy.

The spec file expects the library to exist and will create three packages:
btrfs-progs, libbtrfs, and libbtrfs-devel.

This all works for me.

-Jeff

Signature · 2 lines
Jeff Mahoney
SUSE Labs
#1 lore raw
Quoted 5 lines · Jeff Mahoney

lib contains the objects that used to be $(COMMON_OBJS), but are now a full-fledged shared library with supporting includes to be installed in /usr/include/btrfs. Headers are also placed in lib so that patches indended for the kernel can also apply to the library without a lot of effort.

I don't think making this a public library yet is a good idea, the API will change frequently and it'll be a pain to keep it uptodate. Just make it an internal static library for now.

#2 lore raw

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 10 lines · Christoph Hellwig
Quoted 5 lines · Jeff Mahoney

lib contains the objects that used to be $(COMMON_OBJS), but are now a full-fledged shared library with supporting includes to be installed in /usr/include/btrfs. Headers are also placed in lib so that patches indended for the kernel can also apply to the library without a lot of effort.

I don't think making this a public library yet is a good idea, the API will change frequently and it'll be a pain to keep it uptodate. Just make it an internal static library for now.

I'm not sure I get your concerns with keeping it up to date. The library remains with btrfs-progs. At this stage of development, anyone planning on using it for anything external should understand the risks.

- -Jeff

- --
Jeff Mahoney
SUSE Labs
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iEYEARECAAYFAkhSq5wACgkQLPWxlyuTD7LNJQCffzmBsihbgygw3iYLxS/uXo8e JDMAn0igroLKwEbTF6vNXbzzvlEBDK2j
=HyDu
-----END PGP SIGNATURE-----

#3 lore raw

PATCH 1/5 btrfs-progs: convert to autotools

In reply to Jeff Mahoney

This patch converts the btrfs-progs build system from a single Makefile to the autotools suite.

The advantages are:
Easier construction of Makefiles
Easier to breakout the source into separate directories for easier management Easier to build shared libraries automatically
Automatic checking for optional libraries, like libext2fs for btrfs-convert Automatic infrastructure for installing and testing

The caveats are:
Opinions on autotools are... mixed.
make C=1 no longer works, but is replaced by make check.

A later patch will use the advantages to create a libbtrfs and separate the source and headers into separate directories.

---
 AUTHORS      |    1 
 ChangeLog    |    1 
 Makefile     |   69 -----------------------------------------------------------
 Makefile.am  |   35 +++++++++++++++++++++++++++++
 NEWS         |    1 
 README       |    1 
 configure.ac |   41 +++++++++++++++++++++++++++++++++++
 predef.h.in  |    4 +++
 8 files changed, 84 insertions(+), 69 deletions(-)
AUTHORS new file +1 -0
@@ -0,0 +1 @@
+
ChangeLog new file +1 -0
@@ -0,0 +1 @@
+
Makefile deleted +0 -69

69 lines not on this page · raw message

Makefile.am new file +35 -0
@@ -0,0 +1,35 @@
+sbin_PROGRAMS = btrfsctl btrfs-vol btrfs-show btrfsck mkfs.btrfs debug-tree \
+	       $(BTRFS_CONVERT)
+sbin_SCRIPTS = show-blocks bcp
+
+EXTRA_PROGRAMS = btrfs-convert quick-test dir-test
+
+COMMON_SOURCES = ctree.c disk-io.c radix-tree.c extent-tree.c print-tree.c \
+	      root-tree.c dir-item.c hash.c file-item.c inode-item.c \
+	      inode-map.c crc32c.c rbtree.c extent-cache.c extent_io.c \
+	      volumes.c utils.c
+
+btrfsctl_SOURCES = btrfsctl.c $(COMMON_SOURCES)
+btrfs_vol_SOURCES = btrfs-vol.c $(COMMON_SOURCES)
+btrfs_show_SOURCES = btrfs-show.c $(COMMON_SOURCES)
+btrfsck_SOURCES = btrfsck.c bit-radix.c $(COMMON_SOURCES)
+mkfs_btrfs_SOURCES = mkfs.c $(COMMON_SOURCES)
+debug_tree_SOURCES = debug-tree.c $(COMMON_SOURCES)
+dir_test_SOURCES = dir-test.c $(COMMON_SOURCES)
+quick_test_SOURCES = quick-test.c $(COMMON_SOURCES)
+btrfs_convert_SOURCES = convert.c $(COMMON_SOURCES)
+
+btrfs_convert_CFLAGS = $(libext2fs_CFLAGS)
+btrfs_convert_LDADD = $(libext2fs_LIBS)
+
+PROGS_SRCS = $(COMMON_SOURCES) btrfsctl.c btrfs-vol.c btrfs-show.c \
+		btrfsck.c bit-radix.c mkfs.c debug-tree.c dir-test.c \
+		quick-test.c convert.c
+
+CHECKFLAGS=-Wbitwise -Wuninitialized -Wshadow -Wundef
+SPARSE = sparse
+
+TESTS = $(PROGS_SRCS)
+TESTS_ENVIRONMENT = \
+	$(SPARSE) $(CHECKFLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+		  $(AM_CPPFLAGS) $(CPPFLAGS) -include $(top_builddir)/predef.h
NEWS new file +1 -0
@@ -0,0 +1 @@
+
README new file +1 -0
@@ -0,0 +1 @@
+
configure.ac new file +41 -0

41 lines not on this page · raw message

predef.h.in new file +4 -0
@@ -0,0 +1,4 @@
+#ifndef _PREDEF_H_
+#define _PREDEF_H_
+@PREDEFINED_MACROS@
+#endif _PREDEF_H_
#4 lore raw

Re: [patch 1/5] btrfs-progs: convert to autotools

Hi all!

Quoted 10 lines · Jeff Mahoney

This patch converts the btrfs-progs build system from a single Makefile to the autotools suite.

The advantages are:
Easier construction of Makefiles
Easier to breakout the source into separate directories for easier management Easier to build shared libraries automatically
Automatic checking for optional libraries, like libext2fs for btrfs-convert Automatic infrastructure for installing and testing

Quoted 3 lines

The caveats are:
Opinions on autotools are... mixed.
make C=1 no longer works, but is replaced by make check.

Please make this optional..
I would really prefer the simple makefile that it has now.. If the proposed advantages are a wanted feature, I would gladly try to supply patches for the makefile to support them..
Just to keep it away from autotool hell.

Kind regards

--
Miguel Sousa Filipe

#5 lore raw

Re: [patch 1/5] btrfs-progs: convert to autotools

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 17 lines · Miguel Sousa Filipe

Hi all!

Quoted 10 lines · Jeff Mahoney

This patch converts the btrfs-progs build system from a single Makefile to the autotools suite.

The advantages are:
Easier construction of Makefiles
Easier to breakout the source into separate directories for easier management Easier to build shared libraries automatically
Automatic checking for optional libraries, like libext2fs for btrfs-convert Automatic infrastructure for installing and testing

Quoted 3 lines

The caveats are:
Opinions on autotools are... mixed.
make C=1 no longer works, but is replaced by make check.

Quoted 5 lines

Please make this optional..
I would really prefer the simple makefile that it has now.. If the proposed advantages are a wanted feature, I would gladly try to supply patches for the makefile to support them..
Just to keep it away from autotool hell.

Yeah, the one-time 10 seconds of ./configure can be annoying while it sanity checks your system, but how is a 70-line Makefile better than a 5-line Makefile.am? While it does essentially the same thing? Infrastructure exists for a reason.

I'm not a huge fan of autotools either. It's heavy and annoying at times. It can be inflexible as I rediscovered while trying to make C=1 work. On the other hand, I'm not so much of a purist that I want to commit anyone who touches the code to understanding a maze of Makefile(s) either.

This is the next generation file system for Linux. The reality is that there is competition from other OSes. How is it a bad thing to make things easier for potential developers to access the code? Initially there may be a number of shy folks who just want a library they can work with. Yes, the library will change as things progress. Making things like extending it and installing it easier can only be a good thing.

- -Jeff

- --
Jeff Mahoney
SUSE Labs
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.9 (GNU/Linux)
Comment: Using GnuPG with SUSE - http://enigmail.mozdev.org

iEYEARECAAYFAkhTVY4ACgkQLPWxlyuTD7Iz/wCfRxoHAxGZbSk6aPgrO5IRjtpZ TxoAnih5zTXfgq6QLUrNtQwJkG4I4e1G
=flaT
-----END PGP SIGNATURE-----

#6 lore raw

Re: [patch 1/5] btrfs-progs: convert to autotools

Quoted 38 lines · Jeff Mahoney

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Quoted 17 lines · Miguel Sousa Filipe

Hi all!

Quoted 10 lines · Jeff Mahoney

This patch converts the btrfs-progs build system from a single Makefile to the autotools suite.

The advantages are:
Easier construction of Makefiles
Easier to breakout the source into separate directories for easier management Easier to build shared libraries automatically
Automatic checking for optional libraries, like libext2fs for btrfs-convert Automatic infrastructure for installing and testing

Quoted 3 lines

The caveats are:
Opinions on autotools are... mixed.
make C=1 no longer works, but is replaced by make check.

Quoted 5 lines

Please make this optional..
I would really prefer the simple makefile that it has now.. If the proposed advantages are a wanted feature, I would gladly try to supply patches for the makefile to support them..
Just to keep it away from autotool hell.

Yeah, the one-time 10 seconds of ./configure can be annoying while it sanity checks your system, but how is a 70-line Makefile better than a 5-line Makefile.am? While it does essentially the same thing? Infrastructure exists for a reason.

I'm not a huge fan of autotools either. It's heavy and annoying at times. It can be inflexible as I rediscovered while trying to make C=1 work. On the other hand, I'm not so much of a purist that I want to commit anyone who touches the code to understanding a maze of Makefile(s) either.

Quoted 7 lines

This is the next generation file system for Linux. The reality is that there is competition from other OSes. How is it a bad thing to make things easier for potential developers to access the code? Initially there may be a number of shy folks who just want a library they can work with. Yes, the library will change as things progress. Making things like extending it and installing it easier can only be a good thing.

I expect Jeff's work will make it easier for distro (or anyone) to include btrfs and btrfs-progs as experimental packages. More people can test btrfs without worring about the build process and dependency.

However, I'm not sure if btrfs is ready for testing by non-developers.

Signature · 1 line
Dongjun
#7 lore raw

Re: [patch 1/5] btrfs-progs: convert to autotools

Quoted 5 lines · Dongjun Shin

I expect Jeff's work will make it easier for distro (or anyone) to include btrfs and btrfs-progs as experimental packages. More people can test btrfs without worring about the build process and dependency.

However, I'm not sure if btrfs is ready for testing by non-developers.

:)

I've already put btrfs & btrgs-progs into Gentoo Linux, and I'm naturally curious how many Gentoo users have tried it out as a result. The packages are masked as "testing" (not stable), and they display the "Btrfs is under heavy development..." warning, of course.

And Gentoo is used to handling autotools, so I can adjust the ebuild to deal with this if needed.

Since Gentoo has its own way of specifying which kernel to build modules against, as long as I can control this (I currently pass in a custom "KERNELDIR"), things should work fine.

-Joe

#8 lore raw

PATCH 2/5 btrfs-progs: Test for sparse support in configure

In reply to Jeff Mahoney

This patch moves the sparse defines from Makefile.am to configure.ac

This allows us to enable sparse checking in other directories just by adding the following to the Makefile.am:

  TESTS = $(SOURCES)
  TESTS_ENVIRONMENT = @SPARSE@
---
 Makefile.am  |    9 +++------
 configure.ac |    8 ++++++++
 2 files changed, 11 insertions(+), 6 deletions(-)
Makefile.am +3 -6
@@ -26,10 +26,7 @@ PROGS_SRCS = $(COMMON_SOURCES) btrfsctl.
 		btrfsck.c bit-radix.c mkfs.c debug-tree.c dir-test.c \
 		quick-test.c convert.c
 
-CHECKFLAGS=-Wbitwise -Wuninitialized -Wshadow -Wundef
-SPARSE = sparse
-
+if HAVE_SPARSE
 TESTS = $(PROGS_SRCS)
-TESTS_ENVIRONMENT = \
-	$(SPARSE) $(CHECKFLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
-		  $(AM_CPPFLAGS) $(CPPFLAGS) -include $(top_builddir)/predef.h
+TESTS_ENVIRONMENT = @SPARSE@
+endif
configure.ac +8 -0
@@ -38,4 +38,12 @@ fi
 PREDEFINED_MACROS=$(echo | gcc -dM -E - )
 AC_SUBST(PREDEFINED_MACROS)
 
+AC_CHECK_PROG(sparse, sparse, yes)
+
+AM_CONDITIONAL(HAVE_SPARSE, test "$sparse" = "yes")
+CHECKFLAGS="-Wbitwise -Wuninitialized -Wshadow -Wundef"
+SPARSE='sparse $(CHECKFLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
+		  $(AM_CPPFLAGS) $(CPPFLAGS) \
+		  -include $(top_builddir)/predef.h'
+AC_SUBST(SPARSE)
 AC_OUTPUT(Makefile predef.h)
#9 lore raw

PATCH 3/5 btrfs-progs: Restructure code layout, create libbtrfs

In reply to Jeff Mahoney

This patch creates the automake infrastructure to build after restructure.sh is executed. The final result is the following:

$(COMMON_OBJS) will become libbtrfs.so, with the source in lib/ includes will be split out into include/
Groups of programs will be split out into src/{convert,debug,fsck,mkfs,test,util}

Make install will cause the library and includes to be installed at expected locations.

---
 Makefile.am             |   32 +-------------------------------
 configure.ac            |    8 ++++++--
 lib/Makefile.am         |   16 ++++++++++++++++
 src/Makefile.am         |    1 +
 src/convert/Makefile.am |   14 ++++++++++++++
 src/debug/Makefile.am   |   12 ++++++++++++
 src/fsck/Makefile.am    |   12 ++++++++++++
 src/mkfs/Makefile.am    |   12 ++++++++++++
 src/test/Makefile.am    |   18 ++++++++++++++++++
 src/util/Makefile.am    |   14 ++++++++++++++
 10 files changed, 106 insertions(+), 33 deletions(-)
Makefile.am +1 -31
@@ -1,32 +1,2 @@
-sbin_PROGRAMS = btrfsctl btrfs-vol btrfs-show btrfsck mkfs.btrfs debug-tree \
-	       $(BTRFS_CONVERT)
+SUBDIRS=lib src
 sbin_SCRIPTS = show-blocks bcp
-
-EXTRA_PROGRAMS = btrfs-convert quick-test dir-test
-
-COMMON_SOURCES = ctree.c disk-io.c radix-tree.c extent-tree.c print-tree.c \
-	      root-tree.c dir-item.c hash.c file-item.c inode-item.c \
-	      inode-map.c crc32c.c rbtree.c extent-cache.c extent_io.c \
-	      volumes.c utils.c
-
-btrfsctl_SOURCES = btrfsctl.c $(COMMON_SOURCES)
-btrfs_vol_SOURCES = btrfs-vol.c $(COMMON_SOURCES)
-btrfs_show_SOURCES = btrfs-show.c $(COMMON_SOURCES)
-btrfsck_SOURCES = btrfsck.c bit-radix.c $(COMMON_SOURCES)
-mkfs_btrfs_SOURCES = mkfs.c $(COMMON_SOURCES)
-debug_tree_SOURCES = debug-tree.c $(COMMON_SOURCES)
-dir_test_SOURCES = dir-test.c $(COMMON_SOURCES)
-quick_test_SOURCES = quick-test.c $(COMMON_SOURCES)
-btrfs_convert_SOURCES = convert.c $(COMMON_SOURCES)
-
-btrfs_convert_CFLAGS = $(libext2fs_CFLAGS)
-btrfs_convert_LDADD = $(libext2fs_LIBS)
-
-PROGS_SRCS = $(COMMON_SOURCES) btrfsctl.c btrfs-vol.c btrfs-show.c \
-		btrfsck.c bit-radix.c mkfs.c debug-tree.c dir-test.c \
-		quick-test.c convert.c
-
-if HAVE_SPARSE
-TESTS = $(PROGS_SRCS)
-TESTS_ENVIRONMENT = @SPARSE@
-endif
configure.ac +6 -2
@@ -7,6 +7,7 @@ AC_PROG_CC
 AM_PROG_CC_C_O
 AC_PROG_INSTALL
 AC_PROG_MAKE_SET
+AC_PROG_LIBTOOL
 
 AC_HEADER_STDC
 AC_HEADER_MAJOR
@@ -44,6 +45,9 @@ AM_CONDITIONAL(HAVE_SPARSE, test "$spars
 CHECKFLAGS="-Wbitwise -Wuninitialized -Wshadow -Wundef"
 SPARSE='sparse $(CHECKFLAGS) $(DEFS) $(DEFAULT_INCLUDES) $(INCLUDES) \
 		  $(AM_CPPFLAGS) $(CPPFLAGS) \
-		  -include $(top_builddir)/predef.h'
+		  -include $(top_builddir)/include/predef.h'
 AC_SUBST(SPARSE)
-AC_OUTPUT(Makefile predef.h)
+AC_OUTPUT(Makefile lib/Makefile lib/predef.h \
+	  src/Makefile src/test/Makefile src/mkfs/Makefile \
+	  src/convert/Makefile src/debug/Makefile src/fsck/Makefile \
+	  src/util/Makefile)
lib/Makefile.am new file +16 -0
@@ -0,0 +1,16 @@
+btrfsdir = $(includedir)/btrfs
+btrfs_HEADERS = bit-radix.h crc32c.h ctree.h disk-io.h extent-cache.h \
+                extent_io.h hash.h ioctl.h kerncompat.h list.h print-tree.h \
+		radix-tree.h rbtree.h transaction.h utils.h volumes.h
+lib_LTLIBRARIES = libbtrfs.la
+
+libbtrfs_la_SOURCES = ctree.c disk-io.c radix-tree.c extent-tree.c \
+		      print-tree.c root-tree.c dir-item.c hash.c \
+		      file-item.c inode-item.c inode-map.c crc32c.c \
+		      rbtree.c extent-cache.c extent_io.c volumes.c utils.c
+libbtrfs_la_LDFLAGS = -release @VERSION@
+
+if HAVE_SPARSE
+TESTS = $(libbtrfs_la_SOURCES)
+TESTS_ENVIRONMENT = @SPARSE@
+endif
src/Makefile.am new file +1 -0
@@ -0,0 +1 @@
+SUBDIRS = test mkfs convert debug fsck util
src/convert/Makefile.am new file +14 -0
@@ -0,0 +1,14 @@
+INCLUDES=-I$(top_srcdir)/lib
+
+sbin_PROGRAMS = $(BTRFS_CONVERT)
+EXTRA_PROGRAMS = btrfs-convert
+
+btrfs_convert_SOURCES = convert.c
+
+AM_CFLAGS = $(libext2fs_CFLAGS)
+LDADD = $(top_builddir)/lib/libbtrfs.la $(libext2fs_LIBS)
+
+if HAVE_SPARSE
+TESTS = $(btrfs_convert_SOURCES)
+TESTS_ENVIRONMENT = @SPARSE@
+endif
src/debug/Makefile.am new file +12 -0
@@ -0,0 +1,12 @@
+INCLUDES = -I$(top_srcdir)/lib
+
+sbin_PROGRAMS = debug-tree
+
+debug_tree_SOURCES = debug-tree.c
+
+LDADD = $(top_builddir)/lib/libbtrfs.la
+
+if HAVE_SPARSE
+TESTS = $(debug_tree_SOURCES)
+TESTS_ENVIRONMENT = @SPARSE@
+endif
src/fsck/Makefile.am new file +12 -0
@@ -0,0 +1,12 @@
+INCLUDES = -I$(top_srcdir)/lib
+
+sbin_PROGRAMS = btrfsck
+
+btrfsck_SOURCES = btrfsck.c bit-radix.c
+
+LDADD = $(top_builddir)/lib/libbtrfs.la
+
+if HAVE_SPARSE
+TESTS = $(btrfsck_SOURCES)
+TESTS_ENVIRONMENT = @SPARSE@
+endif
src/mkfs/Makefile.am new file +12 -0
@@ -0,0 +1,12 @@
+INCLUDES = -I$(top_srcdir)/lib
+
+sbin_PROGRAMS = mkfs.btrfs
+
+mkfs_btrfs_SOURCES = mkfs.c
+
+LDADD = $(top_builddir)/lib/libbtrfs.la
+
+if HAVE_SPARSE
+TESTS = $(mkfs_btrfs_SOURCES)
+TESTS_ENVIRONMENT = @SPARSE@
+endif
src/test/Makefile.am new file +18 -0
@@ -0,0 +1,18 @@
+INCLUDES = -I$(top_srcdir)/lib
+
+#bin_PROGRAMS = hasher dir-test quick-test random-test
+
+EXTRA_PROGRAMS = hasher dir-test quick-test random-test
+
+hasher_SOURCES = hasher.c
+dir_test_SOURCES = dir-test.c
+quick_test_SOURCES = quick-test.c
+random_test_SOURCES = random-test.c
+
+LDADD = $(top_builddir)/lib/libbtrfs.la
+
+if HAVE_SPARSE
+TESTS = $(hasher_SOURCES) $(dir_test_SOURCES) $(quick_test_SOURCES) \
+        $(random_test_SOURCES)
+TESTS_ENVIRONMENT = @SPARSE@
+endif
src/util/Makefile.am new file +14 -0
@@ -0,0 +1,14 @@
+INCLUDES = -I$(top_srcdir)/lib
+
+sbin_PROGRAMS = btrfsctl btrfs-vol btrfs-show
+
+btrfsctl_SOURCES = btrfsctl.c
+btrfs_vol_SOURCES = btrfs-vol.c
+btrfs_show_SOURCES = btrfs-show.c
+
+LDADD = $(top_builddir)/lib/libbtrfs.la
+
+if HAVE_SPARSE
+TESTS =	$(btrfsctl_SOURCES) $(btrfs_vol_SOURCES) $(btrfs_show_SOURCES)
+TESTS_ENVIRONMENT = @SPARSE@
+endif
#10 lore raw

PATCH 4/5 btrfs-progs: Add RPM spec file support

In reply to Jeff Mahoney

This patch contains a spec file for building btrfs-progs into an RPM package. It will be automatically regenerated at ./configure time to contain the latest version number.

---
 btrfs-progs.spec    |   66 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 btrfs-progs.spec.in |   66 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 configure.ac        |    2 -
 3 files changed, 133 insertions(+), 1 deletion(-)
btrfs-progs.spec new file +66 -0
@@ -0,0 +1,66 @@
+Name:		btrfs-progs
+BuildRequires:	autoconf automake e2fsprogs-devel
+Url:		http://oss.oracle.com/mercurial/mason/btrfs-progs-unstable
+Supplements:	filesystem(btrfs)
+Version:	0.15
+Release:	0
+Summary:	Btrfs File System Utilities
+License:	GPL v2 or later
+Group:		System/Filesystems
+AutoReqProv:	on
+Source:		%{name}-%{version}.tar.bz2
+BuildRoot:	%{_tmppath}/%{name}-%{version}-build
+
+%description
+This package includes utilities for creating, repairing, and tuning
+btrfs filesystems.
+
+%package -n libbtrfs
+Summary:	Btrfs Core Library
+Group:		System/Filessystems
+AutoReqProv:	on
+
+%description -n libbtrfs
+The core library for btrfs.
+
+%package -n libbtrfs-devel
+Summary:	Development files for libbtrfs
+Group:		System/Filesystems
+AutoReqProv:	on
+Requires:	libbtrfs = %version
+
+%description -n libbtrfs-devel
+Development files for libbtrfs.
+
+%debug_package
+%prep
+%setup -q -n btrfs-progs-%{version}
+
+%build
+autoreconf
+%define _exec_prefix /
+%configure
+make %{?jobs:-j %jobs}
+
+%install
+make install DESTDIR=${RPM_BUILD_ROOT}
+
+%files
+%defattr(-,root,root)
+%{_sbindir}/*
+
+%files -n libbtrfs
+%{_libdir}/libbtrfs.so
+%{_libdir}/libbtrfs-*.so
+
+%files -n libbtrfs-devel
+%{_includedir}/*
+%{_libdir}/libbtrfs.a
+%{_libdir}/libbtrfs.la
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%changelog
+* Thu Jun 12 2008 - [email protected]
+- Initial packaging.
btrfs-progs.spec.in new file +66 -0

66 lines not on this page · raw message

configure.ac +1 -1
@@ -50,4 +50,4 @@ AC_SUBST(SPARSE)
 AC_OUTPUT(Makefile lib/Makefile lib/predef.h \
 	  src/Makefile src/test/Makefile src/mkfs/Makefile \
 	  src/convert/Makefile src/debug/Makefile src/fsck/Makefile \
-	  src/util/Makefile)
+	  src/util/Makefile btrfs-progs.spec)
#11 lore raw

PATCH 5/5 btrfs-progs: Script to restructure the source as needed by patch 3

In reply to Jeff Mahoney

mkdir -p src ib
mkdir -p src/fsck src/debug src/test src/convert src/mkfs src/util

mv *.h *.h.in lib
mv btrfsck.c bit-radix.c src/fsck
mv debug-tree.c src/debug
mv hasher.c {dir,quick,random}-test.c src/test
mv convert.c src/convert
mv mkfs.c src/mkfs
mv btrfsctl.c btrfs-vol.c btrfs-show.c src/util
mv *.c lib

aclocal
libtoolize -c -f
automake --add-missing -c -f
autoconf