typo
[plcrt.git] / plcrt.spec
1 #
2 # $Id$
3
4
5 %define url $URL: svn+ssh://svn.planet-lab.org/svn/PLCRT/trunk/plcrt.spec $
6
7 %define name plcrt
8 %define version 1.0
9 %define taglevel 1
10
11 %define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
12
13 Name: %{name}
14 Version: %{version}
15 Release: %{release}
16 Source0: %{name}-%{version}.tar.bz2
17 License: GPL
18 Group: Applications/System
19 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
20
21 Vendor: PlanetLab
22 Packager: PlanetLab Central <support@planet-lab.org>
23 Distribution: PlanetLab %{plrelease}
24 URL: %(echo %{url} | cut -d ' ' -f 2)
25
26 Summary: PLCRT account initialization for the root image.
27 Group: Applications/System
28 Requires: python
29 Requires: perl
30 Requires: rt3
31 Requires: myplc
32
33 %description
34 PLCRT is a collection of configuration scripts for configuring RT.
35 By default RT does not come with all the settings needed for a standard PLC,
36 or PlanetLab in particular.  
37
38
39
40 %prep
41 %setup -q
42
43 %install
44
45 install -d $RPM_BUILD_ROOT/%{_datadir}/%{name}
46 install -D -m 755 plcrt.init $RPM_BUILD_ROOT/%{_sysconfdir}/plc.d/plcrt
47
48 echo " * Installing core scripts"
49 rsync -a ./ $RPM_BUILD_ROOT/%{_datadir}/%{name}/
50
51 echo " * Installing cron scripts"
52 install -D -m 644 rt.cron $RPM_BUILD_ROOT/%{_sysconfdir}/cron.d/rt.cron
53
54 chmod 755 $RPM_BUILD_ROOT/%{_datadir}/%{name}/adduserstort.pl
55 chmod 755 $RPM_BUILD_ROOT/%{_datadir}/%{name}/cron.d/*.sh
56
57 %clean
58 rm -rf $RPM_BUILD_ROOT
59
60 %files 
61 %defattr(-,root,root)
62 %config /etc/rt3/RT_SiteConfig.pm
63 #%config /etc/plcrt.conf
64 %{_datadir}/%{name}
65 %{_sysconfdir}/plc.d/plcrt
66 %{_sysconfdir}/cron.d/rt.cron
67
68 %post
69 if grep 'pam_loginuid.so' /etc/pam.d/crond ; then
70     sed -i -e 's/^session    required   pam_loginuid.so/#session    required   pam_loginuid.so/g' /etc/pam.d/crond
71 fi
72
73 if ! grep '<category id="plc_rt">' /etc/planetlab/default_config.xml ; then 
74     sed -i 's|<category id="plc_net">| <category id="plc_rt">\n <name>RT Configuration</name>\n <description>RT</description>\n <variablelist>\n <variable id="enabled" type="boolean">\n <name>Enabled</name>\n <value>false</value>\n <description>Enable on this machine.</description>\n </variable>\n <variable id="host" type="hostname">\n <name>Hostname</name>\n <value>localhost.localdomain</value>\n <description>The fully qualified hostname.</description>\n </variable>\n <variable id="ip" type="ip">\n <name>IP Address</name>\n <value/>\n <description>The IP address of the RT server.</description>\n </variable>\n </variablelist>\n </category>\n <category id="plc_net">|' /etc/planetlab/default_config.xml
75 fi
76
77 plc-config --save /etc/planetlab/default_config.xml \
78                         --category plc_rt --variable enabled --value true
79
80 %changelog
81 * Thu Jun 26 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - PLCRT-1.0-1
82 - initial addition.