Initial commit.
This commit is contained in:
commit
9a4d40a79d
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
/build/
|
47
CMakeLists.txt
Normal file
47
CMakeLists.txt
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
cmake_minimum_required (VERSION 3.2)
|
||||||
|
project(gitea2rss
|
||||||
|
VERSION 0.0.0
|
||||||
|
LANGUAGES CXX
|
||||||
|
)
|
||||||
|
|
||||||
|
include(GNUInstallDirs)
|
||||||
|
find_package(PkgConfig REQUIRED)
|
||||||
|
pkg_check_modules(JSONCPP REQUIRED jsoncpp)
|
||||||
|
|
||||||
|
set(CMAKE_CXX_STANDARD 14)
|
||||||
|
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||||
|
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||||
|
|
||||||
|
set(CMAKE_CXX_FLAGS_DEBUG
|
||||||
|
"${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wextra -Wpedantic -ftrapv \
|
||||||
|
-fsanitize=undefined -g -Og -fno-omit-frame-pointer")
|
||||||
|
|
||||||
|
include_directories(${PROJECT_BINARY_DIR})
|
||||||
|
|
||||||
|
include_directories(${JSONCPP_INCLUDE_DIRS})
|
||||||
|
link_directories(${JSONCPP_LIBRARY_DIRS})
|
||||||
|
|
||||||
|
# Write version in header
|
||||||
|
configure_file(
|
||||||
|
"${PROJECT_SOURCE_DIR}/src/version.hpp.in"
|
||||||
|
"${PROJECT_BINARY_DIR}/version.hpp"
|
||||||
|
)
|
||||||
|
|
||||||
|
file(GLOB sources src/*.cpp)
|
||||||
|
add_executable(${PROJECT_NAME} "${sources}")
|
||||||
|
target_link_libraries(${PROJECT_NAME} ${JSONCPP_LIBRARIES})
|
||||||
|
install(TARGETS ${PROJECT_NAME} DESTINATION ${CMAKE_INSTALL_BINDIR})
|
||||||
|
|
||||||
|
set(WITH_MAN "YES" CACHE STRING "WITH_MAN defaults to \"YES\"")
|
||||||
|
if (WITH_MAN)
|
||||||
|
add_custom_command(
|
||||||
|
OUTPUT "${PROJECT_BINARY_DIR}/${PROJECT_NAME}.1"
|
||||||
|
WORKING_DIRECTORY "${PROJECT_BINARY_DIR}"
|
||||||
|
DEPENDS "${CMAKE_SOURCE_DIR}/${PROJECT_NAME}.1.adoc"
|
||||||
|
COMMAND ${CMAKE_SOURCE_DIR}/build_manpage.sh
|
||||||
|
ARGS ${PROJECT_VERSION})
|
||||||
|
add_custom_target(run ALL DEPENDS "${PROJECT_BINARY_DIR}/${PROJECT_NAME}.1")
|
||||||
|
install(
|
||||||
|
FILES ${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}.1
|
||||||
|
DESTINATION ${CMAKE_INSTALL_MANDIR}/man1)
|
||||||
|
endif()
|
3
README.adoc
Normal file
3
README.adoc
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
= gitea2rss
|
||||||
|
|
||||||
|
*gitea2rss* turns https://gitea.io[Gitea] releases into RSS feeds.
|
13
build_manpage.sh
Executable file
13
build_manpage.sh
Executable file
@ -0,0 +1,13 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
name="gitea2rss"
|
||||||
|
|
||||||
|
if [ -n "${1}" ]; then
|
||||||
|
dir="$(dirname ${0})"
|
||||||
|
version=${1}
|
||||||
|
cp -vf "${dir}/${name}.1.adoc" .
|
||||||
|
sed -Ei "s/(Revision: +)[0-9]+\.[0-9]\.[0-9]/\1${version}/" "${name}.1.adoc"
|
||||||
|
a2x --doctype manpage --format manpage --no-xmllint "${name}.1.adoc"
|
||||||
|
else
|
||||||
|
echo "usage: ${0} VERSION" >&2
|
||||||
|
fi
|
27
gitea2rss.1.adoc
Normal file
27
gitea2rss.1.adoc
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
= gitea2rss(1)
|
||||||
|
:doctype: manpage
|
||||||
|
:Author: tastytea
|
||||||
|
:Email: tastytea@tastytea.de
|
||||||
|
:Date: 2019-04-17
|
||||||
|
:Revision: 0.0.0
|
||||||
|
:man source: gitea2rss
|
||||||
|
:man version: {revision}
|
||||||
|
:man manual: General Commands Manual
|
||||||
|
|
||||||
|
== NAME
|
||||||
|
|
||||||
|
gitea2rss - Turns Gitea releases into RSS feeds.
|
||||||
|
|
||||||
|
== SYNOPSIS
|
||||||
|
|
||||||
|
*gitea2rss* _URL of Gitea project_
|
||||||
|
|
||||||
|
== EXAMPLES
|
||||||
|
|
||||||
|
gitea2rss https://example.com/user/repo
|
||||||
|
|
||||||
|
== REPORTING BUGS
|
||||||
|
|
||||||
|
Bugtracker: https://schlomp.space/tastytea/gitea2rss/issues
|
||||||
|
|
||||||
|
E-mail: tastytea@tastytea.de
|
31
src/main.cpp
Normal file
31
src/main.cpp
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
/* This file is part of gitea2rss.
|
||||||
|
* Copyright © 2019 tastytea <tastytea@tastytea.de>
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, version 3.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <iostream>
|
||||||
|
|
||||||
|
using std::cout;
|
||||||
|
using std::cerr;
|
||||||
|
using std::endl;
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
if (argc < 2)
|
||||||
|
{
|
||||||
|
cerr << "usage: " << argv[0] << " URL of Gitea project\n";
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
|
}
|
9
src/version.hpp.in
Normal file
9
src/version.hpp.in
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#ifndef VERSION_HPP
|
||||||
|
#define VERSION_HPP
|
||||||
|
|
||||||
|
namespace global
|
||||||
|
{
|
||||||
|
static constexpr char version[] = "@PROJECT_VERSION@";
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif // VERSION_HPP
|
Loading…
x
Reference in New Issue
Block a user