diff --git a/Makefile.am b/Makefile.am index d9a2b396..963b0638 100644 --- a/Makefile.am +++ b/Makefile.am @@ -25,8 +25,8 @@ AM_CPPFLAGS = \ -DHELPER=\"$(bindir)/xdg-app-helper\" \ -DDBUSPROXY=\"$(libexecdir)/xdg-dbus-proxy\" \ -I$(srcdir)/libglnx \ - -I$(srcdir)/lib \ - -I$(builddir)/lib \ + -I$(srcdir)/common \ + -I$(builddir)/common \ $(NULL) triggersdir = $(pkgdatadir)/triggers @@ -44,7 +44,7 @@ libglnx_cflags := $(BASE_CFLAGS) "-I$(libglnx_srcpath)" libglnx_libs := $(BASE_LIBS) include libglnx/Makefile-libglnx.am.inc -include lib/Makefile.am.inc +include common/Makefile.am.inc include data/Makefile.am.inc include app/Makefile.am.inc include builder/Makefile.am.inc diff --git a/app/Makefile.am.inc b/app/Makefile.am.inc index 7d9fdb81..d8ead3aa 100644 --- a/app/Makefile.am.inc +++ b/app/Makefile.am.inc @@ -27,6 +27,6 @@ xdg_app_SOURCES = \ $(xdp_dbus_built_sources) \ $(NULL) -xdg_app_LDADD = $(BASE_LIBS) $(OSTREE_LIBS) $(SOUP_LIBS) $(LIBARCHIVE_LIBS) libglnx.la libxdgapp.la +xdg_app_LDADD = $(BASE_LIBS) $(OSTREE_LIBS) $(SOUP_LIBS) $(LIBARCHIVE_LIBS) libglnx.la libxdgapp-common.la xdg_app_CFLAGS = $(BASE_CFLAGS) $(OSTREE_CFLAGS) $(SOUP_CFLAGS) $(LIBARCHIVE_CFLAGS) diff --git a/builder/Makefile.am.inc b/builder/Makefile.am.inc index 3088ba81..85aae552 100644 --- a/builder/Makefile.am.inc +++ b/builder/Makefile.am.inc @@ -30,6 +30,6 @@ xdg_app_builder_SOURCES = \ builder/builder-utils.h \ $(NULL) -xdg_app_builder_LDADD = $(BASE_LIBS) $(OSTREE_LIBS) $(JSON_LIBS) $(SOUP_LIBS) $(LIBARCHIVE_LIBS) libglnx.la libxdgapp.la +xdg_app_builder_LDADD = $(BASE_LIBS) $(OSTREE_LIBS) $(JSON_LIBS) $(SOUP_LIBS) $(LIBARCHIVE_LIBS) libglnx.la libxdgapp-common.la xdg_app_builder_CFLAGS = $(BASE_CFLAGS) $(OSTREE_CFLAGS) $(JSON_CFLAGS) $(SOUP_CFLAGS) $(LIBARCHIVE_CFLAGS) diff --git a/common/Makefile.am.inc b/common/Makefile.am.inc new file mode 100644 index 00000000..9719ad27 --- /dev/null +++ b/common/Makefile.am.inc @@ -0,0 +1,66 @@ +noinst_LTLIBRARIES += libxdgapp-common.la + +dbus_built_sources = common/xdg-app-dbus.c common/xdg-app-dbus.h +systemd_dbus_built_sources = common/xdg-app-systemd-dbus.c common/xdg-app-systemd-dbus.h +BUILT_SOURCES += $(dbus_built_sources) $(systemd_dbus_built_sources) + +$(dbus_built_sources) : data/org.freedesktop.XdgApp.xml + $(AM_V_GEN) $(GDBUS_CODEGEN) \ + --interface-prefix org.freedesktop.XdgApp. \ + --c-namespace XdgApp \ + --generate-c-code $(builddir)/common/xdg-app-dbus \ + $(srcdir)/data/org.freedesktop.XdgApp.xml \ + $(NULL) + +$(systemd_dbus_built_sources) : data/org.freedesktop.systemd1.xml + $(AM_V_GEN) $(GDBUS_CODEGEN) \ + --interface-prefix org.freedesktop.systemd1. \ + --c-namespace Systemd \ + --generate-c-code $(builddir)/common/xdg-app-systemd-dbus \ + $(srcdir)/data/org.freedesktop.systemd1.xml \ + $(NULL) + +libxdgapp_common_la_SOURCES = \ + common/xdg-app-dir.c \ + common/xdg-app-dir.h \ + common/xdg-app-run.c \ + common/xdg-app-run.h \ + common/xdg-app-error.c \ + common/xdg-app-error.h \ + common/xdg-app-utils.c \ + common/xdg-app-utils.h \ + common/xdg-app-chain-input-stream.c \ + common/xdg-app-chain-input-stream.h \ + common/gvdb/gvdb-reader.h \ + common/gvdb/gvdb-format.h \ + common/gvdb/gvdb-reader.c \ + common/gvdb/gvdb-builder.h \ + common/gvdb/gvdb-builder.c \ + common/xdg-app-db.c \ + common/xdg-app-db.h \ + $(dbus_built_sources) \ + $(systemd_dbus_built_sources) \ + $(NULL) + +libxdgapp_common_la_CFLAGS = $(AM_CFLAGS) $(BASE_CFLAGS) $(OSTREE_CFLAGS) $(SOUP_CFLAGS) $(XAUTH_CFLAGS) -I$(srcdir)/dbus-proxy +libxdgapp_common_la_LIBADD = libglnx.la $(BASE_LIBS) $(OSTREE_LIBS) $(SOUP_LIBS) $(XAUTH_LIBS) + +bin_PROGRAMS += \ + xdg-app-helper \ + $(NULL) + +xdg_app_helper_SOURCES = common/xdg-app-helper.c +xdg_app_helper_LDADD = $(LIBSECCOMP_LIBS) +xdg_app_helper_CFLAGS = $(LIBSECCOMP_CFLAGS) + +install-exec-hook: +if DISABLE_USERNS +if PRIV_MODE_SETUID + $(SUDO_BIN) chown root $(DESTDIR)$(bindir)/xdg-app-helper + $(SUDO_BIN) chmod u+s $(DESTDIR)$(bindir)/xdg-app-helper +else +if PRIV_MODE_FILECAPS + $(SUDO_BIN) setcap cap_sys_admin+ep $(DESTDIR)$(bindir)/xdg-app-helper +endif +endif +endif diff --git a/lib/gvdb/.gitignore b/common/gvdb/.gitignore similarity index 100% rename from lib/gvdb/.gitignore rename to common/gvdb/.gitignore diff --git a/lib/gvdb/README b/common/gvdb/README similarity index 100% rename from lib/gvdb/README rename to common/gvdb/README diff --git a/lib/gvdb/gvdb-builder.c b/common/gvdb/gvdb-builder.c similarity index 100% rename from lib/gvdb/gvdb-builder.c rename to common/gvdb/gvdb-builder.c diff --git a/lib/gvdb/gvdb-builder.h b/common/gvdb/gvdb-builder.h similarity index 100% rename from lib/gvdb/gvdb-builder.h rename to common/gvdb/gvdb-builder.h diff --git a/lib/gvdb/gvdb-format.h b/common/gvdb/gvdb-format.h similarity index 100% rename from lib/gvdb/gvdb-format.h rename to common/gvdb/gvdb-format.h diff --git a/lib/gvdb/gvdb-reader.c b/common/gvdb/gvdb-reader.c similarity index 100% rename from lib/gvdb/gvdb-reader.c rename to common/gvdb/gvdb-reader.c diff --git a/lib/gvdb/gvdb-reader.h b/common/gvdb/gvdb-reader.h similarity index 100% rename from lib/gvdb/gvdb-reader.h rename to common/gvdb/gvdb-reader.h diff --git a/lib/gvdb/gvdb.doap b/common/gvdb/gvdb.doap similarity index 100% rename from lib/gvdb/gvdb.doap rename to common/gvdb/gvdb.doap diff --git a/lib/xdg-app-chain-input-stream.c b/common/xdg-app-chain-input-stream.c similarity index 100% rename from lib/xdg-app-chain-input-stream.c rename to common/xdg-app-chain-input-stream.c diff --git a/lib/xdg-app-chain-input-stream.h b/common/xdg-app-chain-input-stream.h similarity index 100% rename from lib/xdg-app-chain-input-stream.h rename to common/xdg-app-chain-input-stream.h diff --git a/lib/xdg-app-db.c b/common/xdg-app-db.c similarity index 100% rename from lib/xdg-app-db.c rename to common/xdg-app-db.c diff --git a/lib/xdg-app-db.h b/common/xdg-app-db.h similarity index 100% rename from lib/xdg-app-db.h rename to common/xdg-app-db.h diff --git a/lib/xdg-app-dir.c b/common/xdg-app-dir.c similarity index 100% rename from lib/xdg-app-dir.c rename to common/xdg-app-dir.c diff --git a/lib/xdg-app-dir.h b/common/xdg-app-dir.h similarity index 100% rename from lib/xdg-app-dir.h rename to common/xdg-app-dir.h diff --git a/lib/xdg-app-error.c b/common/xdg-app-error.c similarity index 100% rename from lib/xdg-app-error.c rename to common/xdg-app-error.c diff --git a/lib/xdg-app-error.h b/common/xdg-app-error.h similarity index 100% rename from lib/xdg-app-error.h rename to common/xdg-app-error.h diff --git a/lib/xdg-app-helper.c b/common/xdg-app-helper.c similarity index 100% rename from lib/xdg-app-helper.c rename to common/xdg-app-helper.c diff --git a/lib/xdg-app-run.c b/common/xdg-app-run.c similarity index 100% rename from lib/xdg-app-run.c rename to common/xdg-app-run.c diff --git a/lib/xdg-app-run.h b/common/xdg-app-run.h similarity index 100% rename from lib/xdg-app-run.h rename to common/xdg-app-run.h diff --git a/lib/xdg-app-utils.c b/common/xdg-app-utils.c similarity index 100% rename from lib/xdg-app-utils.c rename to common/xdg-app-utils.c diff --git a/lib/xdg-app-utils.h b/common/xdg-app-utils.h similarity index 100% rename from lib/xdg-app-utils.h rename to common/xdg-app-utils.h diff --git a/configure.ac b/configure.ac index 5b9d22d9..98937c4e 100644 --- a/configure.ac +++ b/configure.ac @@ -11,7 +11,7 @@ AC_DISABLE_STATIC LT_PREREQ([2.2.6]) LT_INIT([disable-static]) -AC_CONFIG_SRCDIR([lib/xdg-app-helper.c]) +AC_CONFIG_SRCDIR([common/xdg-app-helper.c]) AC_CONFIG_HEADERS([config.h]) AC_CONFIG_MACRO_DIR([m4]) AM_INIT_AUTOMAKE([1.11 no-define no-dist-gzip dist-xz tar-ustar foreign subdir-objects]) diff --git a/document-portal/Makefile.am.inc b/document-portal/Makefile.am.inc index cee21987..3b1607f3 100644 --- a/document-portal/Makefile.am.inc +++ b/document-portal/Makefile.am.inc @@ -41,5 +41,5 @@ xdg_document_portal_SOURCES = \ document-portal/xdp-fuse.c \ $(NULL) -xdg_document_portal_LDADD = $(BASE_LIBS) $(FUSE_LIBS) libxdgapp.la +xdg_document_portal_LDADD = $(BASE_LIBS) $(FUSE_LIBS) libxdgapp-common.la xdg_document_portal_CFLAGS = $(BASE_CFLAGS) $(OSTREE_CFLAGS) $(SOUP_CFLAGS) $(XAUTH_LIBS) $(FUSE_CFLAGS) -I$(srcdir)/document-portal -I$(builddir)/document-portal diff --git a/lib/Makefile.am.inc b/lib/Makefile.am.inc deleted file mode 100644 index 01e4ba34..00000000 --- a/lib/Makefile.am.inc +++ /dev/null @@ -1,66 +0,0 @@ -noinst_LTLIBRARIES += libxdgapp.la - -dbus_built_sources = lib/xdg-app-dbus.c lib/xdg-app-dbus.h -systemd_dbus_built_sources = lib/xdg-app-systemd-dbus.c lib/xdg-app-systemd-dbus.h -BUILT_SOURCES += $(dbus_built_sources) $(systemd_dbus_built_sources) - -$(dbus_built_sources) : data/org.freedesktop.XdgApp.xml - $(AM_V_GEN) $(GDBUS_CODEGEN) \ - --interface-prefix org.freedesktop.XdgApp. \ - --c-namespace XdgApp \ - --generate-c-code $(builddir)/lib/xdg-app-dbus \ - $(srcdir)/data/org.freedesktop.XdgApp.xml \ - $(NULL) - -$(systemd_dbus_built_sources) : data/org.freedesktop.systemd1.xml - $(AM_V_GEN) $(GDBUS_CODEGEN) \ - --interface-prefix org.freedesktop.systemd1. \ - --c-namespace Systemd \ - --generate-c-code $(builddir)/lib/xdg-app-systemd-dbus \ - $(srcdir)/data/org.freedesktop.systemd1.xml \ - $(NULL) - -libxdgapp_la_SOURCES = \ - lib/xdg-app-dir.c \ - lib/xdg-app-dir.h \ - lib/xdg-app-run.c \ - lib/xdg-app-run.h \ - lib/xdg-app-error.c \ - lib/xdg-app-error.h \ - lib/xdg-app-utils.c \ - lib/xdg-app-utils.h \ - lib/xdg-app-chain-input-stream.c \ - lib/xdg-app-chain-input-stream.h \ - lib/gvdb/gvdb-reader.h \ - lib/gvdb/gvdb-format.h \ - lib/gvdb/gvdb-reader.c \ - lib/gvdb/gvdb-builder.h \ - lib/gvdb/gvdb-builder.c \ - lib/xdg-app-db.c \ - lib/xdg-app-db.h \ - $(dbus_built_sources) \ - $(systemd_dbus_built_sources) \ - $(NULL) - -libxdgapp_la_CFLAGS = $(AM_CFLAGS) $(BASE_CFLAGS) $(OSTREE_CFLAGS) $(SOUP_CFLAGS) $(XAUTH_CFLAGS) -I$(srcdir)/dbus-proxy -libxdgapp_la_LIBADD = libglnx.la $(BASE_LIBS) $(OSTREE_LIBS) $(SOUP_LIBS) $(XAUTH_LIBS) - -bin_PROGRAMS += \ - xdg-app-helper \ - $(NULL) - -xdg_app_helper_SOURCES = lib/xdg-app-helper.c -xdg_app_helper_LDADD = $(LIBSECCOMP_LIBS) -xdg_app_helper_CFLAGS = $(LIBSECCOMP_CFLAGS) - -install-exec-hook: -if DISABLE_USERNS -if PRIV_MODE_SETUID - $(SUDO_BIN) chown root $(DESTDIR)$(bindir)/xdg-app-helper - $(SUDO_BIN) chmod u+s $(DESTDIR)$(bindir)/xdg-app-helper -else -if PRIV_MODE_FILECAPS - $(SUDO_BIN) setcap cap_sys_admin+ep $(DESTDIR)$(bindir)/xdg-app-helper -endif -endif -endif diff --git a/session-helper/Makefile.am.inc b/session-helper/Makefile.am.inc index c72ff81c..e283616e 100644 --- a/session-helper/Makefile.am.inc +++ b/session-helper/Makefile.am.inc @@ -26,5 +26,5 @@ xdg_app_session_helper_SOURCES = \ session-helper/xdg-app-resources.c \ $(NULL) -xdg_app_session_helper_LDADD = $(BASE_LIBS) libxdgapp.la +xdg_app_session_helper_LDADD = $(BASE_LIBS) libxdgapp-common.la xdg_app_session_helper_CFLAGS = $(BASE_CFLAGS) diff --git a/tests/Makefile.am.inc b/tests/Makefile.am.inc index 981d391a..756a23e5 100644 --- a/tests/Makefile.am.inc +++ b/tests/Makefile.am.inc @@ -4,7 +4,7 @@ testdb_LDADD = \ $(BASE_LIBS) \ $(OSTREE_LIBS) \ libglnx.la \ - libxdgapp.la \ + libxdgapp-common.la \ $(NULL) testdb_SOURCES = tests/testdb.c @@ -13,7 +13,7 @@ test_doc_portal_LDADD = \ $(BASE_LIBS) \ $(OSTREE_LIBS) \ libglnx.la \ - libxdgapp.la \ + libxdgapp-common.la \ $(NULL) test_doc_portal_SOURCES = tests/test-doc-portal.c $(xdp_dbus_built_sources)