2 Packager: PlanetLab Central <support@planet-lab.org>
3 Distribution: PlanetLab 4.0
4 URL: http://svn.planet-lab.org/svn/MyPLC
6 Summary: PlanetLab Central (PLC) Development Environment
7 Name: MyPLC-devel-native
9 Release: 2%{?pldistro:.%{pldistro}}%{?date:.%{date}}
11 Group: Development/Tools
12 Source0: %{name}-%{version}.tar.gz
13 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root
16 # group this according to the requirements of the different packages we build
17 Requires: beecrypt-devel
29 Requires: docbook-utils-pdf
38 Requires: glibc-common
44 %if "%{distroname}" == "Fedora"
45 %if "%{distrorelease}" >= "7"
46 Requires: inotify-tools-devel
52 %if "%{distroname}" == "Fedora"
53 %if "%{distrorelease}" >= "6"
54 Requires: libpcap-devel
57 %if "%{distroname}" == "CentOS"
58 %if "%{distrorelease}" >= "5")
59 Requires: libpcap-devel
63 Requires: linuxdoc-tools
71 Requires: mysql-server
73 Requires: ncurses-devel
75 Requires: ocaml-ocamldoc
83 Requires: postgresql-devel
84 Requires: postgresql-python
85 Requires: postgresql-server
87 Requires: python-devel
88 %if "%{distroname}" == "Fedora"
89 %if "%{distrorelease}" >= "5"
90 Requires: python-pycurl
91 Requires: python-psycopg2
94 %if "%{distroname}" == "CentOS"
95 %if "%{distrorelease}" >= "5")
96 Requires: python-pycurl
97 Requires: python-psycopg2
101 Requires: readline-devel
102 Requires: redhat-rpm-config
108 Requires: sendmail-cf
114 Requires: tetex-latex
120 Requires: xmlsec1-openssl
123 %define debug_package %{nil}
126 This package installs a complete PlanetLab development
127 environment. The default installation consists of all the packages
128 necessary to compile MyPLC.
135 rm -rf $RPM_BUILD_ROOT
136 mkdir -p $RPM_BUILD_ROOT/etc
140 touch $RPM_BUILD_ROOT/etc/myplc-devel-native
143 rm -rf $RPM_BUILD_ROOT
146 if [ -n "$SUDO_USER" ] ; then
147 # Allow user to delete the build directory
148 chown -h -R $SUDO_USER .
149 # Some temporary cdroot files like /var/empty/sshd and
150 # /usr/bin/sudo get created with non-readable permissions.
151 find . -not -perm +0600 -exec chmod u+rw {} \;
152 # Allow user to delete the built RPM(s)
153 chown -h -R $SUDO_USER %{_rpmdir}/%{_arch}
160 if [ -h "/sbin/new-kernel-pkg" ] ; then
161 filename=$(readlink -f /sbin/new-kernel-pkg)
162 if [ "$filename" == "/sbin/true"] ; then
163 echo "WARNING: /sbin/new-kernel-pkg symlinked to /sbin/true"
164 echo "\tmost likely /etc/rpm/macros has /sbin/new-kernel-pkg declared in _netsharedpath."
165 echo "\tPlease remove /sbin/new-kernel-pkg from _netsharedpath and reintall mkinitrd."
173 # add a "build" user to the system
174 builduser=$(grep "^build" /etc/passwd | wc -l)
175 if [ $builduser -eq 0 ] ; then
176 groupadd -o -g $gid build;
177 useradd -o -c 'Automated Build' -u $uid -g $gid -n -M -s /bin/bash build;
180 # myplc-devel on a shared box requires that we set up max loop devices
181 for i in $(seq 0 255) ; do
182 mknod -m 640 /dev/loop$i b 7 $i
185 # Allow build user to build certain RPMs as root
186 buildsudo=$(grep "^build.*ALL=(ALL).*NOPASSWD:.*ALL" /etc/sudoers | wc -l)
187 if [ $buildsudo -eq 0 ] ; then
188 echo "build ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
191 # Don't requiretty for sudo. Needed to build myplc from cron job
192 ttysudo=$(grep "^Defaults.*requiretty" /etc/sudoers | wc -l)
193 if [ $ttysudo -eq 1 ] ; then
194 sed -i 's,^Defaults.*requiretty,#Defaults requiretty,' /etc/sudoers
198 # 0 = erase, 1 = upgrade
199 if [ $1 -eq 0 ] ; then
200 echo "NOTE: should remove build user from /etc/sudoers"
204 %defattr(-,root,root,-)
205 /etc/myplc-devel-native
208 * Fri Oct 05 2007 Marc E. Fiuczynski <mef@cs.princeton.edu>