Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a public shared library, with "rpm -qa" for commit functionality #124

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions Makefile-lib-defines.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Shared variables between toplevel Makefile.am and doc/Makefile.am
# ...since gtk-doc forces use of recursive make =(
#
# Copyright (C) 2013 Colin Walters <walters@verbum.org>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.

librpmostree_public_headers = \
src/lib/rpmostree.h \
src/lib/rpmostree-db.h \
$(NULL)
52 changes: 52 additions & 0 deletions Makefile-lib.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Makefile for C source code
#
# Copyright (C) 2015 Colin Walters <walters@verbum.org>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.

include Makefile-lib-defines.am

lib_LTLIBRARIES += librpmostree-1.la

librpmostreeincludedir = $(includedir)/rpm-ostree-1
librpmostreeinclude_HEADERS = $(librpmostree_public_headers)

librpmostree_1_la_SOURCES = \
src/lib/rpmostree-db.c \
$(NULL)

librpmostree_1_la_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/libglnx -I$(srcdir)/src/libpriv -I$(srcdir)/src/lib \
$(PKGDEP_RPMOSTREE_CFLAGS)
librpmostree_1_la_LDFLAGS = -version-number 1:0:0 -Bsymbolic-functions -export-symbols-regex '^rpm_ostree_'
librpmostree_1_la_LIBADD = libglnx.la $(PKGDEP_RPMOSTREE_LIBS)

if BUILDOPT_INTROSPECTION
RpmOstree-1.0.gir: librpmostree-1.la Makefile
RpmOstree_1_0_gir_EXPORT_PACKAGES = rpm-ostree-1
RpmOstree_1_0_gir_INCLUDES = OSTree-1.0 Gio-2.0
RpmOstree_1_0_gir_CFLAGS = $(librpmostree_1_la_CFLAGS)
RpmOstree_1_0_gir_LIBS = librpmostree-1.la
RpmOstree_1_0_gir_SCANNERFLAGS = --warn-all --identifier-prefix=RpmOstree --symbol-prefix=rpm_ostree
RpmOstree_1_0_gir_FILES = $(librpmostreeinclude_HEADERS) $(filter-out %-private.h,$(librpmostree_1_la_SOURCES))
INTROSPECTION_GIRS += RpmOstree-1.0.gir
gir_DATA += RpmOstree-1.0.gir
typelib_DATA += RpmOstree-1.0.typelib

CLEANFILES += $(gir_DATA) $(typelib_DATA)
endif

pkgconfig_DATA += src/lib/rpm-ostree-1.pc

50 changes: 50 additions & 0 deletions Makefile-libutil.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Makefile for C source code
#
# Copyright (C) 2015 Colin Walters <walters@verbum.org>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.

include Makefile-lib-defines.am

privlib_LTLIBRARIES += librpmostreepriv.la

librpmostree_1_la_SOURCES = \
librpmostree-priv/rpmostree-cleanup.h \
librpmostree-priv/rpmostree-cleanup.c \
$(NULL)

librpmostreepriv_la_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/libglnx -I$(srcdir)/librpmostree-priv \
$(PKGDEP_RPMOSTREE_CFLAGS)
librpmostreepriv_la_LDFLAGS = -Bsymbolic-functions -export-symbols-regex '^rpmostreepriv_'
librpmostree_priv_la_LIBADD = libglnx.la $(PKGDEP_RPMOSTREE_LIBS)

if BUILDOPT_INTROSPECTION
RpmOstree-1.0.gir: libostree-1.la Makefile
RpmOstree_1_0_gir_EXPORT_PACKAGES = rpm-ostree-1
RpmOstree_1_0_gir_INCLUDES = OSTree-1 Gio-2.0
RpmOstree_1_0_gir_CFLAGS = $(librpmostree_1_la_CFLAGS)
RpmOstree_1_0_gir_LIBS = librpmostree-1.la
RpmOstree_1_0_gir_SCANNERFLAGS = --warn-all --identifier-prefix=RpmOstree --symbol-prefix=rpmostree
RpmOstree_1_0_gir_FILES = $(librpmostreeinclude_HEADERS) $(filter-out %-private.h,$(librpmostree_1_la_SOURCES))
INTROSPECTION_GIRS += RpmOstree-1.0.gir
gir_DATA += RpmOstree-1.0.gir
typelib_DATA += RpmOstree-1.0.typelib

CLEANFILES += $(gir_DATA) $(typelib_DATA)
endif

