Skip to content

Commit

Permalink
Add a simple RPM build setup
Browse files Browse the repository at this point in the history
This change adds a simple RPM build setup reusing
most of 4DIAC's current build system. It only adds
a spec file, a systemd service and a bit of
configuration for 'tito', which is used for local
RPM builds.

Signed-off-by: Jens Reimann <[email protected]>
Change-Id: If2370ff30430b70008f0852298e2efa97d474d2e
  • Loading branch information
ctron committed Sep 4, 2017
1 parent 6b62fa1 commit d4aa68a
Show file tree
Hide file tree
Showing 5 changed files with 88 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .tito/packages/.readme
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
the .tito/packages directory contains metadata files
named after their packages. Each file has the latest tagged
version and the project's relative directory.
5 changes: 5 additions & 0 deletions .tito/tito.props
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[buildconfig]
builder = tito.builder.Builder
tagger = tito.tagger.VersionTagger
changelog_do_not_remove_cherrypick = 0
changelog_format = %s (%ae)
61 changes: 61 additions & 0 deletions 4diac-forte.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
Name: 4diac-forte
Version: 1.9.0
Release: 1%{?dist}
Summary: IEC 61499 runtime environment
License: EPL
URL: http://eclipse.org/4diac
Source0: https://git.eclipse.org/c/4diac/org.eclipse.4diac.forte.git/snapshot/org.eclipse.4diac.forte.git-%{version}.tar.gz

%{?systemd_requires}
BuildRequires: cmake, gcc-c++
BuildRequires: systemd

%description
The 4DIAC runtime environment (4DIAC-RTE, FORTE) is a small portable
implementation of an IEC 61499 runtime environment targeting small
embedded control devices (16/32 Bit), implemented in C++. It supports
online-reconfiguration of its applications and the real-time capable
execution of all function block types provided by the IEC 61499 standard.

%prep
%setup -q

%build
mkdir -p bin/posix
cd bin/posix
%cmake -DFORTE_ARCHITECTURE=Posix \
-DFORTE_COM_ETH=ON \
-DFORTE_COM_FBDK=ON \
-DFORTE_COM_LOCAL=ON \
-DFORTE_MODULE_CONVERT=ON \
-DFORTE_MODULE_IEC61131=ON \
%{?_with_sysfs: -DFORTE_MODULE_SysFs=ON } \
-DFORTE_MODULE_UTILS=ON \
-DFORTE_TESTS=OFF \
../..
make %{?_smp_mflags}

%install
mkdir -p %{buildroot}%{_unitdir}
install systemd/4diac-forte.service %{buildroot}%{_unitdir}
cd bin/posix
%make_install

%post
%systemd_post 4diac-forte.service

%preun
%systemd_preun 4diac-forte.service

%postun
%systemd_postun_with_restart 4diac-forte.service

%files
%license epl-v10.html
%{_bindir}/forte
%{_unitdir}/4diac-forte.service

%changelog
* Fri Sep 01 2017 Jens Reimann <[email protected]> - 1.9.0-1
- Initial version of the package

6 changes: 6 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,9 @@ files:

rm -Rf CMakeCache.txt CMakeFiles/

## Building a local RPM

For building local RPMs you can use (tito)[https://github.com/dgoodwin/tito]

tito build --test --rpm

13 changes: 13 additions & 0 deletions systemd/4diac-forte.service
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
[Unit]
Description=Eclipse 4DIAC Forte Runtime
After=syslog.target network.target

[Service]
Type=simple
ExecStart=/usr/bin/forte
Restart=on-failure
TimeoutStopSec=30s

[Install]
WantedBy=multi-user.target

0 comments on commit d4aa68a

Please sign in to comment.