re6stnet.spec 1.32 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

%files -f INSTALLED
%_mandir/*/*
39
/etc/NetworkManager
40 41 42

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

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

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