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"
51 Requires: libpcap-devel
53 %if "%{distroname}" == "CentOS" && "%{distrorelease}" >= "5"
54 Requires: libpcap-devel
57 Requires: linuxdoc-tools
65 Requires: mysql-server
67 Requires: ncurses-devel
69 Requires: ocaml-ocamldoc
77 Requires: postgresql-devel
78 Requires: postgresql-python
79 Requires: postgresql-server
81 Requires: python-devel
82 %if "%{distroname}" == "Fedora" && "%{distrorelease}" >= "5"
83 Requires: python-pycurl
84 Requires: python-psycopg2
86 %if "%{distroname}" == "CentOS" && "%{distrorelease}" >= "5"
87 Requires: python-pycurl
88 Requires: python-psycopg2
91 Requires: readline-devel
92 Requires: redhat-rpm-config
104 Requires: tetex-latex
110 Requires: xmlsec1-openssl
113 %define debug_package %{nil}
116 This package installs a complete PlanetLab development
117 environment. The default installation consists of all the packages
118 necessary to compile MyPLC.
125 rm -rf $RPM_BUILD_ROOT
126 mkdir -p $RPM_BUILD_ROOT/etc
130 touch $RPM_BUILD_ROOT/etc/myplc-devel-native
133 rm -rf $RPM_BUILD_ROOT
136 if [ -n "$SUDO_USER" ] ; then
137 # Allow user to delete the build directory
138 chown -h -R $SUDO_USER .
139 # Some temporary cdroot files like /var/empty/sshd and
140 # /usr/bin/sudo get created with non-readable permissions.
141 find . -not -perm +0600 -exec chmod u+rw {} \;
142 # Allow user to delete the built RPM(s)
143 chown -h -R $SUDO_USER %{_rpmdir}/%{_arch}
150 if [ -h "/sbin/new-kernel-pkg" ] ; then
151 filename=$(readlink -f /sbin/new-kernel-pkg)
152 if [ "$filename" == "/sbin/true"] ; then
153 echo "WARNING: /sbin/new-kernel-pkg symlinked to /sbin/true"
154 echo "\tmost likely /etc/rpm/macros has /sbin/new-kernel-pkg declared in _netsharedpath."
155 echo "\tPlease remove /sbin/new-kernel-pkg from _netsharedpath and reintall mkinitrd."
163 # add a "build" user to the system
164 builduser=$(grep "^build" /etc/passwd | wc -l)
165 if [ $builduser -eq 0 ] ; then
166 groupadd -o -g $gid build;
167 useradd -o -c 'Automated Build' -u $uid -g $gid -n -M -s /bin/bash build;
170 # myplc-devel on a shared box requires that we set up max loop devices
171 for i in $(seq 0 255) ; do
172 mknod -m 640 /dev/loop$i b 7 $i
175 # Allow build user to build certain RPMs as root
176 buildsudo=$(grep "^build.*ALL=(ALL).*NOPASSWD:.*ALL" /etc/sudoers | wc -l)
177 if [ $buildsudo -eq 0 ] ; then
178 echo "build ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
181 # Don't requiretty for sudo. Needed to build myplc from cron job
182 ttysudo=$(grep "^Defaults.*requiretty" /etc/sudoers | wc -l)
183 if [ $ttysudo -eq 1 ] ; then
184 sed -i 's,^Defaults.*requiretty,#Defaults requiretty,' /etc/sudoers
188 # 0 = erase, 1 = upgrade
189 if [ $1 -eq 0 ] ; then
190 echo "NOTE: should remove build user from /etc/sudoers"
194 %defattr(-,root,root,-)
195 /etc/myplc-devel-native
198 * Fri Oct 05 2007 Marc E. Fiuczynski <mef@cs.princeton.edu>