Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
Zope
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
Zope
Commits
31b8924a
Commit
31b8924a
authored
Jul 22, 2003
by
Chris McDonough
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
A little work on the RHL RPM specfile.
parent
085ef566
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
169 additions
and
36 deletions
+169
-36
inst/Zope.spec.in
inst/Zope.spec.in
+169
-36
No files found.
inst/Zope.spec.in
View file @
31b8924a
...
@@ -4,10 +4,10 @@
...
@@ -4,10 +4,10 @@
%define minorversion <<ZOPE_MINOR_VERSION>>
%define minorversion <<ZOPE_MINOR_VERSION>>
%define release <<VERSION_RELEASE_TAG>>
%define release <<VERSION_RELEASE_TAG>>
%define version %{majorversion}.%{minorversion}
%define version %{majorversion}.%{minorversion}
%define package
_
name %{name}-%{version}-%{release}
%define packagename %{name}-%{version}-%{release}
%define buildroot %{_tmppath}/%{package
_name}-build
root
%define buildroot %{_tmppath}/%{package
name}-
root
%define target
_
dir /opt/%{name}-%{majorversion}
%define targetdir /opt/%{name}-%{majorversion}
%define inst
_target_dir /var/opt
/zope
%define inst
ancedir /var
/zope
%define python /usr/bin/python2.2
%define python /usr/bin/python2.2
%define zopeuser zope
%define zopeuser zope
...
@@ -15,7 +15,7 @@ Summary: Zope, the open source web application server
...
@@ -15,7 +15,7 @@ Summary: Zope, the open source web application server
Name: %{name}
Name: %{name}
Version: %{version}
Version: %{version}
Release: %{release}
Release: %{release}
Source0: %{package
_name}.tar.
gz
Source0: %{package
name}.t
gz
License: Zope Public License (ZPL)
License: Zope Public License (ZPL)
Group: Applications/Internet
Group: Applications/Internet
BuildRoot: %{buildroot}
BuildRoot: %{buildroot}
...
@@ -23,8 +23,13 @@ Prefix: %{_prefix}
...
@@ -23,8 +23,13 @@ Prefix: %{_prefix}
Vendor: Zope Corporation and Contributors <zope@zope.org>
Vendor: Zope Corporation and Contributors <zope@zope.org>
Url: http://www.zope.org
Url: http://www.zope.org
Requires: python2 >= 2.2.2, /usr/sbin/useradd
# The autorequire script sticks "/usr/local/bin/python"
BuildRequires: python2 >= 2.2.2
# into the required list due to script shebangs in Zope. Turn off auto
# requires/provides for this reason and roll our own Requires/Provides lists
AutoReqProv: no
Requires: python2 >= 2.2.3, /usr/sbin/useradd, ld-linux.so.2, libc.so.6, /bin/sh, /usr/bin/env, /sbin/chkconfig
Provides: Acquisition.so, BTree.so, cAccessControl.so, cDocumentTemplate.so, ComputedAttribute.so, coptimizations.so, cPersistence.so, cPickleCache.so, dcpyexpat.so, ExtensionClass.so, _fsBTree.so, _helper.so, _IIBTree.so, IIBTree.so, initgroups.so, intSet.so, _IOBTree.so, IOBTree.so, ISO_8859_1_Splitter.so, MethodObject.so, Missing.so, MultiMapping.so, _OIBTree.so, OIBTree.so, okascore.so, _OOBTree.so, Record.so, Splitter.so, stopper.so, ThreadLock.so, TimeStamp.so, UnicodeSplitter.so, winlock.so, ZopeSplitter.so
BuildRequires: python2 >= 2.2.3
%description
%description
Zope is an application server framework that enables developers to quickly
Zope is an application server framework that enables developers to quickly
...
@@ -32,51 +37,179 @@ build web applications such as intranets, portals, and content management
...
@@ -32,51 +37,179 @@ build web applications such as intranets, portals, and content management
systems.
systems.
%prep
%prep
rm -rf $RPM_BUILD_DIR/%{package
_
name}
rm -rf $RPM_BUILD_DIR/%{packagename}
tar xvzf $RPM_SOURCE_DIR/%{package
_name}.tar.
gz
tar xvzf $RPM_SOURCE_DIR/%{package
name}.t
gz
%build
%build
cd %{package_name}
cd %{packagename}
./configure --prefix="%{buildroot}%{target_dir}" --optimize \
mkdir build
--with-python=/usr/bin/python2.2
cd build
../configure \
--with-python=%{python} \
--prefix="%{buildroot}%{targetdir}" \
--no-compile
make build
make build
%install
%install
cd %{package
_name}
cd %{package
name}/build
make install
make install
# XXX - need to figure out a way to byte-compile after install instead
# of during install
find %{buildroot}%{target_dir} | sed -e 's@^%{buildroot}@@' > INSTALLED_FILES
%post
%post
/usr/sbin/useradd -M -r -s /bin/bash -d /var/opt/zope -c "Zope server user"\
# byte-compile installed Python files
%{zopeuser} > /dev/null 2>&1
pushd "%{targetdir}" > /dev/null 2>&1
mkdir -p %{inst_target_dir}
%{python} "%{targetdir}/lib/python/Zope/Startup/compilezpy.py" > /dev/null 2>&1
chown %{zopeuser}.%{zopeuser} %{inst_target_dir}
popd > /dev/null 2>&1
chmod 755 %{inst_target_dir}
# add a Zope user if one doesn't already exist
# blank inituser below causes an inituser file to not be written
user=`cut -f1 -d: /etc/passwd|grep "^%{zopeuser}$"`
su - %{zopeuser} -c \
if [ -z "$user" ]; then
"%{python} %{target_dir}/inst/mkzopeinstance --user= %{inst_target_dir} > /dev/null 2>&1"
/usr/sbin/useradd -M -r -s /sbin/nologin -d /var/zope -c \
"Zope service user" %{zopeuser}
# inform the user he will need to write an inituser file
fi
echo Note that before being able to log in to Zope via a web browser, you\'ll
echo need to define a Zope \"initial user\" by running:
# make the instance directory and change its ownership/mode if it doesn't
echo
# already exist
echo cd %{inst_target_dir}
if [ ! -f "%{instancedir}" ]; then
echo %{inst_target_dir}/bin/zopectl write_inituser <username> <password>
mkdir -p %{instancedir}
chown %{zopeuser}.%{zopeuser} %{instancedir}
chmod 755 %{instancedir}
# 10 digit random default admin password
passwd=`head -c4 /dev/urandom | od -tu4 -N4 | sed -ne '1s/.* //p'`
su - %{zopeuser} -s /bin/sh -c \
"%{python} %{targetdir}/bin/mkzopeinstance.py --user=admin:$passwd \
--dir=%{instancedir}"
# inform the user of the default username/password combo
echo
echo A Zope instance has been installed in \"%{instancedir}\" with a
echo default administrative username/password combination. The
echo administrative username is \"admin\" and the password is \"$passwd\".
echo Please remember this so you are able to log in for the first time.
echo
else
echo
echo An instance home directory could not be created at \"%{instancedir}\"
echo because a directory or file by that name already existed. You will
echo need to create a new Zope instance manually by invoking the
echo \"mkzopeinstance.py\" script within "%{targetdir}/bin".
echo
fi
if [ ! -f "/etc/rc.d/init.d/zope" ]; then
cat >> /etc/rc.d/init.d/zope << EOF
#!/bin/sh
# RedHat startup script for a Zope instance using zopectl
# by Chris McDonough (chrism@zope.com)
#
# :AUTO_UNINSTALL_MARKER: (do not remove)
#
# chkconfig: 2345 80 20
# description: Zope, the web application server
# Source function library.
. /etc/rc.d/init.d/functions
instancedir="%{instancedir}"
zopectl="\$instancedir/bin/zopectl"
name="zope"
[ -f \$zopectl ] || exit 1
RETVAL=0
start() {
echo -n "Starting \$name: "
"\$zopectl" start
RETVAL=\$?
echo
return \$RETVAL
}
stop() {
echo -n "Stopping \$name: "
"\$zopectl" stop
RETVAL=\$?
echo
return \$RETVAL
}
case "\$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
*)
echo "Usage: \$0 {start|stop|restart}"
exit 1
esac
exit \$REVAL
EOF
chmod 755 /etc/rc.d/init.d/zope
/sbin/chkconfig --add zope
fi
%preun
if [ -f "/etc/rc.d/init.d/zope"]; then
/etc/rc.d/init.d/zope stop > /dev/null 2>&1
fi
find "%{targetdir}" -name "*.py[co]"|xargs rm -f
%postun
%postun
echo Note that the Zope instance files in "%{inst_target_dir}" were not \
# uninstall the rc file if we installed it
uninstalled, nor was the '%{zopeuser}' user removed from the system.
installedrc=`grep ":AUTO_UNINSTALL_MARKER:" /etc/rc.d/init.d/zope` \
> /dev/null 2>&1
if [ ! -z "$installedrc" ]; then
/sbin/chkconfig --del zope
rm -f /etc/rc.d/init.d/zope
fi
echo
echo Note that the Zope instance files in \"%{instancedir}\" were not
echo uninstalled, nor was the \"%{zopeuser}\" user removed from the system.
echo
%clean
%clean
rm -rf %{buildroot}
rm -rf %{buildroot}
%files
-f %{package_name}/INSTALLED_FILES
%files
%defattr(-,root,root)
%defattr(-,root,root)
%dir %{targetdir}
%{targetdir}/bin
%{targetdir}/doc
%{targetdir}/import
%{targetdir}/lib
%{targetdir}/skel
%{targetdir}/utilities
%changelog
%changelog
* Fri Oct 11 2002 chrism <chrism@james.zope.com>
* Tue Jul 22 2003 Chris McDonough <chrism@zope.com>
- Update for Zope 2.7b1+
- run ./configure from build subdirectory instead of in Zope source root
- (reluctantly) install an instance home with a default username/password
- byte-compile files in postinstall instead of during install
- explicitly name directories in "files" section rather than writing
a manifest from the build
- dont use auto Requires/Provides support
- install an rc script
* Fri Oct 11 2002 Chris McDonough <chrism@zope.com>
- Initial release
- Initial release
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment