Skip to content

Commit

Permalink
Copr build
Browse files Browse the repository at this point in the history
  • Loading branch information
SemaiCZE committed Jan 25, 2017
1 parent 3621211 commit 27993b3
Show file tree
Hide file tree
Showing 3 changed files with 73 additions and 6 deletions.
12 changes: 6 additions & 6 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,19 @@ target_link_libraries(${EXEC_NAME} -lboost_filesystem)
target_link_libraries(${EXEC_NAME} -lboost_program_options)
target_link_libraries(${EXEC_NAME} ${CURL_LIBRARIES})

# Include Google Test libraries and then our very own unit tests
add_subdirectory(vendor/googletest EXCLUDE_FROM_ALL)
add_subdirectory(tests)
if(NOT DISABLE_TESTS)
# Include Google Test libraries and then our very own unit tests
add_subdirectory(vendor/googletest EXCLUDE_FROM_ALL)
add_subdirectory(tests)
endif()


# ========== Install targets - 'sudo make install' ==========
include(InstallRequiredSystemLibraries)
if(UNIX)
install(TARGETS recodex-broker DESTINATION /usr/bin COMPONENT binaries)
install(FILES install/recodex-broker.service DESTINATION /etc/systemd/system COMPONENT config)
install(FILES install/recodex-broker.service DESTINATION /lib/systemd/system COMPONENT config)
install(FILES examples/config.yml DESTINATION /etc/recodex/broker COMPONENT config)

install(CODE "execute_process(COMMAND ${CMAKE_CURRENT_SOURCE_DIR}/install/postinst)")
else()
install(TARGETS recodex-broker DESTINATION recodex/broker/bin COMPONENT binaries)
install(FILES examples/config.yml DESTINATION recodex/broker/conf COMPONENT config)
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
[![License](http://img.shields.io/:license-mit-blue.svg)](http://badges.mit-license.org)
[![Docs](https://img.shields.io/badge/docs-latest-brightgreen.svg)](http://recodex.github.io/broker/)
[![Wiki](https://img.shields.io/badge/docs-wiki-orange.svg)](https://github.com/ReCodEx/wiki/wiki)
[![COPR](https://copr.fedorainfracloud.org/coprs/semai/ReCodEx/package/recodex-broker/status_image/last_build.png)](https://copr.fedorainfracloud.org/coprs/semai/ReCodEx/)


## Documentation

Expand Down
65 changes: 65 additions & 0 deletions recodex-broker.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
%define name recodex-broker
%define version 1.0.0
%define unmangled_version 1.0.0
%define release 1

Summary: ReCodEx broker component
Name: %{name}
Version: %{version}
Release: %{release}
Source0: %{name}-%{unmangled_version}.tar.gz
License: MIT
Group: Development/Libraries
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
Prefix: %{_prefix}
Vendor: Petr Stefan <UNKNOWN>
Url: https://github.com/ReCodEx/broker
BuildRequires: systemd cmake
Requires(post): systemd
Requires(preun): systemd
Requires(postun): systemd

%description
Backend part of ReCodEx programmer testing solution.

%prep
%setup -n %{name}-%{unmangled_version}

%build
%cmake -DDISABLE_TESTS=true .
make %{?_smp_mflags}

%install
make install DESTDIR=%{buildroot}
mkdir -p %{buildroot}/var/log/recodex

%clean


%post
%systemd_post 'recodex-broker.service'

%postun
%systemd_postun_with_restart 'recodex-broker.service'

%pre
getent group recodex >/dev/null || groupadd -r recodex
getent passwd recodex >/dev/null || useradd -r -g recodex -d %{_sysconfdir}/recodex -s /sbin/nologin -c "ReCodEx Code Examiner" recodex
exit 0

%preun
%systemd_preun 'recodex-broker.service'

%files
%defattr(-,root,root)
%dir %attr(-,recodex,recodex) %{_sysconfdir}/recodex/broker
%dir %attr(-,recodex,recodex) /var/log/recodex

%{_bindir}/recodex-broker
%config(noreplace) %attr(-,recodex,recodex) %{_sysconfdir}/recodex/broker/config.yml

#%{_unitdir}/recodex-broker.service
/lib/systemd/system/recodex-broker.service

%changelog

0 comments on commit 27993b3

Please sign in to comment.