Commit af5e836f authored by Pavel Hrdina's avatar Pavel Hrdina

add packaging

Signed-off-by: Pavel Hrdina's avatarPavel Hrdina <phrdina@redhat.com>
parent 54bc376e
/libvirt-dbus
/AUTHORS
/INSTALL
/Makefile
/Makefile.in
/aclocal.m4
/autom4te.cache/
/build-aux/
/config.h
/config.h.in
/config.log
/config.status
/configure
/libvirt-dbus.spec
/src/.deps/
/src/Makefile
/src/Makefile.in
/stamp-h1
libvirt-dbus Authors
====================
The primary maintainers of libvirt-dbus are:
Lars Karlitski <lars@karlitski.net>
Pavel Hrdina <phrdina@redhat.com>
Patches have been received from:
#authorslist#
... send patches to get your name added ...
This diff is collapsed.
Tips for hacking on libvirt-dbus
================================
Coding style rules
- Opening & closing braces for functions should be at start of line
int
foo(int bar)
{
...
}
Not
int
foo(int bar) {
...
}
- Opening brace for if/while/for loops should be at the end of line
if (foo) {
bar;
wizz;
}
Not
if (foo)
{
bar;
wizz;
}
Rationale: putting every if/while/for opening brace on a new line
expands function length too much
- If a brace needs to be used for one clause in an if/else statement,
it should be used for both clauses, even if the other clauses are
only single statements. eg
if (foo) {
bar;
wizz;
} else {
eek;
}
Not
if (foo) {
bar;
wizz;
} else
eek;
- Function parameter attribute annotations should follow the parameter
name, eg
int
foo(int bar G_GNUC_UNUSED)
{
}
Not
int
foo(G_GNUC_UNUSED int bar)
{
}
Rationale: Adding / removing G_GNUC_UNUSED should not cause the
rest of the line to move around since that obscures diffs.
- There should be no space between function names & open brackets eg
int
foo(int bar)
{
}
Not
int
foo (int bar)
{
}
- To keep lines under 80 characters (where practical), multiple parameters
should be on new lines. Do not attempt to line up parameters vertically
eg
int
foo(int bar,
unsigned long wizz)
{
}
Not
int
foo(int bar, unsigned long wizz)
{
}
Not
int
foo(int bar,
unsigned long wizz)
{
}
Rationale: attempting vertical alignment causes bigger diffs when
modifying code if type names change causing whitespace re-alignment.
- Usage of goto should follow one of the following patterns, and
label naming conventions. In particular any exit path jumps should
obay the 'cleanup' vs 'error' label naming
* Interrupted system calls:
retry:
err = func()
if (err < 0 && errno == EINTR)
goto retry;
Alternate label name: retry_func:
* Shared cleanup paths:
int
foo(int bar)
{
int ret = -1;
if (something goes wrong)
goto cleanup;
ret = 0;
cleanup:
...shared cleanup code...
return ret;
}
* Separate error exit paths:
int
foo(int bar)
{
if (something goes wrong)
goto error;
return 0;
error:
...error cleanup code...
return -1;
}
* Separate and shared error exit paths:
int
foo(int bar)
{
int ret = -1;
if (something very bad goes wrong)
goto error;
if (something goes wrong)
goto cleanup;
ret = 0;
cleanup:
...shared cleanup code...
return 0;
error:
...error cleanup code...
return -1;
}
libvirt-dbus: src/main.c src/manager.c src/domain.c src/util.c | src/util.h src/manager.h
gcc -D_GNU_SOURCE -ggdb3 -Wall `pkg-config --cflags --libs libsystemd libvirt` -o $@ $^
SUBDIRS = src
EXTRA_DIST = \
$(PACKAGE).spec \
$(PACKAGE).spec.in \
AUTHORS.in \
$(NULL)
DISTCLEAN_FILES = $(PACKAGE).spec
rpm: clean
@(unset CDPATH ; $(MAKE) dist && rpmbuild -ta $(distdir).tar.gz)
dist-hook: gen-AUTHORS
# Generate the AUTHORS file (with all entries since the switch to git)
# and insert it into the directory we're about to use to create a tarball.
.PHONY: gen-AUTHORS
gen-AUTHORS:
$(AM_V_GEN)if test -d $(srcdir)/.git; then \
out="`cd $(srcdir) && git log --pretty=format:'%aN <%aE>' | sort -u`" && \
perl -p -e "s/#authorslist#// and print '$$out'" \
< $(srcdir)/AUTHORS.in > $(distdir)/AUTHORS-tmp && \
mv -f $(distdir)/AUTHORS-tmp $(distdir)/AUTHORS ; \
fi
libvirt-dbus News
=================
0.0.1 - Jun 28, 2017
====================
First beta release.
libvirt-dbus
============
libvirt is a C toolkit to interact with the virtualization capabilities
of recent versions of Linux (and other OSes). It is free software
available under the GNU Lesser General Public License. Virtualization on
the Linux Operating System means the ability to run multiple instances of
Operating Systems concurrently on a single hardware system where the basic
resources are driven by a Linux instance. The library aim at providing
long term stable C API initially for the Xen paravirtualization but
should be able to integrate other virtualization mechanisms if needed.
libvirt-dbus wraps libvirt to provide a high-level object-oriented API better
suited for dbus-based applications
libvirt-dbus is Free Software and licenced under LGPLv2+.
The latest official releases can be found at:
ftp://libvirt.org/libvirt/dbus/
NB: at this time, libvirt-dbus is *NOT* considered API/ABI stable. Future
releases may still include API/ABI incompatible changes.
Dependencies / supported platforms
==================================
The libvirt-dbus projects attempts to be moderately conservative
about updating the minimum required versions of external package
dependencies, to strike a balance between enabling use of new
features while minimizing inconvenience for downstream developers
on distro platforms with specific shipped versions.
There are roughly two classes of Linux distro - short lifetime
(Fedora, Ubuntu non-LTS, etc) and extended lifetime (RHEL, CentOS,
Debian, Ubuntu LTS). Based on this classification, the libvirt-dbus
project will generally aim to ensure build support for
- Most recent 2 releases of short lifetime distros
- Most recent major release of extended lifetime distros,
with most recent 2 minor updates
The project will consider RHEL, Fedora, Debian, Ubuntu LTS, Ubuntu,
OpenSUSE and SUSE (SLES/SLED) distros to be a representative subset
of distros when determining min required versions of external deps
that is reasonable to target. Other distros of similar release vintage
will typically have similar versions to at least one of these distros.
In the case of Debian, the project may at times choose to require use
of an update from the backports repository.
At any time, it may be possible to build on versions of distros
that are older than those implied by this policy, but the project
will not guarantee this remains the case in future releases. The
min required package versions of external dependencies may be
raised in future releases based on this distro build target policy.
The packages required to build libvirt-dbus are
- systemd-211
- libvirt
Patches submissions
===================
Patch submissions are welcomed from any interested contributor. Please
send them to the main libvir-list mailing list
libvir-list@redhat.com
Questions about usage / deployment can be send to the end users mailing
list
libvirt-users@redhat.com
For further information about mailing lists & contacting the developers,
please consult
http://libvirt.org/contact.html
--End
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
set -e
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
THEDIR=`pwd`
cd $srcdir
DIE=0
for prog in autoreconf automake autoconf libtoolize
do
($prog --version) < /dev/null > /dev/null 2>&1 || {
echo
echo "You must have $prog installed to compile libvirt-dbus."
DIE=1
}
done
if test "$DIE" -eq 1; then
exit 1
fi
if test -z "$*"; then
echo "I am going to run ./configure with no args - if you "
echo "wish to pass any extra arguments to it, please specify them on "
echo "the $0 command line."
fi
# Real AUTHORS is auto-generated from GIT logs at
# make dist time, but automake requires that it
# exists at all times :-(
touch AUTHORS
mkdir -p build-aux
autoreconf -if
cd $THEDIR
if test "x$1" = "x--system"; then
shift
prefix=/usr
libdir=$prefix/lib
sysconfdir=/etc
localstatedir=/var
if [ -d /usr/lib64 ]; then
libdir=$prefix/lib64
fi
EXTRA_ARGS="--prefix=$prefix --sysconfdir=$sysconfdir --localstatedir=$localstatedir --libdir=$libdir"
fi
$srcdir/configure $EXTRA_ARGS "$@" && {
echo
echo "Now type 'make' to compile libvirt-dbus."
}
AC_INIT([libvirt-dbus], [0.0.1], [libvir-list@redhat.com], [], [http://libvirt.org])
AC_CONFIG_SRCDIR(src/main.c)
AC_CONFIG_AUX_DIR([build-aux])
AC_CONFIG_HEADERS([config.h])
dnl Make automake keep quiet about wildcards & other GNUmake-isms
AM_INIT_AUTOMAKE([-Wno-portability])
AC_CANONICAL_HOST
AM_SILENT_RULES([yes])
LIBVIRT_REQUIRED=1.2.8
SYSTEMD_REQUIRED=211
AC_SUBST([LIBVIRT_REQUIRED]) dnl used in the .spec file
AC_SUBST([SYSTEMD_REQUIRED]) dnl used in the .spec file
LIBVIRT_DBUS_MAJOR_VERSION=`echo $VERSION | awk -F. '{print $1}'`
LIBVIRT_DBUS_MINOR_VERSION=`echo $VERSION | awk -F. '{print $2}'`
LIBVIRT_DBUS_MICRO_VERSION=`echo $VERSION | awk -F. '{print $3}'`
LIBVIRT_DBUS_VERSION=$LIBVIRT_DBUS_MAJOR_VERSION.$LIBVIRT_DBUS_MINOR_VERSION.$LIBVIRT_DBUS_MICRO_VERSION$LIBVIRT_DBUS_MICRO_VERSION_SUFFIX
LIBVIRT_DBUS_VERSION_NUMBER=`expr $LIBVIRT_DBUS_MAJOR_VERSION \* 1000000 + $LIBVIRT_dbus_MINOR_VERSION \* 1000 + $LIBVIRT_DBUS_MICRO_VERSION`
AC_SUBST([LIBVIRT_DBUS_MAJOR_VERSION])
AC_SUBST([LIBVIRT_DBUS_MINOR_VERSION])
AC_SUBST([LIBVIRT_DBUS_MICRO_VERSION])
AC_SUBST([LIBVIRT_DBUS_VERSION])
AC_SUBST([LIBVIRT_DBUS_VERSION_INFO])
AC_SUBST([LIBVIRT_DBUS_VERSION_NUMBER])
AC_PROG_CC
AM_PROG_CC_C_O
PKG_CHECK_MODULES(LIBVIRT, libvirt >= $LIBVIRT_REQUIRED)
PKG_CHECK_MODULES(SYSTEMD, libsystemd >= $SYSTEMD_REQUIRED)
AC_ARG_WITH(dbus-services,
[AC_HELP_STRING([--with-dbus-services=<dir>],
[where D-BUS session services directory is])])
if ! test -z "$with_dbus_services" ; then
DBUS_SERVICES_DIR="$with_dbus_services"
else
DBUS_SERVICES_DIR="$datadir/dbus-1/services"
fi
AC_SUBST(DBUS_SERVICES_DIR)
AC_OUTPUT(Makefile
src/Makefile
libvirt-dbus.spec)
# -*- rpm-spec -*-
%define libvirt_version @LIBVIRT_REQUIRED@
%define systemd_version @SYSTEMD_REQUIRED@
Name: @PACKAGE@
Version: @VERSION@
Release: 1%{?dist}%{?extra_release}
Summary: libvirt dbus API binding
Group: Development/Libraries
License: LGPLv2+
URL: http://libvirt.org/
Source0: ftp://libvirt.org/libvirt/dbus/%{name}-%{version}.tar.gz
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: libvirt-devel >= %{libvirt_version}
BuildRequires: systemd-devel >= %{systemd_version}
Requires: libvirt-libs >= %{libvirt_version}
Requires: systemd >= %{systemd_version}
%description
This package provides integration between libvirt and the DBus
%prep
%setup -q
%build
%configure
%__make %{?_smp_mflags}
%install
rm -rf $RPM_BUILD_ROOT
%__make install DESTDIR=$RPM_BUILD_ROOT
%clean
rm -rf $RPM_BUILD_ROOT
%files
%defattr(-,root,root,-)
%doc README COPYING AUTHORS NEWS
%{_bindir}/libvirt-dbus
%{_datadir}/dbus-1/services/org.libvirt.service
%changelog
AM_CPPFLAGS = \
-I$(top_srcdir)/src
DAEMON_SOURCES = \
main.c \
domain.c domain.h \
manager.c manager.h \
util.c util.h
EXTRA_DIST = \
$(DAEMON_SOURCES)
CLEANFILES =
bin_PROGRAMS = libvirt-dbus
libvirt_dbus_SOURCES = $(DAEMON_SOURCES)
libvirt_dbus_CFLAGS = \
$(SYSTEMD_CFLAGS) \
$(LIBVIRT_CFLAGS)
libvirt_dbus_LDFLAGS = \
$(SYSTEMD_LDFLAGS) \
$(LIBVIRT_LDFLAGS)
libvirt_dbus_LDADD = \
$(SYSTEMD_LIBS) \
$(LIBVIRT_LIBS)
service_in_files = \
org.libvirt.service.in
servicedir = $(DBUS_SERVICES_DIR)
service_DATA = $(service_in_files:.service.in=.service)
EXTRA_DIST += \
$(service_in_files)
CLEANFILES += \
$(service_DATA)
org.libvirt.service: org.libvirt.service.in
$(AM_V_GEN)sed \
-e 's|[@]bindir[@]|$(bindir)|g' \
< $< > $@-t && \
mv $@-t $@
[D-BUS Service]
Name=org.libvirt
Exec=@bindir@/libvirt-dbus
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment