Initial commit

Not even the demo is able to compile yet.

I'm just tracking my progress.
This commit is contained in:
Přemysl Eric Janouch 2015-03-02 08:49:21 +01:00
commit 8a3241d5c4
10 changed files with 1279 additions and 0 deletions

9
.gitignore vendored Normal file
View File

@ -0,0 +1,9 @@
# Build files
/build
# Qt Creator files
/CMakeLists.txt.user*
/acid.config
/acid.files
/acid.creator*
/acid.includes

3
.gitmodules vendored Normal file
View File

@ -0,0 +1,3 @@
[submodule "liberty"]
path = liberty
url = git://github.com/pjanouch/liberty.git

21
.travis.yml Normal file
View File

@ -0,0 +1,21 @@
language: c
notifications:
irc:
channels: "anathema.us.nu#anathema"
use_notice: true
skip_join: true
compiler:
- clang
- gcc
before_install:
- sudo add-apt-repository ppa:ukplc-team/ppa -y
- sudo apt-get update -qq
install:
- sudo apt-get install -y help2man libjansson-dev libev-dev
before_script:
- mkdir build
- cd build
script:
- cmake .. -DCMAKE_INSTALL_PREFIX=/usr
- make
- cpack -G DEB

83
CMakeLists.txt Normal file
View File

@ -0,0 +1,83 @@
project (acid C)
cmake_minimum_required (VERSION 2.8.5)
# Moar warnings
if ("${CMAKE_C_COMPILER_ID}" MATCHES "GNU" OR CMAKE_COMPILER_IS_GNUC)
# -Wunused-function is pretty annoying here, as everything is static
set (CMAKE_C_FLAGS "-std=c99 -Wall -Wextra -Wno-unused-function")
endif ("${CMAKE_C_COMPILER_ID}" MATCHES "GNU" OR CMAKE_COMPILER_IS_GNUC)
# Version
set (project_VERSION_MAJOR "0")
set (project_VERSION_MINOR "1")
set (project_VERSION_PATCH "0")
set (project_VERSION "${project_VERSION_MAJOR}")
set (project_VERSION "${project_VERSION}.${project_VERSION_MINOR}")
set (project_VERSION "${project_VERSION}.${project_VERSION_PATCH}")
# For custom modules
set (CMAKE_MODULE_PATH ${PROJECT_SOURCE_DIR}/cmake)
# Dependencies
find_package (PkgConfig REQUIRED)
pkg_check_modules (dependencies REQUIRED jansson)
find_package (LibEV REQUIRED)
set (project_libraries ${dependencies_LIBRARIES} ${LIBEV_LIBRARIES})
include_directories (${dependencies_INCLUDE_DIRS} ${LIBEV_INCLUDE_DIRS})
# Generate a configuration file
configure_file (${PROJECT_SOURCE_DIR}/config.h.in ${PROJECT_BINARY_DIR}/config.h)
include_directories (${PROJECT_BINARY_DIR})
# Build the executables
add_executable (demo-json-rpc-server demo-json-rpc-server.c)
target_link_libraries (demo-json-rpc-server ${project_libraries})
# The files to be installed
include (GNUInstallDirs)
install (TARGETS DESTINATION ${CMAKE_INSTALL_BINDIR})
install (FILES LICENSE DESTINATION ${CMAKE_INSTALL_DOCDIR})
# Generate documentation from program help
find_program (HELP2MAN_EXECUTABLE help2man)
if (NOT HELP2MAN_EXECUTABLE)
message (FATAL_ERROR "help2man not found")
endif (NOT HELP2MAN_EXECUTABLE)
foreach (page)
set (page_output "${PROJECT_BINARY_DIR}/${page}.1")
list (APPEND project_MAN_PAGES "${page_output}")
add_custom_command (OUTPUT ${page_output}
COMMAND ${HELP2MAN_EXECUTABLE} -N
"${PROJECT_BINARY_DIR}/${page}" -o ${page_output}
DEPENDS ${page}
COMMENT "Generating man page for ${page}" VERBATIM)
endforeach (page)
add_custom_target (docs ALL DEPENDS ${project_MAN_PAGES})
foreach (page ${project_MAN_PAGES})
string (REGEX MATCH "\\.([0-9])" manpage_suffix "${page}")
install (FILES "${page}"
DESTINATION "${CMAKE_INSTALL_MANDIR}/man${CMAKE_MATCH_1}")
endforeach (page)
# CPack
set (CPACK_PACKAGE_DESCRIPTION_SUMMARY "A Continuous Integration Daemon")
set (CPACK_PACKAGE_VENDOR "Premysl Janouch")
set (CPACK_PACKAGE_CONTACT "Přemysl Janouch <p.janouch@gmail.com>")
set (CPACK_RESOURCE_FILE_LICENSE "${PROJECT_SOURCE_DIR}/LICENSE")
set (CPACK_PACKAGE_VERSION_MAJOR ${project_VERSION_MAJOR})
set (CPACK_PACKAGE_VERSION_MINOR ${project_VERSION_MINOR})
set (CPACK_PACKAGE_VERSION_PATCH ${project_VERSION_PATCH})
set (CPACK_GENERATOR "TGZ;ZIP")
set (CPACK_PACKAGE_FILE_NAME
"${PROJECT_NAME}-${project_VERSION}-${CMAKE_SYSTEM_NAME}-${CMAKE_SYSTEM_PROCESSOR}")
set (CPACK_PACKAGE_INSTALL_DIRECTORY "${PROJECT_NAME}-${project_VERSION}")
set (CPACK_SOURCE_GENERATOR "TGZ;ZIP")
set (CPACK_SOURCE_IGNORE_FILES "/\\\\.git;/build;/CMakeLists.txt.user")
set (CPACK_SOURCE_PACKAGE_FILE_NAME "${PROJECT_NAME}-${project_VERSION}")
include (CPack)

14
LICENSE Normal file
View File

@ -0,0 +1,14 @@
Copyright (c) 2015, Přemysl Janouch <p.janouch@gmail.com>
All rights reserved.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

57
README Normal file
View File

@ -0,0 +1,57 @@
acid
====
`acid' is A Continuous Integration Daemon. Currently under heavy development.
The aim of this project is to provide a dumbed-down alternative to Travis CI.
I find it way too complex to set up and run in a local setting, while the basic
gist of it is actually very simple -- run some stuff on new git commits.
`acid' will provide a JSON-RPC 2.0 service for frontends over FastCGI or SCGI,
as well as a webhook endpoint for notifications about new commits.
`acid' will be able to tell you about build results via e-mail and/or IRC.
Builds will only be supported on the same machine as the daemon. Eventually I
might be able to add support for fully replicable builds using Docker.
With this being my own project, of course it is written in event-looped C99
where everything is stuffed into just a few files. At least I hope it's written
in a somewhat clean manner. Feel free to contribute.
Building and Installing
-----------------------
Build dependencies: CMake, pkg-config, help2man, liberty (included)
Runtime dependencies: libev, Jansson
$ git clone https://github.com/pjanouch/acid.git
$ git submodule init
$ git submodule update
$ mkdir build
$ cd build
$ cmake .. -DCMAKE_INSTALL_PREFIX=/usr -DCMAKE_BUILD_TYPE=Debug
$ make
To install the application, you can do either the usual:
# make install
Or you can try telling CMake to make a package for you. For Debian it is:
$ cpack -G DEB
# dpkg -i acid-*.deb
Note that for versions of CMake before 2.8.9, you need to prefix cpack with
`fakeroot' or file ownership will end up wrong.
Usage
-----
TODO. The main application hasn't been written yet.
License
-------
`acid' is written by Přemysl Janouch <p.janouch@gmail.com>.
You may use the software under the terms of the ISC license, the text of which
is included within the package, or, at your option, you may relicense the work
under the MIT or the Modified BSD License, as listed at the following site:
http://www.gnu.org/licenses/license-list.html

18
cmake/FindLibEV.cmake Normal file
View File

@ -0,0 +1,18 @@
# Public Domain
# The author of libev is a dick and doesn't want to add support for pkg-config,
# forcing us to include this pointless file in the distribution.
# Some distributions do add it, though
find_package (PkgConfig REQUIRED)
pkg_check_modules (LIBEV QUIET libev)
if (NOT LIBEV_FOUND)
find_path (LIBEV_INCLUDE_DIRS ev.h)
find_library (LIBEV_LIBRARIES NAMES ev)
if (LIBEV_INCLUDE_DIRS AND LIBEV_LIBRARIES)
set (LIBEV_FOUND TRUE)
endif (LIBEV_INCLUDE_DIRS AND LIBEV_LIBRARIES)
endif (NOT LIBEV_FOUND)

8
config.h.in Normal file
View File

@ -0,0 +1,8 @@
#ifndef CONFIG_H
#define CONFIG_H
#define PROGRAM_NAME "${PROJECT_NAME}"
#define PROGRAM_VERSION "${project_VERSION}"
#endif // ! CONFIG_H

1065
demo-json-rpc-server.c Normal file

File diff suppressed because it is too large Load Diff

1
liberty Submodule

@ -0,0 +1 @@
Subproject commit 087645848baec5e59e4296817850bd5dd240cbb2