# BRCM_VERSION=3
[bcm963xx.git] / userapps / opensource / reaim / contrib / reaim.spec
1 %define name reaim
2 %define version 0.8
3 %define release 1mdk
4 %define __spec_install_post %{_libdir}/rpm/brp-compress
5 %define initrddir %([ -d /etc/init.d -a ! -L /etc/init.d ] && echo /etc/init.d || echo /etc/rc.d/init.d)
6
7 Name: %{name} 
8 Summary: Allows DCC through AIM and MSN clients behind a NAT
9 Version: %{version} 
10 Release: %{release}
11 Source: http://prdownloads.sourceforge.net/reaim/reaim-%{version}.tar.gz
12 URL: http://reaim.sourceforge.net/
13 Group: Applications/Internet
14 BuildRoot: %{_tmppath}/%{name}-buildroot
15 License: GNU General Public License
16 Requires: shadow-utils chkconfig fileutils
17
18 %description
19 ReAIM is a compact transparent proxy designed to be run on or behind a Linux IPTables based firewall. 
20 When run behind a simple address-translating firewall, the current AIM and MSN client software does not 
21 allow direct-connections between users to work. AIM requires direct-connections for file and image transfers.
22
23 This proxy is designed to transparently intercept AIM and/or MSN client messages and pass them through a configurable 
24 filter/rewrite chain. This allows selective modification of the source address provided in direct-connection 
25 setup packets, and so remote users can be told to use the global internet routable address, rather than the 
26 actual IP address of the client on the local network.
27
28 %prep
29 %setup
30
31
32 %build
33 %make
34
35
36 %install
37 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
38
39 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/reaim
40 mkdir -p $RPM_BUILD_ROOT%{_sbindir}
41 mkdir -p $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d
42 mkdir -p $RPM_BUILD_ROOT%{initrddir}
43 mkdir -p $RPM_BUILD_ROOT%{_mandir}/man8
44
45 cp $RPM_BUILD_DIR/%name-%version/reaim $RPM_BUILD_ROOT%{_sbindir}/reaim
46 cp $RPM_BUILD_DIR/%name-%version/firewall.sh $RPM_BUILD_ROOT%{_sysconfdir}/reaim/firewall.sh
47 cp $RPM_BUILD_DIR/%name-%version/redhat/etc/init.d/reaim $RPM_BUILD_ROOT%{initrddir}/reaim
48 cp $RPM_BUILD_DIR/%name-%version/redhat/etc/logrotate.d/reaim $RPM_BUILD_ROOT%{_sysconfdir}/logrotate.d/reaim
49 cp $RPM_BUILD_DIR/%name-%version/reaim.8 $RPM_BUILD_ROOT%{_mandir}/man8/reaim.8
50 cp -a html/ $RPM_BUILD_ROOT%{_sysconfdir}/reaim/html
51
52 %clean
53 [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
54 [ "$RPM_BUILD_DIR" != "/" ] && rm -rf $RPM_BUILD_DIR/%name-%version
55
56 %files
57 %defattr(-, root, root)
58 %attr(755,root,root) %{_sbindir}/reaim
59 %attr(744,root,root) %{_sysconfdir}/reaim/firewall.sh
60 %attr(744,root,root) %{initrddir}/reaim
61 %attr(644,root,root) %{_sysconfdir}/logrotate.d/reaim
62 %attr(644,root,root) %{_mandir}/man8/reaim.8.bz2
63
64 %docdir %{_sysconfdir}/reaim/html
65 %{_sysconfdir}/reaim/html
66
67 %post
68 if [ "$1" = "1" ]; then
69 useradd -c "ReAim Proxy Server" -d / -s /sbin/nologin reaim
70 touch /var/log/reaim.log
71 chmod 640 /var/log/reaim.log
72 chown reaim.adm /var/log/reaim.log
73 chkconfig --add reaim
74 %{initrddir}/reaim start
75 fi
76
77 echo ""
78 echo "*******************************************************************************************************************"
79 echo "* ReAIM setup is NOT COMPLETE! In order for ReAIM to work you must manually set up the appropriate firewall rules *"
80 echo "* Please read the information in the man page as well as the html documentation located in /etc/reaim/html        *"
81 echo "* For your convenience, a sample firewall script has been provided to you located in /etc/reaim                   *" 
82 echo "*******************************************************************************************************************"
83 echo ""
84
85 %preun
86 %{initrddir}/reaim condstop
87 chkconfig --del reaim
88
89 %postun
90 if [ "$1" = "0" ]; then
91 rm -f /var/log/reaim.log
92 userdel reaim
93 fi
94
95 %changelog
96 * Wed Mar 26 2003 Sean Donner <siegex@maximus.homelinux.net> 0.7-1mdk
97 - Spec file finally completed