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" && "%{distrorelease}" >= "7"
45 Requires: inotify-tools-devel
50 %if ("%{distroname}" == "Fedora" && "%{distrorelease}" >= "6") || ("%{distroname}" == "CentOS" && "%{distrorelease}" >= "5")
51 Requires: libpcap-devel
54 Requires: linuxdoc-tools
62 Requires: mysql-server
64 Requires: ncurses-devel
66 Requires: ocaml-ocamldoc
74 Requires: postgresql-devel
75 Requires: postgresql-python
76 Requires: postgresql-server
78 Requires: python-devel
79 %if ("%{distroname}" == "Fedora" && "%{distrorelease}" >= "5") || ("%{distroname}" == "CentOS" && "%{distrorelease}" >= "5")
80 Requires: python-pycurl
81 Requires: python-psycopg2
84 Requires: readline-devel
85 Requires: redhat-rpm-config
103 Requires: xmlsec1-openssl
106 %define debug_package %{nil}
109 This package installs a complete PlanetLab development
110 environment. The default installation consists of all the packages
111 necessary to compile MyPLC.
118 rm -rf $RPM_BUILD_ROOT
119 mkdir -p $RPM_BUILD_ROOT/etc
123 touch $RPM_BUILD_ROOT/etc/myplc-devel-native
126 rm -rf $RPM_BUILD_ROOT
129 if [ -n "$SUDO_USER" ] ; then
130 # Allow user to delete the build directory
131 chown -h -R $SUDO_USER .
132 # Some temporary cdroot files like /var/empty/sshd and
133 # /usr/bin/sudo get created with non-readable permissions.
134 find . -not -perm +0600 -exec chmod u+rw {} \;
135 # Allow user to delete the built RPM(s)
136 chown -h -R $SUDO_USER %{_rpmdir}/%{_arch}
143 if [ -h "/sbin/new-kernel-pkg" ] ; then
144 filename=$(readlink -f /sbin/new-kernel-pkg)
145 if [ "$filename" == "/sbin/true"] ; then
146 echo "WARNING: /sbin/new-kernel-pkg symlinked to /sbin/true"
147 echo "\tmost likely /etc/rpm/macros has /sbin/new-kernel-pkg declared in _netsharedpath."
148 echo "\tPlease remove /sbin/new-kernel-pkg from _netsharedpath and reintall mkinitrd."
156 # add a "build" user to the system
157 builduser=$(grep "^build" /etc/passwd | wc -l)
158 if [ $builduser -eq 0 ] ; then
159 groupadd -o -g $gid build;
160 useradd -o -c 'Automated Build' -u $uid -g $gid -n -M -s /bin/bash build;
163 # myplc-devel on a shared box requires that we set up max loop devices
164 for i in $(seq 0 255) ; do
165 mknod -m 640 /dev/loop$i b 7 $i
168 # Allow build user to build certain RPMs as root
169 buildsudo=$(grep "^build.*ALL=(ALL).*NOPASSWD:.*ALL" /etc/sudoers | wc -l)
170 if [ $buildsudo -eq 0 ] ; then
171 echo "build ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
174 # Don't requiretty for sudo. Needed to build myplc from cron job
175 ttysudo=$(grep "^Defaults.*requiretty" /etc/sudoers | wc -l)
176 if [ $ttysudo -eq 1 ] ; then
177 sed -i 's,^Defaults.*requiretty,#Defaults requiretty,' /etc/sudoers
181 # 0 = erase, 1 = upgrade
182 if [ $1 -eq 0 ] ; then
183 echo "NOTE: should remove build user from /etc/sudoers"
187 %defattr(-,root,root,-)
188 /etc/myplc-devel-native
191 * Fri Oct 05 2007 Marc E. Fiuczynski <mef@cs.princeton.edu>