pkgconfig_DATA += librpmostree/rpm-ostree-1.pc

11 changes: 11 additions & 0 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@

include Makefile-decls.am

SUBDIRS += .

if ENABLE_GTK_DOC
SUBDIRS += doc
endif

privdatadir=$(pkglibdir)

ACLOCAL_AMFLAGS += -I m4 ${ACLOCAL_FLAGS}
Expand All @@ -33,8 +39,13 @@ libglnx_srcpath := $(srcdir)/libglnx
libglnx_cflags := $(PKGDEP_GIO_UNIX_CFLAGS) -I$(libglnx_srcpath)
libglnx_libs := $(PKGDEP_GIO_UNIX_LIBS)

include $(INTROSPECTION_MAKEFILE)
GIRS =
TYPELIBS = $(GIRS:.gir=.typelib)

include libglnx/Makefile-libglnx.am
noinst_LTLIBRARIES += libglnx.la
include Makefile-lib.am
include Makefile-rpm-ostree.am
include Makefile-tests.am
include Makefile-man.am
12 changes: 12 additions & 0 deletions autogen.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,18 @@ fi

mkdir -p m4

GTKDOCIZE=$(which gtkdocize 2>/dev/null)
if test -z $GTKDOCIZE; then
echo "You don't have gtk-doc installed, and thus won't be able to generate the documentation."
rm -f gtk-doc.make
cat > gtk-doc.make <<EOF
EXTRA_DIST =
CLEANFILES =
EOF
else
gtkdocize || exit $?
fi

if ! test -f libglnx/README.md; then
git submodule update --init
fi
Expand Down
10 changes: 9 additions & 1 deletion configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,12 @@ AC_PATH_PROG([XSLTPROC], [xsltproc])

GLIB_TESTS

GOBJECT_INTROSPECTION_REQUIRE([1.34.0])
m4_ifdef([GOBJECT_INTROSPECTION_CHECK], [
GOBJECT_INTROSPECTION_CHECK([1.34.0])
])
AM_CONDITIONAL(BUILDOPT_INTROSPECTION, test "x$found_introspection" = xyes)

GTK_DOC_CHECK([1.15], [--flavour no-tmpl])

