Update TODO
[re6stnet.git] / re6stnet.spec
1 %define _builddir %(pwd)
2 %define ver %(python re6st/version.py)
3
4 Summary: resilient, scalable, IPv6 network application
5 Name: re6stnet
6 Version: %(set %ver; echo ${1%%-*})
7 Release: %(set %ver; echo ${1#*-})
8 License: GPLv2+
9 Group: Applications/Internet
10 BuildArch: noarch
11 Requires: babeld = 1.5.1-nxd2
12 Requires: iproute
13 Requires: openssl
14 Requires: openvpn
15 Requires: python >= 2.7
16 Requires: pyOpenSSL >= 0.13
17
18 %description
19
20 %build
21 for x in docs/*.rst
22 do rst2man $x ${x%%.rst}.1
23 done
24
25 %install
26 set $RPM_BUILD_ROOT /lib/systemd/system
27 python2.7 setup.py install --prefix %_prefix --root=$1
28 install -d $1%_sbindir $1%_mandir/man1 $1$2
29 install -Dpm 0644 docs/*.1 $1%_mandir/man1
30 install -Dpm 0644 daemon/*.service $1$2
31 install -Dp daemon/network-manager $1/etc/NetworkManager/dispatcher.d/50re6stnet
32 install -Dpm 0644 daemon/README.conf $1/etc/re6stnet/README.conf
33 install -Dpm 0644 daemon/logrotate.conf $1/etc/logrotate.d/re6stnet
34 mv $1%_bindir/re6stnet $1%_sbindir
35 find $1 -mindepth 1 -type d -name re6st\* -printf /%%P\\n > INSTALLED
36
37 %clean
38 find "$RPM_BUILD_ROOT" -delete
39 rm INSTALLED
40
41 %files -f INSTALLED
42 %doc README
43 %_bindir/*
44 %_sbindir/*
45 %_mandir/*/*
46 /lib/systemd/system/*
47 /etc/NetworkManager/dispatcher.d/50re6stnet
48 /etc/logrotate.d/re6stnet
49
50 %post
51 if [ $1 -eq 1 ]; then
52 /bin/systemctl enable re6stnet.service re6st-registry.service || :
53 fi >/dev/null 2>&1
54
55 %preun
56 if [ $1 -eq 0 ]; then
57 /bin/systemctl --no-reload disable re6stnet.service re6st-registry.service || :
58 /bin/systemctl stop re6stnet.service re6st-registry.service || :
59 fi >/dev/null 2>&1
60
61 %postun
62 /bin/systemctl daemon-reload >/dev/null 2>&1 || :
63 if [ $1 -ge 1 ] ; then
64 # only try to restart the registry (doing same for re6stnet could be troublesome)
65 /bin/systemctl try-restart re6st-registry.service >/dev/null 2>&1 || :
66 fi
67
68 %changelog
69 * Mon Dec 10 2012 Julien Muchembled <jm@nexedi.com>
70 - Initial package