There isn't any to get the version number when using libosinfo from python. Export the VERSION macros, similar to what gtk does. Signed-off-by: Cole Robinson <crobinso@xxxxxxxxxx> --- .gitignore | 1 + configure.ac | 1 + osinfo/Makefile.am | 1 + osinfo/osinfo.h | 1 + osinfo/osinfo_version.h.in | 45 +++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 49 insertions(+) create mode 100644 osinfo/osinfo_version.h.in diff --git a/.gitignore b/.gitignore index 869f15e..4489f79 100644 --- a/.gitignore +++ b/.gitignore @@ -38,6 +38,7 @@ osinfo/Libosinfo-1.0.gir osinfo/Libosinfo-1.0.typelib osinfo/libosinfo-1.0.vapi osinfo/osinfo_enum_types.[ch] +osinfo/osinfo_version.h *.gcno *.gcda coverage/ diff --git a/configure.ac b/configure.ac index 44a2b17..e746ac8 100644 --- a/configure.ac +++ b/configure.ac @@ -185,6 +185,7 @@ AC_CONFIG_FILES([ mingw-libosinfo.spec osinfo/Makefile osinfo/libosinfo-1.0.pc + osinfo/osinfo_version.h data/Makefile data/datamaps/Makefile data/devices/Makefile diff --git a/osinfo/Makefile.am b/osinfo/Makefile.am index 21c69e4..b5d8be0 100644 --- a/osinfo/Makefile.am +++ b/osinfo/Makefile.am @@ -94,6 +94,7 @@ OSINFO_HEADER_FILES = \ osinfo_resourceslist.h \ osinfo_tree.h \ osinfo_treelist.h \ + osinfo_version.h \ $(NULL) libosinfo_1_0_include_HEADERS = \ diff --git a/osinfo/osinfo.h b/osinfo/osinfo.h index cf287f2..8d0a595 100644 --- a/osinfo/osinfo.h +++ b/osinfo/osinfo.h @@ -65,6 +65,7 @@ #include <osinfo/osinfo_loader.h> #include <osinfo/osinfo_os_variant.h> #include <osinfo/osinfo_os_variantlist.h> +#include <osinfo/osinfo_version.h> #endif /* diff --git a/osinfo/osinfo_version.h.in b/osinfo/osinfo_version.h.in new file mode 100644 index 0000000..b724ce0 --- /dev/null +++ b/osinfo/osinfo_version.h.in @@ -0,0 +1,45 @@ +/* + * libosinfo: + * + * Copyright (C) 2014 Red Hat, Inc. + * + * 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.1 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, see + * <http://www.gnu.org/licenses/>. + */ + +#ifndef __OSINFO_VERSION_H__ +#define __OSINFO_VERSION_H__ + +/** + * OSINFO_MAJOR_VERSION: + * + * libosinfo major version number. + */ +#define OSINFO_MAJOR_VERSION (@LIBOSINFO_MAJOR_VERSION@) + +/** + * OSINFO_MINOR_VERSION: + * + * libosinfo minor version number. + */ +#define OSINFO_MINOR_VERSION (@LIBOSINFO_MINOR_VERSION@) + +/** + * OSINFO_MICRO_VERSION: + * + * libosinfo micro version number. + */ +#define OSINFO_MICRO_VERSION (@LIBOSINFO_MICRO_VERSION@) + +#endif /* __OSINFO_VERSION_H__ */ -- 1.9.0 _______________________________________________ Libosinfo mailing list Libosinfo@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/libosinfo