Jeff Mahoney
2008-Jun-13 17:17 UTC
Re: [patch 0/5] btrfs-progs: Create libbtrfs and package it up
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Christoph Hellwig wrote:> On Fri, Jun 13, 2008 at 04:09:06PM -0400, Jeff Mahoney wrote: >> 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----- -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Jeff Mahoney
2008-Jun-13 20:09 UTC
[patch 0/5] 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 -- Jeff Mahoney SUSE Labs -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
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. Signed-off-by: Jeff Mahoney <jeffm@suse.com> --- 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(-) --- /dev/null +++ b/AUTHORS @@ -0,0 +1 @@ + --- /dev/null +++ b/ChangeLog @@ -0,0 +1 @@ + --- a/Makefile +++ /dev/null @@ -1,69 +0,0 @@ -CC=gcc -AM_CFLAGS = -Wall -fno-strict-aliasing -D_FILE_OFFSET_BITS=64 -D_FORTIFY_SOURCE=2 -CFLAGS = -g -Werror -Os -objects = ctree.o disk-io.o radix-tree.o extent-tree.o print-tree.o \ - root-tree.o dir-item.o hash.o file-item.o inode-item.o \ - inode-map.o crc32c.o rbtree.o extent-cache.o extent_io.o \ - volumes.o utils.o -# -CHECKFLAGS=-D__linux__ -Dlinux -D__STDC__ -Dunix -D__unix__ -Wbitwise \ - -Wuninitialized -Wshadow -Wundef -DEPFLAGS = -Wp,-MMD,$(@D)/.$(@F).d,-MT,$@ - -INSTALL= install -prefix ?= /usr/local -bindir = $(prefix)/bin -LIBS=-luuid - -progs = btrfsctl btrfsck mkfs.btrfs debug-tree btrfs-show btrfs-vol - -# make C=1 to enable sparse -ifdef C - check=sparse $(CHECKFLAGS) -else - check=ls -endif - -.c.o: - $(check) $< - $(CC) $(DEPFLAGS) $(AM_CFLAGS) $(CFLAGS) -c $< - - -all: $(progs) - -btrfsctl: $(objects) btrfsctl.o - gcc $(CFLAGS) -o btrfsctl btrfsctl.o $(objects) $(LDFLAGS) $(LIBS) - -btrfs-vol: $(objects) btrfs-vol.o - gcc $(CFLAGS) -o btrfs-vol btrfs-vol.o $(objects) $(LDFLAGS) $(LIBS) - -btrfs-show: $(objects) btrfs-show.o - gcc $(CFLAGS) -o btrfs-show btrfs-show.o $(objects) $(LDFLAGS) $(LIBS) - -btrfsck: $(objects) btrfsck.o bit-radix.o - gcc $(CFLAGS) -o btrfsck btrfsck.o $(objects) bit-radix.o $(LDFLAGS) $(LIBS) - -mkfs.btrfs: $(objects) mkfs.o - gcc $(CFLAGS) -o mkfs.btrfs $(objects) mkfs.o $(LDFLAGS) $(LIBS) - -debug-tree: $(objects) debug-tree.o - gcc $(CFLAGS) -o debug-tree $(objects) debug-tree.o $(LDFLAGS) $(LIBS) - -dir-test: $(objects) dir-test.o - gcc $(CFLAGS) -o dir-test $(objects) dir-test.o $(LDFLAGS) $(LIBS) - -quick-test: $(objects) quick-test.o - gcc $(CFLAGS) -o quick-test $(objects) quick-test.o $(LDFLAGS) $(LIBS) - -convert: $(objects) convert.o - gcc $(CFLAGS) -o btrfs-convert $(objects) convert.o -lext2fs $(LDFLAGS) $(LIBS) - -clean : - rm -f $(progs) cscope.out *.o .*.d btrfs-convert - -install: $(progs) - $(INSTALL) -m755 -d $(DESTDIR)$(bindir) - $(INSTALL) $(progs) $(DESTDIR)$(bindir) - if [ -e btrfs-convert ]; then $(INSTALL) btrfs-convert $(DESTDIR)$(bindir); fi - --include .*.d --- /dev/null +++ b/Makefile.am @@ -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 --- /dev/null +++ b/NEWS @@ -0,0 +1 @@ + --- /dev/null +++ b/README @@ -0,0 +1 @@ + --- /dev/null +++ b/configure.ac @@ -0,0 +1,41 @@ +AC_INIT() +AC_CANONICAL_HOST +AC_PREREQ(2.50) + +AM_INIT_AUTOMAKE(btrfs-progs, 0.15) +AC_PROG_CC +AM_PROG_CC_C_O +AC_PROG_INSTALL +AC_PROG_MAKE_SET + +AC_HEADER_STDC +AC_HEADER_MAJOR + +AC_C_CONST +AC_C_INLINE +AC_SYS_LARGEFILE + +CFLAGS="$CFLAGS -Wall -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -Werror -Os" + +AC_ARG_ENABLE(convert-ext2fs, [ --enable-convert-ext2fs enable ext2fs support in convert tool (yes)], convert_ext2fs=$enableval, convert_ext2fs=yes) + +PKG_CHECK_MODULES(uuid, uuid) +CFLAGS="$CFLAGS $uuid_CFLAGS" +LIBS="$LIBS $uuid_LIBS" + +if test "$convert_ext2fs" = "yes"; then + PKG_CHECK_MODULES(libext2fs, ext2fs >= 1.40, , true) +fi + + +if test -z "$libext2fs_LIBS" ; then + AC_WARN(Will not build btrfs-convert: Nothing to do.) +else + BTRFS_CONVERT="btrfs-convert" + AC_SUBST(BTRFS_CONVERT) +fi + +PREDEFINED_MACROS=$(echo | gcc -dM -E - ) +AC_SUBST(PREDEFINED_MACROS) + +AC_OUTPUT(Makefile predef.h) --- /dev/null +++ b/predef.h.in @@ -0,0 +1,4 @@ +#ifndef _PREDEF_H_ +#define _PREDEF_H_ +@PREDEFINED_MACROS@ +#endif _PREDEF_H_ -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Jeff Mahoney
2008-Jun-13 20:09 UTC
[patch 2/5] btrfs-progs: Test for sparse support in configure
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@ Signed-off-by: Jeff Mahoney <jeffm@suse.com> --- Makefile.am | 9 +++------ configure.ac | 8 ++++++++ 2 files changed, 11 insertions(+), 6 deletions(-) --- a/Makefile.am +++ b/Makefile.am @@ -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 --- a/configure.ac +++ b/configure.ac @@ -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) -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Jeff Mahoney
2008-Jun-13 20:09 UTC
[patch 3/5] btrfs-progs: Restructure code layout, create libbtrfs
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. Signed-off-by: Jeff Mahoney <jeffm@suse.com> --- 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(-) --- a/Makefile.am +++ b/Makefile.am @@ -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 --- a/configure.ac +++ b/configure.ac @@ -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) --- /dev/null +++ b/lib/Makefile.am @@ -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 --- /dev/null +++ b/src/Makefile.am @@ -0,0 +1 @@ +SUBDIRS = test mkfs convert debug fsck util --- /dev/null +++ b/src/convert/Makefile.am @@ -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 --- /dev/null +++ b/src/debug/Makefile.am @@ -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 --- /dev/null +++ b/src/fsck/Makefile.am @@ -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 --- /dev/null +++ b/src/mkfs/Makefile.am @@ -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 --- /dev/null +++ b/src/test/Makefile.am @@ -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 --- /dev/null +++ b/src/util/Makefile.am @@ -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 -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
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. Signed-off-by: Jeff Mahoney <jeffm@suse.com> --- btrfs-progs.spec | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++ btrfs-progs.spec.in | 66 ++++++++++++++++++++++++++++++++++++++++++++++++++++ configure.ac | 2 - 3 files changed, 133 insertions(+), 1 deletion(-) --- /dev/null +++ b/btrfs-progs.spec @@ -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 - jeffm@suse.com +- Initial packaging. --- /dev/null +++ b/btrfs-progs.spec.in @@ -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: @VERSION@ +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 - jeffm@suse.com +- Initial packaging. --- a/configure.ac +++ b/configure.ac @@ -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) -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Jeff Mahoney
2008-Jun-13 20:09 UTC
[patch 5/5] btrfs-progs: Script to restructure the source as needed by patch 3
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 -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Christoph Hellwig
2008-Jun-13 20:29 UTC
Re: [patch 0/5] btrfs-progs: Create libbtrfs and package it up
On Fri, Jun 13, 2008 at 04:09:06PM -0400, Jeff Mahoney wrote:> 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. -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Miguel Sousa Filipe
2008-Jun-14 02:09 UTC
Re: [patch 1/5] btrfs-progs: convert to autotools
Hi all! On Fri, Jun 13, 2008 at 9:09 PM, Jeff Mahoney <jeffm@jeffreymahoney.com> wrote:> 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.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 -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Miguel Sousa Filipe wrote:> Hi all! > > On Fri, Jun 13, 2008 at 9:09 PM, Jeff Mahoney <jeffm@jeffreymahoney.com> wrote: >> 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. > > 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----- -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On Sat, Jun 14, 2008 at 2:22 PM, Jeff Mahoney <jeffm@suse.com> wrote:> -----BEGIN PGP SIGNED MESSAGE----- > Hash: SHA1 > > Miguel Sousa Filipe wrote: >> Hi all! >> >> On Fri, Jun 13, 2008 at 9:09 PM, Jeff Mahoney <jeffm@jeffreymahoney.com> wrote: >>> 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. >> >> 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. >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. -- Dongjun -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
Dongjun Shin wrote:> 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 -- To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html