Skip to content

Commit

Permalink
Merge pull request #65 from ejoerns/v0/topic/distcheck-automake
Browse files Browse the repository at this point in the history
Fixes for build system
  • Loading branch information
jluebbe committed Aug 23, 2016
2 parents c0257a7 + 8cf2540 commit b58e926
Show file tree
Hide file tree
Showing 6 changed files with 128 additions and 10 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ script:
- make clean
- make -j2
- make check TESTS= && sudo ./uml-test
- make distcheck
after_success:
- coveralls --build-root '.' --exclude tests --exclude rauc-installer-generated.c
after_failure:
Expand Down
70 changes: 65 additions & 5 deletions Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,21 @@ librauc_la_SOURCES = \
src/service.c \
src/signature.c \
src/utils.c \
src/update_handler.c
src/update_handler.c \
include/bootchooser.h \
include/bundle.h \
include/checksum.h \
include/config_file.h \
include/context.h \
include/install.h \
include/manifest.h \
include/mount.h \
include/network.h \
include/service.h \
include/signature.h \
include/update_handler.h \
include/utils.h

nodist_librauc_la_SOURCES = \
$(gdbus_installer_generated)
librauc_la_CFLAGS = $(AM_CFLAGS) $(CODE_COVERAGE_CFLAGS)
Expand All @@ -61,6 +75,20 @@ rauc_CFLAGS = $(AM_CFLAGS) $(CODE_COVERAGE_CFLAGS)
rauc_LDFLAGS = $(AM_LDFLAGS) $(CODE_COVERAGE_LDFLAGS)
rauc_LDADD = $(librauc_la_LIBADD) librauc.la

if SYSTEMD
systemdunitdir=$(SYSTEMD_UNITDIR)
dist_systemdunit_DATA = data/rauc.service
endif

dbussystemdir = $(DBUS_SYSTEMSERVICEDIR)
dist_dbussystem_DATA = data/de.pengutronix.rauc.service

dbuspolicydir = $(DBUS_POLICYDIR)
dist_dbuspolicy_DATA = data/de.pengutronix.rauc.conf

EXTRA_DIST += data/rauc.service.in \
data/de.pengutronix.rauc.service.in

AM_TESTS_ENVIRONMENT = \
AM_TAP_AWK='$(AWK)'; export AM_TAP_AWK; \
CATCHSEGV='$(CATCHSEGV)'; export CATCHSEGV;
Expand All @@ -84,8 +112,20 @@ check_PROGRAMS = \
test/progress.test
check_LTLIBRARIES = librauctest.la

EXTRA_DIST += tap-t \
tap-test \
test/bin \
test/install-content \
test/openssl-ca \
test/manifest.raucm \
test/rauc.t \
test/rootfs.raucs \
test/sharness.sh \
test/test.conf

librauctest_la_SOURCES = \
test/common.c
test/common.c \
test/common.h
librauctest_la_LIBADD = $(GLIB_LIBS) librauc.la

TESTS = $(check_PROGRAMS) test/rauc.t
Expand All @@ -106,7 +146,7 @@ test_manifest_test_SOURCES = test/manifest.c
test_manifest_test_LDADD = librauctest.la

test_service_test_CFLAGS = $(AM_CFLAGS) -DTEST_SERVICES=\""$(abs_top_builddir)/test/services"\"
test_service_test_SOURCES = test/service.c
test_service_test_SOURCES = test/service.c rauc-installer-generated.h
test_service_test_LDADD = librauctest.la

test_signature_test_SOURCES = test/signature.c
Expand All @@ -124,6 +164,15 @@ test_network_test_LDADD = librauctest.la
test_progress_test_SOURCES = test/progress.c
test_progress_test_LDADD = librauctest.la

SED_REPLACE = $(SED) \
-e 's|[@]bindir[@]|$(bindir)|g' \
-e 's|[@]datadir[@]|$(pkgdatadir)|g' \
-e 's|[@]prefix[@]|$(prefix)|g'

data/%: data/%.in
$(AM_V_GEN)$(MKDIR_P) $(dir $@) && \
$(SED_REPLACE) $< > $@

SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
Expand All @@ -137,5 +186,16 @@ doc:
@echo
@echo "Build finished. The HTML pages are in $(SPHINXBUILDDIR)/html."


CLEANFILES = $(gdbus_installer_generated)
AM_DISTCHECK_CONFIGURE_FLAGS = "--without-systemdunitdir"

CLEANFILES = $(gdbus_installer_generated) \
$(dist_systemunit_DATA) \
$(dist_dbussystem_DATA) \
data/rauc.service \
test/empty.dat \
test/test-results/rauc.*.counts \
test/savedmanifest.raucm \
test/savedslot.raucs \
test/grubenv.test \
test/random.dat \
test/test-temp.conf
50 changes: 50 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ AX_COMPILER_FLAGS

# Checks for programs.
AC_PROG_AWK
AC_PROG_MKDIR_P
AC_PROG_SED
AC_PROG_CC
AC_PROG_CC_C99
AM_PROG_CC_C_O
Expand Down Expand Up @@ -51,12 +53,60 @@ PKG_CHECK_MODULES([CURL], [libcurl])

