Correct the spec file to allow RPM's to be built
[freeradius.git] / redhat / freeradius.spec
1 %define name freeradius-alpha-snapshot
2 # FIXME: find a way of getting rid of "-" on versions ... rpm will be happy
3 %define ver 22-Sep-00
4 %define verX 22_Sep_00
5
6 Name: %{name}
7 Version: %{verX}
8 Release: 0
9
10 Summary:        High-performance and highly configurable RADIUS server
11 URL:            http://www.freeradius.org/
12 Copyright:      GPL
13 Group:          Networking/Daemons
14
15 Prereq:         /sbin/chkconfig
16 # FIXME: snmpwalk, snmpget and rusers POSSIBLY needed by checkrad
17 Requires:       libtool
18 Conflicts:      cistron-radius
19
20 Source:         %{name}-%{ver}.tar.gz
21 # FIXME: won't be good to include these contrib examples?
22 # Source1:      http://www.ping.de/~fdc/radius/radacct-replay
23 # Source2:      http://www.ping.de/~fdc/radius/radlast-0.03
24 # Source3:      ftp://ftp.freeradius.org/pub/radius/contrib/radwho.cgi
25
26 %define setupdir %{name}-%{ver}
27 BuildRoot: /var/tmp/%{setupdir}.root
28
29 %description
30 The FreeRADIUS Server Project is an attempt to create a high-performance 
31 and highly configurable GPL'd RADIUS server. It is generally similar to 
32 the Livingston 2.0 RADIUS server, but has a lot more features, and is 
33 much more configurable.
34
35 %prep 
36 %setup -qn %{setupdir}
37
38 # FIXME: some folks prefer -dist files ... rename them or not?
39 #cd raddb
40 #chmod 640 clients naspasswd radiusd.conf.in
41 #cd ..
42
43 %build
44 CFLAGS="$RPM_OPT_FLAGS" \
45 %configure --prefix=/usr --localstatedir=/var --sysconfdir=/etc \
46         --mandir=/usr/man \
47         --with-threads \
48         --with-thread-pool \
49         --with-gnu-ld \
50         --disable-ltdl-install
51 make
52
53 %install
54 # prepare $RPM_BUILD_ROOT
55 rm -rf $RPM_BUILD_ROOT
56 mkdir -p $RPM_BUILD_ROOT/etc/{logrotate.d,pam.d,rc.d/init.d}
57
58 # install files
59 make install R=$RPM_BUILD_ROOT
60
61 # remove unneeded stuff
62 rm -f $RPM_BUILD_ROOT/usr/{man/man8/builddbm.8,sbin/rc.radiusd}
63
64 cd redhat
65 install -m 555 rc.radiusd-redhat $RPM_BUILD_ROOT/etc/rc.d/init.d/radiusd.init
66 install -m 644 radiusd-logrotate $RPM_BUILD_ROOT/etc/logrotate.d/radiusd
67 install -m 644 radiusd-pam       $RPM_BUILD_ROOT/etc/pam.d/radius
68 cd ..
69
70 %preun
71 if [ "$1" = "0" ]; then
72         /sbin/chkconfig --del radiusd.init
73 fi
74
75 %postin
76 if [ "$1" = "0" ]; then
77         /sbin/chkconfig --add radiusd.init
78 fi
79 # done here to avoid messing up existing installations
80 for i in radutmp radwtmp # radius.log radwatch.log checkrad.log
81 do
82   touch /var/log/$i
83   chown root.root /var/log/$i
84 done
85
86 %clean
87 rm -rf $RPM_BUILD_ROOT
88
89 %files
90 %defattr(-,root,root)
91 %doc doc/ChangeLog doc/README* todo/ COPYRIGHT INSTALL
92 %config /etc/pam.d/radius
93 %config /etc/logrotate.d/radiusd
94 %config /etc/rc.d/init.d/radiusd.init
95 %config /etc/raddb/*
96 /usr/man/*
97 /usr/bin/*
98 /usr/sbin/*
99 /usr/lib/*
100 #%dir(missingok) /var/log/radacct/
101 #/var/log/checkrad.log
102 #/var/log/radwatch.log
103 #/var/log/radius.log
104 #/var/log/radwtmp
105 #/var/log/radutmp
106
107 %changelog
108 * Fri Sep 22 2000 Bruno Lopes F. Cabral <bruno@openline.com.br>
109 - spec file clear accordling to the libltdl fix and minor updates
110
111 * Wed Sep 12 2000 Bruno Lopes F. Cabral <bruno@openline.com.br>
112 - Updated to snapshot-12-Sep-00
113
114 * Fri Jun 16 2000 Bruno Lopes F. Cabral <bruno@openline.com.br>
115 - Initial release
116