Adds creation of doxygen documentation package. 38/85538/6
authorKrystian Kisielak <k.kisielak@samsung.com>
Thu, 25 Aug 2016 15:38:21 +0000 (17:38 +0200)
committerKrystian Kisielak <k.kisielak@samsung.com>
Fri, 2 Sep 2016 14:05:54 +0000 (16:05 +0200)
Change-Id: Ie115904d41dea90d5c26844c483ebc0c87fbaa7e
Signed-off-by: Krystian Kisielak <k.kisielak@samsung.com>
Makefile.am
configure.ac
doxygen.cfg [new file with mode: 0644]
packaging/libdbuspolicy.spec
src/dbuspolicy1/libdbuspolicy1.h

index 12f16c5..a46bb38 100644 (file)
@@ -101,3 +101,18 @@ src_test_libdbuspolicy1_signal_LDADD = $(CYNARA_LIBS) \
 
 src_test_libdbuspolicy1_method_LDADD = $(CYNARA_LIBS) \
        src/libinternal.a
+
+if ENABLE_DOXYGEN
+
+CLEANFILES += documentation
+
+all-local::    doxygen.stamp
+
+doxygen.stamp::        doxygen.cfg
+               doxygen $<
+               echo Timestamp > $@
+
+install-data-local::
+               $(MKDIR_P) $(DESTDIR)/${docdir}
+               cp -r documentation/* $(DESTDIR)/${docdir}
+endif
index 8e9a190..3a0e44f 100644 (file)
@@ -54,6 +54,19 @@ if test "x$with_tests" = "xyes"; then
    AC_DEFINE(LIBDBUSPOLICY_TESTS_API, 1, [Define if tests are enabled])
 fi
 
+
+AC_ARG_ENABLE([doxygen],
+        AS_HELP_STRING([--enable-doxygen], [enable doxygen documentation @<:@default=disabled@:>@]),
+        [], [enable_doxygen=no])
+AM_CONDITIONAL([ENABLE_DOXYGEN], [test x$enable_doxygen = xyes])
+AS_IF([test "x$enable_doxygen" = "xyes"], [
+       AC_CHECK_PROGS([DOXYGEN], [doxygen])
+       if test -z "$DOXYGEN"
+               then AC_MSG_ERROR([Doxygen not found!])
+               enable_doxygen=no
+       fi
+])
+
 AC_CHECK_FUNCS([ \
        __secure_getenv \
        secure_getenv\
@@ -108,4 +121,5 @@ AC_MSG_RESULT([
 
         logging:                ${enable_logging}
         debug:                  ${enable_debug}
+       doxygen:                ${enable_doxygen}
 ])
diff --git a/doxygen.cfg b/doxygen.cfg
new file mode 100644 (file)
index 0000000..ff1c452
--- /dev/null
@@ -0,0 +1,17 @@
+PROJECT_NAME           = "libdbuspolicy"
+OUTPUT_DIRECTORY       = documentation
+GENERATE_LATEX         = NO
+GENERATE_MAN           = NO
+GENERATE_RTF           = NO
+CASE_SENSE_NAMES       = NO
+INPUT                  = src/dbuspolicy1/libdbuspolicy1.h
+JAVADOC_AUTOBRIEF      = YES
+EXTRACT_PRIVATE        = YES
+EXTRACT_STATIC         = YES
+TYPEDEF_HIDES_STRUCT   = YES
+INLINE_SOURCES         = YES
+REFERENCED_BY_RELATION = YES
+REFERENCES_RELATION    = YES
+SEARCHENGINE           = NO
+COMPACT_LATEX =        YES
+LATEX_HIDE_INDICES     = YES
index 9713e86..590dd18 100644 (file)
@@ -9,7 +9,6 @@ Source1001:     %{name}.manifest
 BuildRequires:  boost-devel
 BuildRequires:  pkgconfig(cynara-client)
 
-
 %package devel
 Summary:        Helper library for fine-grained userspace policy handling-development package
 Requires:       %{name} = %{version}
@@ -23,6 +22,16 @@ libdbuspolicy is a helper library for fine-grained userspace
 policy handling (with SMACK support). This package contains
 development files.
 
+
+%if 0%{?enable_doxygen:1}
+%package doc
+Summary:        Documentation for libdbuspolicy
+BuildRequires: doxygen
+
+%description doc
+Doxygen documentation for libdbuspolicy.
+%endif
+
 %prep
 %setup -q
 cp %{SOURCE1001} .
@@ -30,8 +39,12 @@ cp %{SOURCE1001} .
 %build
 %reconfigure --libdir=%{_libdir}       --prefix=/usr \
 %if 0%{?test_version}
---enable-tests
+--enable-tests \
 %endif
+%if 0%{?enable_doxygen:1}
+--enable-doxygen
+%endif
+
 make
 make check
 
@@ -55,4 +68,9 @@ rm %{buildroot}%{_libdir}/libdbuspolicy1.la
 %{_libdir}/libdbuspolicy1.so
 %manifest %{name}.manifest
 
+%if 0%{?enable_doxygen:1}
+%files doc
+%defattr(-,root,root)
+%{_datadir}/doc/dbuspolicy/*
+%endif
 %changelog
index 35da6fe..b6ffdae 100644 (file)
@@ -14,6 +14,9 @@
  * limitations under the License.
 */
 
+/**
+ * \file libdbuspolicy1.h
+ */
 #ifndef _LIBDBUSPOLICY1_H_
 #define _LIBDBUSPOLICY1_H_