Skip to content
This repository has been archived by the owner on Oct 9, 2019. It is now read-only.

Commit

Permalink
Merge 5dd532e into e26df92
Browse files Browse the repository at this point in the history
  • Loading branch information
mrtazz committed May 21, 2016
2 parents e26df92 + 5dd532e commit ba44f7b
Show file tree
Hide file tree
Showing 8 changed files with 90 additions and 17 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -30,3 +30,11 @@ m4
*gcno
html
coverage.info

# packaging
*.rpm
*.deb
usr

# generated files
include/plustache/version.h
32 changes: 25 additions & 7 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,16 +1,34 @@
language: cpp
script: autoreconf -i && ./configure --enable-coverage && make test
script:
- autoreconf -i
- ./configure --enable-coverage
- make ci
install:
- gem install fpm
- gem install package_cloud
before_script:
- ./utils/build_gtest.sh
- gem install coveralls-lcov
- ./utils/build_gtest.sh
- gem install coveralls-lcov
after_success:
- curl http://ftp.de.debian.org/debian/pool/main/l/lcov/lcov_1.11.orig.tar.gz | tar xz
- export PATH=$PATH:`pwd`/lcov-1.11/bin
- make coverage.info
- coveralls-lcov coverage.info
- curl http://ftp.de.debian.org/debian/pool/main/l/lcov/lcov_1.11.orig.tar.gz | tar
xz
- export PATH=$PATH:`pwd`/lcov-1.11/bin
- make coverage.info
- coveralls-lcov coverage.info
sudo: false
addons:
apt:
packages:
- build-essential
- libboost-regex-dev
- rpm
- valgrind
deploy:
provider: script
script: ./autogen.sh && ./configure --prefix=`pwd`/usr && make deploy-packages
on:
tags: true
condition: $CXX = g++
env:
global:
secure: WkzClT13gpXdjHLbdrPw3BC5COE7CC9SGAeU5hcl6T+cFS2Xs9qVmdG3LuKtWYZZCkDIa5b6iDisYrl6ZnXhboJ2sbmNDijCEHbUCj2qsqw8Txcf09LuFZYp0LkjwwjP1KLKPbe2r2v5TaHKku/cq4SroclkiNKgb0/q+H92qak=
18 changes: 16 additions & 2 deletions Makefile.am
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
ACLOCAL_AMFLAGS=-I m4
AM_CPPFLAGS = -I$(top_srcdir)/include
LDFLAGS=-lboost_regex-mt
pkginclude_HEADERS = include/plustache/template.hpp include/plustache/context.hpp include/plustache/plustache_types.hpp
pkginclude_HEADERS = include/plustache/template.hpp include/plustache/context.hpp include/plustache/plustache_types.hpp include/plustache/version.h
check_PROGRAMS = test-program
test_program_CPPFLAGS=-Ivendor/gtest-1.7.0/include -I$(top_srcdir)/include
test_program_LDFLAGS=-Lvendor/gtest-1.7.0/lib/.libs -lgtest -lboost_regex-mt
Expand All @@ -10,9 +11,11 @@ test_program_LDADD = .libs/libplustache.a

lib_LTLIBRARIES=libplustache.la
libplustache_la_SOURCES=src/template.cpp src/context.cpp
libplustache_la_CXXFLAGS=-fPIC
libplustache_la_LDFLAGS=-version-info 2:1:1


.PHONY: test check clean-coverage-files coverage-html
.PHONY: test check clean-coverage-files coverage-html valgrind ci

test: check
./test-program
Expand All @@ -26,3 +29,14 @@ coverage.info: test

coverage-html: coverage.info
genhtml -t "plustache coverage report" --legend --show-details coverage.info --output-directory html

include/plustache/version.h:
m4 -I m4 -DM4_PLUSTACHE_VERSION=$(VERSION) version.h.m4 > $@

valgrind: check
valgrind --leak-check=full --error-exitcode=0 ./test-program

ci: test valgrind

# include other make targets in the main Makefile
include $(srcdir)/Makefile.packaging.mk
28 changes: 28 additions & 0 deletions Makefile.packaging.mk
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# make tasks to create and publish packages
.PHONY: rpm deb packages deploy-packages

local-install:
$(MAKE) install PREFIX=usr

NAME=plustache
VERSION = $(shell git describe --tags --always --dirty)
BUILDER = $(shell echo "`git config user.name` <`git config user.email`>")
PKG_RELEASE ?= 1
PROJECT_URL="https://github.com/mrtazz/$(NAME)"
FPM_FLAGS= --name $(NAME) --version $(VERSION) --iteration $(PKG_RELEASE) \
--epoch 1 --license MIT --maintainer "$(BUILDER)" --url $(PROJECT_URL) \
--vendor mrtazz --description "{{mustaches}} for C++" \
--after-install utils/runldconfig.sh --after-remove utils/runldconfig.sh

rpm:
fpm -t rpm -s dir $(FPM_FLAGS) --depends boost-regex usr

deb:
fpm -t deb -s dir $(FPM_FLAGS) --depends libboost-regex usr

packages: local-install rpm deb

deploy-packages: packages
package_cloud push mrtazz/$(NAME)/el/7 *.rpm
package_cloud push mrtazz/$(NAME)/debian/wheezy *.deb
package_cloud push mrtazz/$(NAME)/ubuntu/trusty *.deb
2 changes: 2 additions & 0 deletions autogen.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
autoreconf --force --install
11 changes: 3 additions & 8 deletions configure.ac
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
# -*- Autoconf -*-
# Process this file with autoconf to produce a configure script.

AC_PREREQ([2.52])
AC_INIT([plustache], [0.1.2], [d@unwiredcouch.com])
AM_INIT_AUTOMAKE([0.1.2 foreign subdir-objects])
AC_INIT([plustache], [0.3.0], [d@unwiredcouch.com])
AM_INIT_AUTOMAKE([foreign subdir-objects])
LT_INIT
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_MACRO_DIR([m4])

# Checks for programs.
AC_PROG_CXX
Expand All @@ -14,9 +12,6 @@ AC_PROG_INSTALL

# Checks for libraries.
AC_CHECK_LIB([boost_regex], [main])
AC_CHECK_LIB([gtest], [main])

# Checks for header files.

# Checks for typedefs, structures, and compiler characteristics.
AC_C_INLINE
Expand Down
6 changes: 6 additions & 0 deletions m4/version.h.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
changecom(`@@')dnl
#ifndef INCLUDE_PLUSTACHE_VERSION_H_
#define INCLUDE_PLUSTACHE_VERSION_H_
#define PLUSTACHE_VERSION "M4_PLUSTACHE_VERSION"
#endif // INCLUDE_PLUSTACHE_VERSION_H_
changecom(`#')dnl
2 changes: 2 additions & 0 deletions utils/runldconfig.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#!/bin/sh
/sbin/ldconfig

0 comments on commit ba44f7b

Please sign in to comment.