AX_CHECK_OPENSSL([],[AC_MSG_ERROR([OpenSSL not found])])

AC_ARG_WITH([systemdunitdir], AC_HELP_STRING([--with-systemdunitdir=DIR],
[path to systemd service directory]), [with_systemdunitdir=${withval}],
[with_systemdunitdir="`$PKG_CONFIG --variable=systemdsystemunitdir systemd`"])
if (test -n "${with_systemdunitdir}"); then
SYSTEMD_UNITDIR="${with_systemdunitdir}"
AC_SUBST(SYSTEMD_UNITDIR)
fi
AM_CONDITIONAL(SYSTEMD, test -n "${with_systemdunitdir}")

AC_ARG_WITH([dbuspolicydir],
AS_HELP_STRING([--with-dbuspolicydir=DIR], [D-Bus policy directory]),
[],
[with_dbuspolicydir=${datadir}/dbus-1/system.d])
DBUS_POLICYDIR="${with_dbuspolicydir}"
AC_SUBST(DBUS_POLICYDIR)

AC_ARG_WITH([dbussystemservicedir],
AS_HELP_STRING([--with-dbussystemservicedir=DIR], [D-Bus system service directory]),
[],
[with_dbussystemservicedir=${datadir}/dbus-1/system-services])
DBUS_SYSTEMSERVICEDIR="${with_dbussystemservicedir}"
AC_SUBST(DBUS_SYSTEMSERVICEDIR)

# Checks for header files.

# Checks for typedefs, structures, and compiler characteristics.

# Checks for library functions.

AC_CONFIG_LINKS([test/test.conf:test/test.conf])
AC_CONFIG_LINKS([test/bin/postinstall.sh:test/bin/postinstall.sh])
AC_CONFIG_LINKS([test/bin/fw_setenv:test/bin/fw_setenv])
AC_CONFIG_LINKS([test/bin/grub-editenv:test/bin/grub-editenv])
AC_CONFIG_LINKS([test/bin/barebox-state:test/bin/barebox-state])
AC_CONFIG_LINKS([test/bin/preinstall.sh:test/bin/preinstall.sh])
AC_CONFIG_LINKS([test/bin/systeminfo.sh:test/bin/systeminfo.sh])
AC_CONFIG_LINKS([test/good-bundle.raucb:test/good-bundle.raucb])
AC_CONFIG_LINKS([test/manifest.raucm:test/manifest.raucm])
AC_CONFIG_LINKS([test/openssl-ca/manifest:test/openssl-ca/manifest])
AC_CONFIG_LINKS([test/openssl-ca/dev/autobuilder-1.cert.pem:test/openssl-ca/dev/autobuilder-1.cert.pem])
AC_CONFIG_LINKS([test/openssl-ca/dev/private/autobuilder-1.pem:test/openssl-ca/dev/private/autobuilder-1.pem])
AC_CONFIG_LINKS([test/openssl-ca/dev-ca.pem:test/openssl-ca/dev-ca.pem])
AC_CONFIG_LINKS([test/openssl-ca/rel/release-1.cert.pem:test/openssl-ca/rel/release-1.cert.pem])
AC_CONFIG_LINKS([test/openssl-ca/rel/private/release-1.pem:test/openssl-ca/rel/private/release-1.pem])
AC_CONFIG_LINKS([test/openssl-ca/manifest-r1.sig:test/openssl-ca/manifest-r1.sig])
AC_CONFIG_LINKS([test/rauc.t:test/rauc.t])
AC_CONFIG_LINKS([test/rootfs.raucs:test/rootfs.raucs])
AC_CONFIG_LINKS([test/services/de.pengutronix.rauc.service.in:test/services/de.pengutronix.rauc.service.in])
AC_CONFIG_LINKS([test/sharness.sh:test/sharness.sh])
AC_CONFIG_LINKS([test/install-content/appfs.img:test/install-content/appfs.img])
AC_CONFIG_LINKS([test/install-content/rootfs.img:test/install-content/rootfs.img])
AC_CONFIG_LINKS([test/install-content/custom_handler.sh:test/install-content/custom_handler.sh])
AC_CONFIG_LINKS([test/install-content/manifest.raucm:test/install-content/manifest.raucm])

AC_CONFIG_FILES([
Makefile
test/services/de.pengutronix.rauc.service
Expand Down
5 changes: 0 additions & 5 deletions data/de.pengutronix.rauc.service

This file was deleted.

5 changes: 5 additions & 0 deletions data/de.pengutronix.rauc.service.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[D-BUS Service]
Name=de.pengutronix.rauc
Exec=@bindir@/rauc
User=root
SystemdService=rauc.service
7 changes: 7 additions & 0 deletions data/rauc.service.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[Unit]
Description=Rauc Update Service

[Service]
Type=dbus
BusName=de.pengutronix.rauc
ExecStart=@bindir@/rauc service

0 comments on commit b58e926

Please sign in to comment.