[Zope-Checkins] CVS: Zope/inst - Zope.spec.in:1.1.2.1 versions.py:1.1.2.1 Makefile.in:1.1.2.7 configure.py:1.1.2.11 file_from_infile.py:1.1.2.2 install.py:1.1.2.2

Chris McDonough chrism@zope.com
Sat, 12 Oct 2002 02:40:25 -0400


Update of /cvs-repository/Zope/inst
In directory cvs.zope.org:/tmp/cvs-serv1957/inst

Modified Files:
      Tag: chrism-install-branch
	Makefile.in configure.py file_from_infile.py install.py 
Added Files:
      Tag: chrism-install-branch
	Zope.spec.in versions.py 
Log Message:
Add rudimentary RPM-build support.


=== Added File Zope/inst/Zope.spec.in ===
%define name Zope
%define version <<ZOPE_MAJOR_VERSION>>
%define minorversion <<ZOPE_MINOR_VERSION>>
%define release <<VERSION_RELEASE_NUM>>
%define branch <<ZOPE_BRANCH_NAME>>
%define longversion %{version}.%{minorversion}_%{branch}
%define package_name %{name}-%{version}
%define buildroot %{_tmppath}/%{package_name}-buildroot
%define target_dir /opt/%{package_name}

Summary: Zope, the open source web application server
Name: %{name}
Version: %{version}
Release: %{release}
Source0: %{package_name}.tar.gz
License: Zope Public License (ZPL)
Group: Applications/Internet
BuildRoot: %{buildroot}
Prefix: %{_prefix}
Vendor: Zope Corporation and Contributors <zope@zope.org>
Url: http://www.zope.org
# python2.2 packages from RedHat don't have 'compiler' package, but
# 2.2.1 packages do, so we require 2.2.1
Requires: python2 >= 2.2.1

%description
Test release of Zope 2.7-chrism-installer-branch.

%prep
rm -rf $RPM_BUILD_DIR/%{package_name}
tar xvzf $RPM_SOURCE_DIR/%{package_name}.tar.gz

%build
cd %{package_name}
./configure --prefix="%{buildroot}%{target_dir}" --optimize \
   --with-python=/usr/bin/python2.2
make build

%install
cd %{package_name}
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

%clean
rm -rf %{buildroot}

%files -f %{package_name}/INSTALLED_FILES
%defattr(-,root,root)

%changelog
* Fri Oct 11 2002 chrism <chrism@james.zope.com>
- Initial release



=== Added File Zope/inst/versions.py ===
ZOPE_MAJOR_VERSION  = '2.7'
ZOPE_MINOR_VERSION  = '0'
ZOPE_BRANCH_NAME    = '$Name$'[6:] or 'no-branch'
VERSION_RELEASE_NUM = '1'


=== Zope/inst/Makefile.in 1.1.2.6 => 1.1.2.7 ===
--- Zope/inst/Makefile.in:1.1.2.6	Tue Oct  8 19:15:53 2002
+++ Zope/inst/Makefile.in	Sat Oct 12 02:40:24 2002
@@ -3,6 +3,14 @@
 # We do as much as possible in Python in order to avoid needing to
 # learn autoconf or some other awful thing. ;-)
 
+NAME=Zope
+MAJOR_VERSION=<<ZOPE_MAJOR_VERSION>>
+MINOR_VERSION=<<ZOPE_MINOR_VERSION>>
+PACKAGE_NAME=${NAME}-${MAJOR_VERSION}
+
+# change this to your RPM source dir as necessary
+RPM_SRC_DIR=${HOME}/software/rpms/Zope
+
 PYTHON=<<PYTHON>>
 TARGET_DIR=<<TARGET_DIR>>
 BUILD_DIR=<<BUILD_DIR>>
@@ -10,7 +18,6 @@
 INST_DIR=${BUILD_DIR}/inst
 SKEL_DIR=${INST_DIR}/skel
 INFILE_DIR=${INST_DIR}/in
-
 RM=rm -f
 RMRF=rm -rf
 FIND=find
@@ -89,6 +96,15 @@
 instance: build
 	"${PYTHON}" "${SKEL_DIR}/inst/make_instance.py" \
           --zopehome="${BUILD_DIR}"
