beadcfe7422c502ab3bfc437eb718edbd2f077a0
[tinc] / redhat / tinc.spec
1 Summary: tinc Virtual Private Network daemon
2 Name: tinc
3 Version: 1.0pre1
4 Release: 2
5 Copyright: GPL
6 Group: System Environment/Daemons
7 URL: http://tinc.nl.linux.org/
8 Source0: %{name}-%{version}.tar.gz
9 Buildroot: /var/tmp/%{name}-%{version}-%{release}
10 # for building the package the following is required:
11 # /usr/bin/texi2html /usr/bin/patch
12
13 %description
14 # taken from doc/tinc.texi
15 tinc is a Virtual Private Network (VPN) daemon that uses tunneling and
16 encryption to create a secure private network between hosts on the
17 Internet.
18
19 Because the tunnel appears to the IP level network code as a normal
20 network device, there is no need to adapt any existing software.
21
22 This tunneling allows VPN sites to share information with each other
23 over the Internet without exposing any information to others.
24
25 See http://tinc.nl.linux.org/
26
27 %prep
28
29 %setup -q -n %{name}-%{version}
30
31 %build
32 ./configure --prefix=/usr --sysconfdir=/etc
33 make
34 /usr/bin/texi2html doc/tinc.texi
35
36 %install
37 rm -rf $RPM_BUILD_ROOT
38 make install DESTDIR=$RPM_BUILD_ROOT
39 gzip $RPM_BUILD_ROOT/usr/info/tinc.info
40
41 mkdir -p $RPM_BUILD_ROOT/etc/rc.d/init.d/
42 cp redhat/tinc $RPM_BUILD_ROOT/etc/rc.d/init.d/
43
44 ME=my.vpn.ip.number
45 PEER=peer.vpn.ip.number
46 PEEREAL=peer.real.ip.number
47
48 umask 077
49 mkdir -p $RPM_BUILD_ROOT/etc/tinc/$PEER/passphrases
50 cat <<END >$RPM_BUILD_ROOT/etc/tinc/$PEER/tinc.conf
51 # Sample tinc configuration. 
52 # Insert your own ip numbers instead of the placeholders,
53 # and be sure to use your own passphrases.
54 # See man tinc.conf(5) tincd(8) genauth(8), info tinc and 
55 # /usr/doc/%{name}-%{version}/tinc.conf.sample
56 TapDevice = /dev/tap0
57 ConnectTo = $PEEREAL
58 MyVirtualIP = $ME/32
59 AllowConnect = no
60 END
61 cat <<END >$RPM_BUILD_ROOT/etc/tinc/$PEER/passphrases/local
62 128 0c647a1fd34da9d04c1d340ae9363f31
63 END
64 cat <<END >$RPM_BUILD_ROOT/etc/tinc/$PEER/passphrases/$PEER
65 128 aea5a5d414fea63ee3829b592afc0fba
66 END
67
68 %clean
69 rm -rf $RPM_BUILD_ROOT
70
71 %pre
72 %post
73
74 /sbin/chkconfig --add tinc
75
76 grep -q '^tinc[[:space:]]' /etc/services || patch -s /etc/services << END
77 *** services.org        Tue Apr 18 13:22:22 2000
78 --- services    Tue Apr 18 13:24:19 2000
79 ***************
80 *** 145,148 ****
81 --- 145,150 ----
82   hmmp-ind      612/tcp         dqs313_intercell# HMMP Indication / DQS
83   hmmp-ind      612/udp         dqs313_intercell# HMMP Indication / DQS
84 + tinc          655/tcp         TINC            # tinc vpn
85 + tinc          655/udp         TINC            # tinc.nl.linux.org
86   #
87   # UNIX specific services
88 END
89
90 grep -q '^alias tap0' /etc/conf.modules || cat >> /etc/conf.modules << END
91 # tinc uses ethertap/netlink
92 alias tap0 ethertap
93 alias char-major-36 netlink_dev
94 END
95 /sbin/install-info /usr/info/tinc.info.gz /usr/info/dir --entry= \
96         "* tinc: (tinc).                                The tinc Manual."
97
98 %preun
99 %postun
100
101 %files
102 %doc AUTHORS ChangeLog NEWS README THANKS *.html doc/tincd.conf.sample
103 %config /etc/tinc/
104 /etc/rc.d/init.d/tinc
105 /usr/sbin/genauth
106 /usr/sbin/tincd
107 /usr/lib/tinc/
108 /usr/man/man5/tincd.conf.5
109 /usr/man/man8/genauth.8
110 /usr/man/man8/tincd.8
111 /usr/info/tinc.info.gz