AC_ARG_ENABLE(installed_tests,
AS_HELP_STRING([--enable-installed-tests],
Expand Down Expand Up @@ -91,6 +96,8 @@ if test x$enable_compose_tooling != xno; then RPM_OSTREE_FEATURES="$RPM_OSTREE_F

AC_CONFIG_FILES([
Makefile
doc/Makefile
src/lib/rpm-ostree-1.pc
])
AC_OUTPUT

Expand All @@ -99,4 +106,5 @@ echo "

usrbinatomic: $enable_usrbinatomic
compose tooling: $enable_compose_tooling
gtk-doc: $enable_gtk_doc
"
103 changes: 103 additions & 0 deletions doc/Makefile.am
Original file line number Diff line number Diff line change
@@ -0,0 +1,103 @@
# Copyright (C) 2013 Colin Walters <walters@verbum.org>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2 of the License, or (at your option) any later version.
#
# This library is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the
# Free Software Foundation, Inc., 59 Temple Place - Suite 330,
# Boston, MA 02111-1307, USA.

abs_top_builddir = @abs_top_builddir@

include ../Makefile-lib-defines.am

NULL =

# We require automake 1.6 at least.
AUTOMAKE_OPTIONS = 1.6

# The name of the module, e.g. 'glib'.
DOC_MODULE=rpmostree

# The top-level SGML file. You can change this if you want to.
DOC_MAIN_SGML_FILE=$(DOC_MODULE)-docs.xml

# The directory containing the source code. Relative to $(srcdir).
# gtk-doc will search all .c & .h files beneath here for inline comments
# documenting the functions and macros.
# e.g. DOC_SOURCE_DIR=../../../gtk
DOC_SOURCE_DIR=$(top_srcdir)/src/lib

# Extra options to pass to gtkdoc-scangobj. Not normally needed.
SCANGOBJ_OPTIONS= --version

# Extra options to supply to gtkdoc-scan.
# e.g. SCAN_OPTIONS=--deprecated-guards="GTK_DISABLE_DEPRECATED"
SCAN_OPTIONS= --rebuild-types

# Extra options to supply to gtkdoc-mkdb.
# e.g. MKDB_OPTIONS=--sgml-mode --output-format=xml
MKDB_OPTIONS=--sgml-mode --output-format=xml

# Extra options to supply to gtkdoc-mktmpl
# e.g. MKTMPL_OPTIONS=--only-section-tmpl
MKTMPL_OPTIONS=

# MKHTML_OPTIONS=--path="$(builddir)/html $(srcdir)/html"

# Extra options to supply to gtkdoc-fixref. Not normally needed.
# e.g. FIXXREF_OPTIONS=--extra-dir=../gdk-pixbuf/html --extra-dir=../gdk/html
FIXXREF_OPTIONS=

# Used for dependencies. The docs will be rebuilt if any of these change.
# e.g. HFILE_GLOB=$(top_srcdir)/gtk/*.h
# e.g. CFILE_GLOB=$(top_srcdir)/gtk/*.c
HFILE_GLOB=$(addprefix $(top_srcdir)/,$(librpmostree_public_headers))
CFILE_GLOB=$(top_srcdir)/src/lib/*.c

# Header files to ignore when scanning.
# e.g. IGNORE_HFILES=gtkdebug.h gtkintl.h
IGNORE_HFILES= \
$(NULL)

# Images to copy into HTML directory.
# e.g. HTML_IMAGES=$(top_srcdir)/gtk/stock-icons/stock_about_24.png
HTML_IMAGES=

# Extra SGML files that are included by $(DOC_MAIN_SGML_FILE).
# e.g. content_files=running.sgml building.sgml changes-2.0.sgml
content_files= \
overview.xml \
$(NULL)

# SGML files where gtk-doc abbrevations (#GtkWidget) are expanded
# These files must be listed here *and* in content_files
# e.g. expand_content_files=running.sgml
expand_content_files= \
version.xml \
$(NULL)

# CFLAGS and LDFLAGS for compiling gtkdoc-scangobj with your library.
# Only needed if you are using gtkdoc-scangobj to dynamically query widget
# signals and properties.
# e.g. INCLUDES=-I$(top_srcdir) -I$(top_builddir) $(GTK_DEBUG_FLAGS)
# e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib)
GTKDOC_LIBS=

# Hacks around gtk-doc brokenness for out of tree builds
rpmostree-sections.txt: $(srcdir)/rpmostree-sections.txt
cp $< $@

version.xml:
echo -n $(VERSION) > "$@"

# This includes the standard gtk-doc make rules, copied by gtkdocize.
include $(top_srcdir)/gtk-doc.make
18 changes: 18 additions & 0 deletions doc/overview.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
"http://www.oasis-open.org/docbook/xml/4.1.2/docbookx.dtd" [
<!ENTITY version SYSTEM "../version.xml">
]>
<part id="overview">
<title>rpm-ostree Overview</title>
<chapter id="rpmostree-intro">
<title>Introduction</title>
<para>
The project aims to bring together a hybrid of image-like upgrade
features (reliable replication, atomicity), with package-like
flexibility (seeing package sets inside trees, layering, partial live
updates). For more information, see the <literal>README.md</literal>
in the upstream project. This manual covers the gtk-doc.
</para>
</chapter>
</part>
24 changes: 24 additions & 0 deletions doc/rpmostree-docs.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
<?xml version="1.0"?>
<!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.3//EN"
"http://www.oasis-open.org/docbook/xml/4.3/docbookx.dtd"
[
<!ENTITY % local.common.attrib "xmlns:xi CDATA #FIXED 'http://www.w3.org/2003/XInclude'">
<!ENTITY version SYSTEM "version.xml">
]>
<book id="index">
<bookinfo>
<title>rpm-ostree Manual</title>
<releaseinfo>for &version;</releaseinfo>
</bookinfo>

<chapter xml:id="reference">
<title>API Reference</title>
<xi:include href="xml/librpmostree-dbquery.xml"/>

<index id="api-index-full">
<title>API Index</title>
<xi:include href="xml/api-index-full.xml"><xi:fallback /></xi:include>
</index>

</chapter>
</book>
9 changes: 9 additions & 0 deletions doc/rpmostree-sections.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<SECTION>
<FILE>librpmostree-dbquery</FILE>
RpmOstreeDbQueryResult
rpm_ostree_db_query_result_get_type
rpm_ostree_db_query_result_get_packages
rpm_ostree_db_query_ref
rpm_ostree_db_query_unref
rpm_ostree_db_query
</SECTION>
2 changes: 1 addition & 1 deletion libglnx
Submodule libglnx updated from 08d133 to e72bbd
Loading