+
+rpmbuild: clean
+	${RM} "${RPM_SRC_DIR}/${PACKAGE_NAME}"
+	${RM} "${RPM_SRC_DIR}/${PACKAGE_NAME}.spec"
+	${LN} "${BUILD_DIR}" "${RPM_SRC_DIR}/${PACKAGE_NAME}"
+	cd "${RPM_SRC_DIR}" && tar cvzfh ${PACKAGE_NAME}.tar.gz ${PACKAGE_NAME}
+	${WRITE_INFILE} "${INST_DIR}/Zope.spec.in" \
+              "${RPM_SRC_DIR}/${PACKAGE_NAME}.spec"
+	cd ${RPM_SRC_DIR} && rpm -ba ${PACKAGE_NAME}.spec
 
 uninstall:
 	${RMRF} "${TARGET_DIR}"


=== Zope/inst/configure.py 1.1.2.10 => 1.1.2.11 ===
--- Zope/inst/configure.py:1.1.2.10	Sat Oct  5 18:47:03 2002
+++ Zope/inst/configure.py	Sat Oct 12 02:40:24 2002
@@ -14,12 +14,14 @@
 Create a Makefile for building and installing Zope.
 """
 import getopt, sys, os
+import versions
+
 if sys.platform == 'win32':
     TARGET_DIR = 'c:\\Zope'
     IN_MAKEFILE = 'Makefile.win.in'
     MAKE_COMMAND='the Visual C++ batch file "VCVARS32.bat" and then "nmake build"'
 else:
-    TARGET_DIR = '/usr/local/zope'
+    TARGET_DIR = '/opt/Zope-%s' % versions.ZOPE_MAJOR_VERSION
     IN_MAKEFILE = 'Makefile.in'
     MAKE_COMMAND='make'
     
@@ -61,8 +63,14 @@
     print "  - Zope top-level binary directory will be %s." % zope_home
     if OPT_FLAGS:
         print "  - Distutils install flags will be '%s'" % OPT_FLAGS
-    idata = {'<<PYTHON>>':python,'<<TARGET_DIR>>':zope_home,
-             '<<BUILD_DIR>>':build_dir, '<<OPT_FLAGS>>':OPT_FLAGS}
+    idata = {
+        '<<PYTHON>>':python,
+        '<<TARGET_DIR>>':zope_home,
+        '<<BUILD_DIR>>':build_dir,
+        '<<OPT_FLAGS>>':OPT_FLAGS,
+        '<<ZOPE_MAJOR_VERSION>>':versions.ZOPE_MAJOR_VERSION,
+        '<<ZOPE_MINOR_VERSION>>':versions.ZOPE_MINOR_VERSION,
+        }
     for k,v in idata.items():
         MAKEFILE = MAKEFILE.replace(k, v)
     f = open(os.path.join(BUILD_DIR, 'Makefile'), 'w')


=== Zope/inst/file_from_infile.py 1.1.2.1 => 1.1.2.2 ===
--- Zope/inst/file_from_infile.py:1.1.2.1	Sun Sep 29 17:46:23 2002
+++ Zope/inst/file_from_infile.py	Sat Oct 12 02:40:24 2002
@@ -18,10 +18,15 @@
 import getopt, os, sys
 from os.path import abspath, split, dirname
 import shutil
+import versions
 
 default_map = {
-    'PYTHON':sys.executable,
-    'BASE_DIR':abspath(split(dirname(sys.argv[0]))[0])
+    'PYTHON'              : sys.executable,
+    'BASE_DIR'            : abspath(split(dirname(sys.argv[0]))[0]),
+    'ZOPE_MAJOR_VERSION'  : versions.ZOPE_MAJOR_VERSION,
+    'ZOPE_MINOR_VERSION'  : versions.ZOPE_MINOR_VERSION,
+    'ZOPE_BRANCH_NAME'    : versions.ZOPE_BRANCH_NAME,
+    'VERSION_RELEASE_NUM' : versions.VERSION_RELEASE_NUM,
     }
 
 def main(source, dest, map, force):


=== Zope/inst/install.py 1.1.2.1 => 1.1.2.2 ===
--- Zope/inst/install.py:1.1.2.1	Sun Sep 29 17:46:23 2002
+++ Zope/inst/install.py	Sat Oct 12 02:40:24 2002
@@ -18,7 +18,7 @@
 """
 import sys, getopt, os, stat, glob, re
 from shutil import copy2, rmtree
-default_omitpattern = r'^.*~$'
+default_omitpattern = r'(^.*~$|^CVS$|^\.svn$|\.cvsignore|^\.\#.*$)'
 
 def main(src, dst, symlinks=1, dirmode=0755, fmode=0644,
          omitpattern=default_omitpattern, retain_xbit=1):