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