re6stnet.spec 1.3 KB
Newer Older
1
%define _builddir %(pwd)
2
%define ver %(python2 re6st/version.py)
3
%define units re6stnet.service re6st-registry.service
4

5 6 7 8 9 10 11 12 13 14
Summary:    resilient, scalable, IPv6 network application
Name:       re6stnet
Version:    %(set %ver; echo ${1%%-*})
Release:    %(set %ver; echo ${1#*-})
License:    GPLv2+
Group:      Applications/Internet
BuildArch:  noarch
Requires:   babeld = 1.6.2-nxd1
Requires:   iproute
Requires:   openssl
Killian Lufau's avatar
Killian Lufau committed
15
Requires:   openvpn >= 2.4
16 17 18 19 20
Requires:   python >= 2.7
Requires:   pyOpenSSL >= 0.13
Requires:   python-setuptools
Recommends: python-miniupnpc
Conflicts:  re6st-node
21 22 23 24

%description

%build
25
make
26 27

%install
28
set $RPM_BUILD_ROOT
29
make install PREFIX=%_prefix MANDIR=%_mandir DESTDIR=$1 %{?_unitdir:UNITDIR=%{_unitdir}}
30 31 32
# Exclude man pages because they will be compressed.
find $1 -mindepth 1 -path \*%_mandir -prune -o \
  -name re6st\* -prune -printf /%%P\\n > INSTALLED
33 34

%clean
35
rm -rf "$RPM_BUILD_ROOT" INSTALLED
36 37 38 39 40 41

%files -f INSTALLED
%_mandir/*/*

%post
if [ $1 -eq 1 ]; then
42
    /bin/systemctl preset %{units} || :
43 44 45 46
fi >/dev/null 2>&1

%preun
if [ $1 -eq 0 ]; then
47 48
    /bin/systemctl --no-reload disable %{units} || :
    /bin/systemctl stop %{units} || :
49 50 51 52
fi >/dev/null 2>&1

%postun
/bin/systemctl daemon-reload >/dev/null 2>&1 || :
53 54
if [ $1 -ge 1 ]; then
    /bin/systemctl try-restart %{units} >/dev/null 2>&1 || :
55
fi