5 %define url $URL: svn+ssh://svn.planet-lab.org/svn/PLCRT/trunk/plcrt.spec $
11 %define release %{taglevel}%{?pldistro:.%{pldistro}}%{?date:.%{date}}
16 Source0: %{name}-%{version}.tar.bz2
18 Group: Applications/System
19 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-buildroot
22 Packager: PlanetLab Central <support@planet-lab.org>
23 Distribution: PlanetLab %{plrelease}
24 URL: %(echo %{url} | cut -d ' ' -f 2)
26 Summary: PLCRT account initialization for the root image.
27 Group: Applications/System
31 Requires: rt3-mailgate
35 PLCRT is a collection of configuration scripts for configuring RT.
36 By default RT does not come with all the settings needed for a standard PLC,
37 or PlanetLab in particular.
44 install -d $RPM_BUILD_ROOT/%{_datadir}/%{name}
45 install -D -m 755 plcrt.init $RPM_BUILD_ROOT/%{_sysconfdir}/plc.d/plcrt
47 echo " * Installing core scripts"
48 rsync -a ./ $RPM_BUILD_ROOT/%{_datadir}/%{name}/
50 install -D -m 644 rt.cron $RPM_BUILD_ROOT/%{_sysconfdir}/cron.d/rt.cron
51 install -D -m 755 getpersons.py $RPM_BUILD_ROOT/%{_datadir}/%{name}/getpersons.py
52 install -D -m 755 callplcsh.py $RPM_BUILD_ROOT/%{_datadir}/%{name}/callplcsh.py
53 install -D -m 755 adduserstort.pl $RPM_BUILD_ROOT/%{_datadir}/%{name}/adduserstort.pl
55 echo " * Installing cron scripts"
56 chmod 755 $RPM_BUILD_ROOT/%{_datadir}/%{name}/cron.d/*.sh
59 rm -rf $RPM_BUILD_ROOT
63 #%config /etc/plcrt.conf
65 %{_sysconfdir}/plc.d/plcrt
66 %{_sysconfdir}/cron.d/rt.cron
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
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 <variable id="web_user" type="string">\n <name>username</name>\n <value>root</value>\n <description>The user name for RT access.</description>\n </variable>\n <variable id="web_password" type="password">\n <name>password</name>\n <value>password</value>\n <description>password to the rt user.</description>\n </variable>\n <variable id="cc_address" type="email">\n <name>email list</name>\n <value>root+list@localhost.localdomain</value>\n <description></description>\n </variable>\n <variable id="dbpassword" type="password">\n <name>Database Password</name>\n <value></value>\n <description>Password to use when accessing the RT database.</description>\n </variable>\n </variablelist>\n </category>\n <category id="plc_net">|' /etc/planetlab/default_config.xml
77 mkdir -p /etc/planetlab/configs
78 plc-config --category plc_rt --variable cc_address \
79 --value 'root+list@localhost.localdomain'\
80 --save /etc/planetlab/default_config.xml /etc/planetlab/default_config.xml
82 plc-config --category plc_rt --variable enabled --value true \
83 --save /etc/planetlab/configs/site.xml /etc/planetlab/default_config.xml
85 # NOTE: setup default values until myplc includes them by default.
86 plc-config --category plc_rt --variable host --value localhost.localdomain \
87 --save /etc/planetlab/configs/site.xml /etc/planetlab/configs/site.xml
88 plc-config --category plc_rt --variable ip --value "" \
89 --save /etc/planetlab/configs/site.xml /etc/planetlab/configs/site.xml
90 plc-config --category plc_rt --variable web_user --value root \
91 --save /etc/planetlab/configs/site.xml /etc/planetlab/configs/site.xml
92 plc-config --category plc_rt --variable web_password --value password \
93 --save /etc/planetlab/configs/site.xml /etc/planetlab/configs/site.xml
94 plc-config --category plc_rt --variable dbpassword --value "" \
95 --save /etc/planetlab/configs/site.xml /etc/planetlab/configs/site.xml
97 # NOTE: not sure why these aren't setup by the rt package...
99 touch /var/log/rt3/rt.log
100 chown apache.apache /var/log/rt3/rt.log
102 cp /usr/share/rt3/html/NoAuth/images/bplogo.gif /var/www/html/misc/logo.gif
105 * Sat Sep 19 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - PLCRT-1.0-6
106 - some plcs don't return site_ids so getpersons should not depend on this field
107 - make scripts exec on install
108 - use RT_HOST name rather than localhost for RT mailgate configuration
110 * Wed Jul 08 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - PLCRT-1.0-5
111 - add mailing list watchers to default queues
112 - add script to addwatchers to default queues
113 - improved templates in plcrt.init
115 * Mon Jul 06 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - PLCRT-1.0-4
117 - template conf.d/* files rather than one-shot re-write
118 - better %post in spec file for logo and default xml settings.
120 * Sat Jul 04 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - PLCRT-1.0-3
121 - renamed getpersons.py to accept a given 'role'
122 - changed syncadmins.sh to use callplcsh.py
123 - added callplcsh.py to allow either a local or remote plc using plcsh
125 * Tue Jun 30 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - PLCRT-1.0-2
126 - improved init setup
127 - added plcsh version of getadmins script to add users to RT's db.
128 - improved %post code for installation
130 * Fri Jun 26 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - PLCRT-1.0-1
131 - trying to get the tag to work for new package.
133 * Thu Jun 26 2009 Stephen Soltesz <soltesz@cs.princeton.edu> - PLCRT-1.0-1