diff --git a/include/comp/compressor.h b/include/comp/compressor.h index 51eb044..61f391f 100644 --- a/include/comp/compressor.h +++ b/include/comp/compressor.h @@ -5,7 +5,7 @@ #include #include -#include "pkgformat.h" +#include "pkg/pkgformat.h" typedef struct compressor_stream_t { ssize_t (*write)(struct compressor_stream_t *stream, const uint8_t *in, diff --git a/include/pkgformat.h b/include/pkg/pkgformat.h similarity index 100% rename from include/pkgformat.h rename to include/pkg/pkgformat.h diff --git a/include/pkgio.h b/include/pkg/pkgio.h similarity index 100% rename from include/pkgio.h rename to include/pkg/pkgio.h diff --git a/include/pkgreader.h b/include/pkg/pkgreader.h similarity index 100% rename from include/pkgreader.h rename to include/pkg/pkgreader.h diff --git a/include/pkgwriter.h b/include/pkg/pkgwriter.h similarity index 100% rename from include/pkgwriter.h rename to include/pkg/pkgwriter.h diff --git a/lib/Makemodule.am b/lib/Makemodule.am index 1d182c4..9fa19f6 100644 --- a/lib/Makemodule.am +++ b/lib/Makemodule.am @@ -28,4 +28,9 @@ libcomp_a_CFLAGS += $(XZ_CFLAGS) libcomp_a_CPPFLAGS += -DWITH_LZMA endif -noinst_LIBRARIES += libutil.a libfilelist.a libcomp.a +libpkg_a_SOURCES = include/pkg/pkgformat.h include/pkg/pkgreader.h +libpkg_a_SOURCES += include/pkg/pkgio.h include/pkg/pkgwriter.h +libpkg_a_SOURCES += lib/pkg/pkgreader.c lib/pkg/pkgwriter.c +libpkg_a_SOURCES += lib/pkg/pkg_unpack.c lib/pkg/pkgio_rd_image_entry.c + +noinst_LIBRARIES += libutil.a libfilelist.a libcomp.a libpkg.a diff --git a/main/pkg_unpack.c b/lib/pkg/pkg_unpack.c similarity index 99% rename from main/pkg_unpack.c rename to lib/pkg/pkg_unpack.c index 5a7fe20..fbf3b6b 100644 --- a/main/pkg_unpack.c +++ b/lib/pkg/pkg_unpack.c @@ -8,7 +8,7 @@ #include #include -#include "pkgio.h" +#include "pkg/pkgio.h" #include "util/util.h" static int create_hierarchy(int dirfd, image_entry_t *list, int flags) diff --git a/main/pkgio_rd_image_entry.c b/lib/pkg/pkgio_rd_image_entry.c similarity index 99% rename from main/pkgio_rd_image_entry.c rename to lib/pkg/pkgio_rd_image_entry.c index 714237b..15177d5 100644 --- a/main/pkgio_rd_image_entry.c +++ b/lib/pkg/pkgio_rd_image_entry.c @@ -4,7 +4,7 @@ #include #include -#include "pkgio.h" +#include "pkg/pkgio.h" #include "util/util.h" static int read_extra(pkg_reader_t *pkg, image_entry_t *ent) diff --git a/main/pkgreader.c b/lib/pkg/pkgreader.c similarity index 99% rename from main/pkgreader.c rename to lib/pkg/pkgreader.c index d3966d6..9e15962 100644 --- a/main/pkgreader.c +++ b/lib/pkg/pkgreader.c @@ -10,7 +10,7 @@ #include "comp/compressor.h" #include "util/util.h" -#include "pkgreader.h" +#include "pkg/pkgreader.h" struct pkg_reader_t { int fd; diff --git a/main/pkgwriter.c b/lib/pkg/pkgwriter.c similarity index 99% rename from main/pkgwriter.c rename to lib/pkg/pkgwriter.c index 37f7b33..1781f1f 100644 --- a/main/pkgwriter.c +++ b/lib/pkg/pkgwriter.c @@ -6,7 +6,7 @@ #include #include -#include "pkgwriter.h" +#include "pkg/pkgwriter.h" #include "util/util.h" struct pkg_writer_t { diff --git a/main/Makemodule.am b/main/Makemodule.am index c3a62a3..7b35767 100644 --- a/main/Makemodule.am +++ b/main/Makemodule.am @@ -1,12 +1,10 @@ -pkg_SOURCES = include/pkgformat.h include/pkgreader.h include/pkgio.h -pkg_SOURCES += include/command.h include/pkgwriter.h include/depgraph.h -pkg_SOURCES += main/pkg.c main/command.c main/pkgreader.c -pkg_SOURCES += main/pkgwriter.c main/pkgio_rd_image_entry.c main/pkg_unpack.c +pkg_SOURCES = include/command.h include/depgraph.h +pkg_SOURCES += main/pkg.c main/command.c pkg_SOURCES += main/depgraph/collect.c main/depgraph/pkglist.c pkg_SOURCES += main/depgraph/tsort.c pkg_CFLAGS = $(AM_CFLAGS) -pkg_LDADD = libutil.a libfilelist.a libcomp.a +pkg_LDADD = libpkg.a libutil.a libfilelist.a libcomp.a ##### commands ##### diff --git a/main/cmd/dump/dump.h b/main/cmd/dump/dump.h index 7ba544e..eff28ed 100644 --- a/main/cmd/dump/dump.h +++ b/main/cmd/dump/dump.h @@ -12,10 +12,11 @@ #include "filelist/image_entry.h" -#include "pkgformat.h" -#include "pkgreader.h" +#include "pkg/pkgformat.h" +#include "pkg/pkgreader.h" +#include "pkg/pkgio.h" + #include "command.h" -#include "pkgio.h" typedef enum { DUMP_TOC = 0x01, diff --git a/main/cmd/install.c b/main/cmd/install.c index dd4944b..f04fe2c 100644 --- a/main/cmd/install.c +++ b/main/cmd/install.c @@ -7,10 +7,10 @@ #include #include +#include "pkg/pkgio.h" #include "util/util.h" #include "depgraph.h" #include "command.h" -#include "pkgio.h" enum { INSTALL_MODE_INSTALL = 0, diff --git a/main/cmd/pack/pack.h b/main/cmd/pack/pack.h index 102b13b..8f155dc 100644 --- a/main/cmd/pack/pack.h +++ b/main/cmd/pack/pack.h @@ -22,8 +22,8 @@ #include "filelist/image_entry.h" #include "comp/compressor.h" -#include "pkgformat.h" -#include "pkgwriter.h" +#include "pkg/pkgformat.h" +#include "pkg/pkgwriter.h" #include "command.h" typedef struct dependency_t { diff --git a/main/cmd/unpack.c b/main/cmd/unpack.c index e213c86..7317ff8 100644 --- a/main/cmd/unpack.c +++ b/main/cmd/unpack.c @@ -7,9 +7,9 @@ #include "util/util.h" -#include "pkgreader.h" +#include "pkg/pkgreader.h" +#include "pkg/pkgio.h" #include "command.h" -#include "pkgio.h" static const struct option long_opts[] = { { "root", required_argument, NULL, 'r' }, diff --git a/main/depgraph/collect.c b/main/depgraph/collect.c index 60a0a47..2c9275a 100644 --- a/main/depgraph/collect.c +++ b/main/depgraph/collect.c @@ -3,7 +3,7 @@ #include #include -#include "pkgreader.h" +#include "pkg/pkgreader.h" #include "depgraph.h" int collect_dependencies(int repofd, struct pkg_dep_list *list)