summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTing-Wei Lan <lantw44@gmail.com>2013-07-31 00:26:01 +0800
committerLAN-TW <lantw44@gmail.com>2013-07-31 01:08:29 +0800
commit741e1dd0c7b8fe8b8d7df03cc8f21f5731d39f66 (patch)
treeec6dbf7fa50a6414b3d91b9a029f7258825410f5
parent0518cc8d8452734000adb2f872058e14004a8e57 (diff)
downloadgsoc2013-libgnome-autoar-741e1dd0c7b8fe8b8d7df03cc8f21f5731d39f66.tar
gsoc2013-libgnome-autoar-741e1dd0c7b8fe8b8d7df03cc8f21f5731d39f66.tar.gz
gsoc2013-libgnome-autoar-741e1dd0c7b8fe8b8d7df03cc8f21f5731d39f66.tar.bz2
gsoc2013-libgnome-autoar-741e1dd0c7b8fe8b8d7df03cc8f21f5731d39f66.tar.lz
gsoc2013-libgnome-autoar-741e1dd0c7b8fe8b8d7df03cc8f21f5731d39f66.tar.xz
gsoc2013-libgnome-autoar-741e1dd0c7b8fe8b8d7df03cc8f21f5731d39f66.tar.zst
gsoc2013-libgnome-autoar-741e1dd0c7b8fe8b8d7df03cc8f21f5731d39f66.zip
Fix build system after becoming a shared library
-rw-r--r--.gitignore36
-rw-r--r--Makefile.am90
-rwxr-xr-xautogen.sh21
-rw-r--r--configure.ac68
-rw-r--r--gnome-autoar/Makefile.am73
-rw-r--r--gnome-autoar/autoar-common.c (renamed from autoar-common.c)0
-rw-r--r--gnome-autoar/autoar-common.h (renamed from autoar-common.h)0
-rw-r--r--gnome-autoar/autoar-create.c (renamed from autoar-create.c)0
-rw-r--r--gnome-autoar/autoar-create.h (renamed from autoar-create.h)3
-rw-r--r--gnome-autoar/autoar-enum-types.c.template (renamed from autoar-enum-types.c.template)0
-rw-r--r--gnome-autoar/autoar-enum-types.h.template (renamed from autoar-enum-types.h.template)0
-rw-r--r--gnome-autoar/autoar-extract.c (renamed from autoar-extract.c)0
-rw-r--r--gnome-autoar/autoar-extract.h (renamed from autoar-extract.h)0
-rw-r--r--gnome-autoar/autoar-pref.c (renamed from autoar-pref.c)0
-rw-r--r--gnome-autoar/autoar-pref.h (renamed from autoar-pref.h)0
-rw-r--r--gnome-autoar/autoar.h (renamed from autoarchive.h)4
-rw-r--r--gnome-autoar/gnome-autoar.pc.in11
-rw-r--r--gnome-autoar/org.gnome.desktop.archives.gschema.xml (renamed from org.gnome.desktop.archives.gschema.xml)0
-rw-r--r--tests/Makefile.am26
-rw-r--r--tests/test-extract.c (renamed from test-extract.c)2
-rw-r--r--tests/test-pref.c (renamed from test-pref.c)2
21 files changed, 247 insertions, 89 deletions
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..f44a96d
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,36 @@
+*~
+*.o
+*.lo
+*.la
+.deps
+.libs
+.*.sw[op]
+stamp-*
+
+Makefile
+Makefile.in
+aclocal.m4
+autom4te.cache
+autoscan.log
+config.guess
+config.h
+config.h.in
+config.log
+config.status
+config.sub
+configure
+configure.scan
+depcomp
+install-sh
+libtool
+ltmain.sh
+m4/*.m4
+missing
+
+gnome-autoar/*-enum-types.[ch]
+gnome-autoar/*.enums.xml
+gnome-autoar/*.gschema.valid
+gnome-autoar/gnome-autoar.pc
+
+tests/test-extract
+tests/test-pref
diff --git a/Makefile.am b/Makefile.am
index a5f1189..007def2 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,91 +1,11 @@
# vim: set sw=8 ts=8 sts=8 noet:
-NULL =
-
-noinst_PROGRAMS =
-
-EXTRA_DIST = \
- autoar-enum-types.h.template \
- autoar-enum-types.c.template \
- org.gnome.desktop.archives.gschema.xml \
- $(NULL)
-
-gsettings_ENUM_NAMESPACE = org.gnome.desktop.archives
-gsettings_ENUM_FILES = $(top_srcdir)/autoarchive/autoar-pref.h
-
-gsettings_SCHEMAS = org.gnome.desktop.archives.gschema.xml
-
-@GSETTINGS_RULES@
+ACLOCAL_AMFLAGS = -I m4
-noinst_LTLIBRARIES = libautoarchive.la
-
-libautoarchive_h_sources = \
- autoar-common.h \
- autoar-create.h \
- autoar-extract.h \
- autoar-pref.h \
- $(NULL)
-libautoarchive_c_sources = \
- autoar-common.c \
- autoar-create.c \
- autoar-extract.c \
- autoar-pref.c \
- $(NULL)
-libautoarchive_generated_sources = \
- autoar-enum-types.h \
- autoar-enum-types.c \
- $(NULL)
-
-libautoarchive_la_SOURCES = \
- $(libautoarchive_generated_sources) \
- $(libautoarchive_h_sources) \
- $(libautoarchive_c_sources) \
- $(NULL)
-libautoarchive_la_CPPFLAGS = \
- $(AM_CPPFLAGS) \
- $(NULL)
-libautoarchive_la_CFLAGS = \
- $(DEPENDENCIES_CFLAGS) \
- $(AM_CFLAGS) \
- $(NULL)
-
-autoar-enum-types.h: autoar-enum-types.h.template $(libautoarchive_h_sources) $(GLIB_MKENUMS)
- $(AM_V_GEN) (cd $(srcdir) && $(GLIB_MKENUMS) --template autoar-enum-types.h.template $(libautoarchive_h_sources)) > $@
-autoar-enum-types.c: autoar-enum-types.c.template $(libautoarchive_h_sources) $(GLIB_MKENUMS)
- $(AM_V_GEN) (cd $(srcdir) && $(GLIB_MKENUMS) --template autoar-enum-types.c.template $(libautoarchive_h_sources)) > $@
-
-noinst_PROGRAMS += test-extract
-EXTRA_DIST += test-extract.c
-test_extract_SOURCES = \
- test-extract.c \
- $(NULL)
-test_extract_CFLAGS = \
- $(DEPENDENCIES_CFLAGS) \
- $(AM_CFLAGS) \
- $(NULL)
-test_extract_LDADD = \
- $(DEPENDENCIES_LIBS) \
- libautoarchive.la \
- $(NULL)
+NULL =
-noinst_PROGRAMS += test-pref
-EXTRA_DIST += test-pref.c
-test_pref_SOURCES = \
- test-pref.c \
- $(NULL)
-test_pref_CFLAGS = \
- $(DEPENDENCIES_CFLAGS) \
- $(AM_CFLAGS) \
- $(NULL)
-test_pref_LDADD = \
- $(DEPENDENCIES_LIBS) \
- libautoarchive.la \
- $(NULL)
+SUBDIRS = gnome-autoar tests
-BUILT_SOURCES = \
- $(libautoarchive_generated_sources) \
+EXTRA_DISTS = \
+ autogen.sh \
$(NULL)
-
-CLEANFILES = $(BUILT_SOURCES)
-DISTCLEANFILES = $(BUILT_SOURCES)
-MAINTAINERCLEANFILES = $(BUILT_SOURCES)
diff --git a/autogen.sh b/autogen.sh
new file mode 100755
index 0000000..aba155f
--- /dev/null
+++ b/autogen.sh
@@ -0,0 +1,21 @@
+#!/bin/sh
+# Run this to generate all the initial makefiles, etc.
+
+srcdir=`dirname $0`
+test -z "$srcdir" && srcdir=.
+
+PKG_NAME="libgnome-autoar"
+
+(test -f $srcdir/configure.ac \
+) || {
+ echo -n "**Error**: Directory "\`$srcdir\'" does not look like the"
+ echo " top-level $PKG_NAME directory"
+ exit 1
+}
+
+which gnome-autogen.sh || {
+ echo "You need to install gnome-common from the GNOME git"
+ exit 1
+}
+
+. gnome-autogen.sh
diff --git a/configure.ac b/configure.ac
new file mode 100644
index 0000000..e39f586
--- /dev/null
+++ b/configure.ac
@@ -0,0 +1,68 @@
+# vim: set sw=8 ts=8 sts=8 et:
+# -*- Autoconf -*-
+# Process this file with autoconf to produce a configure script.
+
+AC_PREREQ([2.68])
+AC_INIT([libgnome-autoar], [0.1], [BUG-REPORT-ADDRESS], [libgnome-autoar])
+
+AC_CONFIG_MACRO_DIR([m4])
+AC_CONFIG_SRCDIR([gnome-autoar/autoar.h])
+AC_CONFIG_HEADERS([config.h])
+
+AM_INIT_AUTOMAKE([1.11 foreign dist-xz no-dist-gzip tar-ustar])
+AM_MAINTAINER_MODE([enable])
+m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
+
+AC_PROG_CC
+AC_PROG_INSTALL
+LT_INIT
+PKG_PROG_PKG_CONFIG
+GLIB_GSETTINGS
+
+GNOME_DEBUG_CHECK
+GNOME_COMPILE_WARNINGS([maximum])
+GNOME_MAINTAINER_MODE_DEFINES
+
+AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal)
+AC_PATH_PROG(GLIB_MKENUMS, glib-mkenums)
+AC_PATH_PROG(GLIB_COMPILE_RESOURCES, glib-compile-resources)
+
+# Checks for libraries.
+GLIB_REQUIRED=2.35.6
+LIBARCHIVE_REQUIRED=3.0.0
+PKG_CHECK_MODULES([DEPENDENCIES], [
+ glib-2.0 >= $GLIB_REQUIRED
+ gobject-2.0 >= $GLIB_REQUIRED
+ gio-2.0 >= $GLIB_REQUIRED
+ libarchive >= $LIBARCHIVE_REQUIRED
+ ])
+
+AM_CPPFLAGS="$AM_CPPFLAGS $DEPRECATION_FLAGS"
+AM_CFLAGS="$AM_CFLAGS $WARN_CFLAGS $MORE_WARN_FLAGS"
+AC_SUBST([AM_CPPFLAGS])
+AC_SUBST([AM_CFLAGS])
+AC_SUBST([AM_LDFLAGS])
+
+# Checks for typedefs, structures, and compiler characteristics.
+AC_TYPE_MODE_T
+AC_TYPE_OFF_T
+AC_TYPE_SIZE_T
+AC_TYPE_SSIZE_T
+
+# Checks for library functions.
+AC_CHECK_FUNCS([getgrnam getpwnam link mkfifo mknod])
+
+AC_CONFIG_FILES([Makefile
+ gnome-autoar/Makefile
+ gnome-autoar/gnome-autoar.pc
+ tests/Makefile])
+AC_OUTPUT
+
+echo "
+Configuration:
+
+ Source code location : ${srcdir}
+ Prefix : ${prefix}
+ Compiler : ${CC}
+ CFLAGS : ${CFLAGS}
+"
diff --git a/gnome-autoar/Makefile.am b/gnome-autoar/Makefile.am
new file mode 100644
index 0000000..8d951cb
--- /dev/null
+++ b/gnome-autoar/Makefile.am
@@ -0,0 +1,73 @@
+# vim: set sw=8 ts=8 sts=8 noet:
+
+NULL =
+
+noinst_PROGRAMS =
+
+EXTRA_DIST = \
+ autoar-enum-types.h.template \
+ autoar-enum-types.c.template \
+ gnome-autoar.pc.in \
+ org.gnome.desktop.archives.gschema.xml \
+ $(NULL)
+
+gsettings_ENUM_NAMESPACE = org.gnome.desktop.archives
+gsettings_ENUM_FILES = autoar-pref.h
+
+gsettings_SCHEMAS = org.gnome.desktop.archives.gschema.xml
+
+@GSETTINGS_RULES@
+
+lib_LTLIBRARIES = libgnome-autoar.la
+
+libgnome_autoar_h_sources = \
+ autoar-common.h \
+ autoar-create.h \
+ autoar-extract.h \
+ autoar-pref.h \
+ $(NULL)
+libgnome_autoar_c_sources = \
+ autoar-common.c \
+ autoar-create.c \
+ autoar-extract.c \
+ autoar-pref.c \
+ $(NULL)
+libgnome_autoar_generated_sources = \
+ autoar-enum-types.h \
+ autoar-enum-types.c \
+ $(NULL)
+
+headerincludedir = $(includedir)/gnome-autoar
+headerinclude_HEADERS = \
+ autoar.h \
+ $(libgnome_autoar_h_sources) \
+ $(NULL)
+
+libgnome_autoar_la_SOURCES = \
+ $(libgnome_autoar_generated_sources) \
+ $(libgnome_autoar_h_sources) \
+ $(libgnome_autoar_c_sources) \
+ $(NULL)
+libgnome_autoar_la_CPPFLAGS = \
+ $(AM_CPPFLAGS) \
+ $(NULL)
+libgnome_autoar_la_CFLAGS = \
+ $(DEPENDENCIES_CFLAGS) \
+ $(AM_CFLAGS) \
+ $(NULL)
+
+autoar-enum-types.h: autoar-enum-types.h.template $(libgnome_autoar_h_sources) $(GLIB_MKENUMS)
+ $(AM_V_GEN) (cd $(srcdir) && $(GLIB_MKENUMS) --template autoar-enum-types.h.template $(libgnome_autoar_h_sources)) > $@
+autoar-enum-types.c: autoar-enum-types.c.template $(libgnome_autoar_h_sources) $(GLIB_MKENUMS)
+ $(AM_V_GEN) (cd $(srcdir) && $(GLIB_MKENUMS) --template autoar-enum-types.c.template $(libgnome_autoar_h_sources)) > $@
+
+BUILT_SOURCES = \
+ $(libgnome_autoar_generated_sources) \
+ $(NULL)
+
+pkgconfigdir = $(libdir)/pkgconfig
+pkgconfig_DATA = gnome-autoar.pc
+
+CLEANFILES = $(BUILT_SOURCES)
+DISTCLEANFILES = $(BUILT_SOURCES)
+MAINTAINERCLEANFILES = $(BUILT_SOURCES)
diff --git a/autoar-common.c b/gnome-autoar/autoar-common.c
index a56c471..a56c471 100644
--- a/autoar-common.c
+++ b/gnome-autoar/autoar-common.c
diff --git a/autoar-common.h b/gnome-autoar/autoar-common.h
index 888eb08..888eb08 100644
--- a/autoar-common.h
+++ b/gnome-autoar/autoar-common.h
diff --git a/autoar-create.c b/gnome-autoar/autoar-create.c
index 4b946bd..4b946bd 100644
--- a/autoar-create.c
+++ b/gnome-autoar/autoar-create.c
diff --git a/autoar-create.h b/gnome-autoar/autoar-create.h
index 3c37945..bfbc542 100644
--- a/autoar-create.h
+++ b/gnome-autoar/autoar-create.h
@@ -79,10 +79,13 @@ void autoar_create_start_async (AutoarCreate *arcreate);
char **autoar_create_get_source (AutoarCreate *arcreate);
char *autoar_create_get_output (AutoarCreate *arcreate);
+guint64 autoar_create_get_size (AutoarCreate *arcreate);
guint64 autoar_create_get_completed_size (AutoarCreate *arcreate);
guint autoar_create_get_files (AutoarCreate *arcreate);
guint autoar_create_get_completed_files (AutoarCreate *arcreate);
+void autoar_create_set_size (AutoarCreate *arcreate,
+ guint64 size);
void autoar_create_set_completed_size (AutoarCreate *arcreate,
guint64 completed_size);
void autoar_create_set_files (AutoarCreate *arcreate,
diff --git a/autoar-enum-types.c.template b/gnome-autoar/autoar-enum-types.c.template
index 96aee62..96aee62 100644
--- a/autoar-enum-types.c.template
+++ b/gnome-autoar/autoar-enum-types.c.template
diff --git a/autoar-enum-types.h.template b/gnome-autoar/autoar-enum-types.h.template
index d2dbecf..d2dbecf 100644
--- a/autoar-enum-types.h.template
+++ b/gnome-autoar/autoar-enum-types.h.template
diff --git a/autoar-extract.c b/gnome-autoar/autoar-extract.c
index e7c4c7e..e7c4c7e 100644
--- a/autoar-extract.c
+++ b/gnome-autoar/autoar-extract.c
diff --git a/autoar-extract.h b/gnome-autoar/autoar-extract.h
index 8e2df64..8e2df64 100644
--- a/autoar-extract.h
+++ b/gnome-autoar/autoar-extract.h
diff --git a/autoar-pref.c b/gnome-autoar/autoar-pref.c
index cdace5e..cdace5e 100644
--- a/autoar-pref.c
+++ b/gnome-autoar/autoar-pref.c
diff --git a/autoar-pref.h b/gnome-autoar/autoar-pref.h
index a935ad3..a935ad3 100644
--- a/autoar-pref.h
+++ b/gnome-autoar/autoar-pref.h
diff --git a/autoarchive.h b/gnome-autoar/autoar.h
index 664981e..35b5fb0 100644
--- a/autoarchive.h
+++ b/gnome-autoar/autoar.h
@@ -27,8 +27,8 @@
#define AUTOARHICVE_H
/* #include <autoarchive/autoar-create.h> */
-#include <autoarchive/autoar-extract.h>
-#include <autoarchive/autoar-pref.h>
+#include <gnome-autoar/autoar-extract.h>
+#include <gnome-autoar/autoar-pref.h>
/* #include <autoarchive/autoar-ui.h> */
#endif /* AUTOARCHIVE_H */
diff --git a/gnome-autoar/gnome-autoar.pc.in b/gnome-autoar/gnome-autoar.pc.in
new file mode 100644
index 0000000..6c46373
--- /dev/null
+++ b/gnome-autoar/gnome-autoar.pc.in
@@ -0,0 +1,11 @@
+prefix=@prefix@
+exec_prefix=@exec_prefix@
+libdir=@libdir@
+includedir=@includedir@
+
+Name: gnome-autoar
+Description: Archives integration support for GNOME
+Version: @VERSION@
+Requires: glib-2.0 gio-2.0 gobject-2.0 libarchive
+Libs: -L${libdir} -lgnome-autoar
+Cflags: -I${includedir}/gnome-autoar
diff --git a/org.gnome.desktop.archives.gschema.xml b/gnome-autoar/org.gnome.desktop.archives.gschema.xml
index 1d946c2..1d946c2 100644
--- a/org.gnome.desktop.archives.gschema.xml
+++ b/gnome-autoar/org.gnome.desktop.archives.gschema.xml
diff --git a/tests/Makefile.am b/tests/Makefile.am
new file mode 100644
index 0000000..6500b69
--- /dev/null
+++ b/tests/Makefile.am
@@ -0,0 +1,26 @@
+# vim: set sw=8 ts=8 sts=8 noet:
+
+NULL =
+
+noinst_PROGRAMS = test-extract test-pref
+EXTRA_DIST = test-extract.c test-pref.c
+
+test_cflags = \
+ $(DEPENDENCIES_CFLAGS) \
+ $(AM_CFLAGS) \
+ -I$(top_srcdir) \
+ $(NULL)
+
+test_libs = \
+ $(DEPENDENCIES_LIBS) \
+ $(top_builddir)/gnome-autoar/libgnome-autoar.la \
+ $(NULL)
+
+
+test_extract_SOURCES = test-extract.c
+test_extract_CFLAGS = $(test_cflags)
+test_extract_LDADD = $(test_libs)
+
+test_pref_SOURCES = test-pref.c
+test_pref_CFLAGS = $(test_cflags)
+test_pref_LDADD = $(test_libs)
diff --git a/test-extract.c b/tests/test-extract.c
index b6721fc..5edbacf 100644
--- a/test-extract.c
+++ b/tests/test-extract.c
@@ -1,6 +1,6 @@
/* vim: set sw=2 ts=2 sts=2 et: */
-#include <autoarchive/autoarchive.h>
+#include <gnome-autoar/autoar.h>
#include <gio/gio.h>
#include <stdlib.h>
diff --git a/test-pref.c b/tests/test-pref.c
index 449e5ee..5a348c8 100644
--- a/test-pref.c
+++ b/tests/test-pref.c
@@ -1,6 +1,6 @@
/* vim: set sw=2 ts=2 sts=2 et: */
-#include <autoarchive/autoarchive.h>
+#include <gnome-autoar/autoar.h>
int
main (int argc,