Roll our own RPM package generation.
authorstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Thu, 13 Dec 2001 23:00:21 +0000 (23:00 +0000)
committerstevenknight <stevenknight@fdb21ef1-2011-0410-befe-b5e4ea1792b1>
Thu, 13 Dec 2001 23:00:21 +0000 (23:00 +0000)
git-svn-id: http://scons.tigris.org/svn/scons/trunk@149 fdb21ef1-2011-0410-befe-b5e4ea1792b1

Construct
rpm/.aeignore [new file with mode: 0644]
rpm/scons.spec [new file with mode: 0644]
src/MANIFEST.in
src/setup.py

index 0b6bba42ac4d8a2051b7ac2455185e7927db4634..4a8078212f6d0f29d231ef9aa3ef1f6bb8342510 100644 (file)
--- a/Construct
+++ b/Construct
@@ -244,8 +244,11 @@ $scons = {
                                 debian/scons.postinst
                                 debian/scons.prerm) ],
 
-        'files'                => [ qw(LICENSE.txt README.txt script/scons.bat
-                                setup.cfg setup.py) ],
+        'files'                => [ qw(LICENSE.txt README.txt os_spawnv_fix.diff
+                               scons.1 script/scons.bat setup.cfg setup.py) ],
+        'filemap'              => {
+                                'scons.1'      => '../doc/man/scons.1',
+                        },
 
         'subpkgs'      => [ $python_scons, $scons_script ],
         'subinst_dirs' => { "python-$project" => $lib_project,
@@ -353,26 +356,41 @@ for $p ($scons) {
     );
     my @install_targets = @build_targets;
 
-    if ($rpm) {
-       push(@setup_args, 'bdist_rpm');
-
-       # XXX "$build/build/bdist.$platform/rpm/SOURCES/$pkg-$version.$archsuffix",
-       # XXX "$build/build/bdist.$platform/rpm/SPECS/$pkg.spec",
-        my @targets = (
-           "$build/dist/$pkg-$version-1.src.rpm",
-           "$build/dist/$pkg-$version-1.noarch.rpm",
-       );
-        push(@build_targets, @targets);
-        push(@install_targets, @targets);
-    };
-
     # We can get away with calling setup.py using a directory path
     # like this because we put a preamble in it that will chdir()
     # to the directory in which setup.py exists.
-    my $commands = qq(rm -rf $build/build $build/dist/* $build/dist/$project-$version
-                      python $build/setup.py @setup_args
+    my $commands = qq(python $build/setup.py @setup_args
                       python $build/setup.py bdist_wininst);
 
+    if ($rpm) {
+       chomp($cwd = `pwd`);
+       $topdir = "$cwd/$build/build/bdist.$platform/rpm";
+
+       $BUILDdir = "$topdir/BUILD/$pkg-$version";
+       $RPMSdir = "$topdir/RPMS/noarch";
+       $SOURCESdir = "$topdir/SOURCES";
+       $SPECSdir = "$topdir/SPECS";
+       $SRPMSdir = "$topdir/SRPMS";
+
+       $specfile = "$SPECSdir/$pkg-$version-1.spec";
+       $sourcefile = "$SOURCESdir/$pkg-$version.$archsuffix";
+       $rpm = "$RPMSdir/$pkg-$version-1.noarch.rpm";
+       $src_rpm = "$SRPMSdir/$pkg-$version-1.src.rpm";
+
+       $env->InstallAs($specfile, "rpm/$pkg.spec");
+       $env->InstallAs($sourcefile, $archive);
+
+       if (! -d $BUILDdir) {
+           $cmd = "mkdir -p $BUILDdir; ";
+       }
+        my @targets = ( $rpm, $src_rpm );
+       $env->Command(\@targets, $specfile,
+                       "${cmd}rpm --define '_topdir $topdir' -ba %<");
+       $env->Depends(\@targets, $sourcefile);
+
+        push(@install_targets, @targets);
+    };
+
     if ($dh_builddeb && $fakeroot) {
         # Debian builds directly into build/dist, so we don't
         # need to add the .debs to the install_targets.
diff --git a/rpm/.aeignore b/rpm/.aeignore
new file mode 100644 (file)
index 0000000..872e8be
--- /dev/null
@@ -0,0 +1,3 @@
+*,D
+.*.swp
+.consign
diff --git a/rpm/scons.spec b/rpm/scons.spec
new file mode 100644 (file)
index 0000000..5c760c6
--- /dev/null
@@ -0,0 +1,89 @@
+%define name scons
+%define version 0.01
+%define release 1
+
+Summary: an Open Source software construction tool
+Name: %{name}
+Version: %{version}
+Release: %{release}
+Source0: %{name}-%{version}.tar.gz
+#Copyright: Steven Knight
+License: MIT, freely distributable
+Group: Development/Tools
+BuildRoot: %{_tmppath}/%{name}-buildroot
+Prefix: %{_prefix}
+BuildArchitectures: noarch
+Vendor: Steven Knight <knight@scons.org>
+Packager: Steven Knight <knight@scons.org>
+Requires: python >= 1.5
+Url: http://www.scons.org/
+
+%description
+SCons is an Open Source software construction tool--that is, a build
+tool; an improved substitute for the classic Make utility; a better way
+to build software.  SCons is based on the design which won the Software
+Carpentry build tool design competition in August 2000.
+
+SCons "configuration files" are Python scripts, eliminating the need
+to learn a new build tool syntax.  SCons maintains a global view of
+all dependencies in a tree, and can scan source (or other) files for
+implicit dependencies, such as files specified on #include lines.  SCons
+uses MD5 signatures to rebuild only when the contents of a file have
+really changed, not just when the timestamp has been touched.  SCons
+supports side-by-side variant builds, and is easily extended with user-
+defined Builder and/or Scanner objects.
+
+%prep
+%setup
+
+%build
+python setup.py build
+
+%install
+python setup.py install --root=$RPM_BUILD_ROOT --record=INSTALLED_FILES
+mkdir -p $RPM_BUILD_ROOT/usr/man/man1
+gzip -c scons.1 > $RPM_BUILD_ROOT/usr/man/man1/scons.1.gz
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+
+%files
+%defattr(-,root,root)
+/usr/bin/scons
+/usr/lib/scons/SCons/Builder.py
+/usr/lib/scons/SCons/Builder.pyc
+/usr/lib/scons/SCons/Defaults.py
+/usr/lib/scons/SCons/Defaults.pyc
+/usr/lib/scons/SCons/Environment.py
+/usr/lib/scons/SCons/Environment.pyc
+/usr/lib/scons/SCons/Errors.py
+/usr/lib/scons/SCons/Errors.pyc
+/usr/lib/scons/SCons/Job.py
+/usr/lib/scons/SCons/Job.pyc
+/usr/lib/scons/SCons/Node/FS.py
+/usr/lib/scons/SCons/Node/FS.pyc
+/usr/lib/scons/SCons/Node/__init__.py
+/usr/lib/scons/SCons/Node/__init__.pyc
+/usr/lib/scons/SCons/Scanner/C.py
+/usr/lib/scons/SCons/Scanner/C.pyc
+/usr/lib/scons/SCons/Scanner/Prog.py
+/usr/lib/scons/SCons/Scanner/Prog.pyc
+/usr/lib/scons/SCons/Scanner/__init__.py
+/usr/lib/scons/SCons/Scanner/__init__.pyc
+/usr/lib/scons/SCons/Script.py
+/usr/lib/scons/SCons/Script.pyc
+/usr/lib/scons/SCons/Sig/MD5.py
+/usr/lib/scons/SCons/Sig/MD5.pyc
+/usr/lib/scons/SCons/Sig/TimeStamp.py
+/usr/lib/scons/SCons/Sig/TimeStamp.pyc
+/usr/lib/scons/SCons/Sig/__init__.py
+/usr/lib/scons/SCons/Sig/__init__.pyc
+/usr/lib/scons/SCons/Taskmaster.py
+/usr/lib/scons/SCons/Taskmaster.pyc
+/usr/lib/scons/SCons/Util.py
+/usr/lib/scons/SCons/Util.pyc
+/usr/lib/scons/SCons/__init__.py
+/usr/lib/scons/SCons/__init__.pyc
+/usr/lib/scons/SCons/exitfuncs.py
+/usr/lib/scons/SCons/exitfuncs.pyc
+%doc /usr/man/man1/scons.1.gz
index b0de0f46f0beb97fd2e1ca05f6197a73935c3e69..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 100644 (file)
@@ -1 +0,0 @@
-os_spawnv_fix.diff
index c3f526054d074766aa39d56634e4a5898bb51a0a..8f8157353cfb67497f050c76eedd5e6e4bc8ca83 100644 (file)
@@ -60,22 +60,11 @@ class my_install_lib(install_lib):
                 self.install_dir = os.path.join(head, tail)
                 return
 
-description = \
-"""SCons is an Open Source software construction tool--that is, a build tool; an
-improved substitute for the classic Make utility; a better way to build
-software."""
-
 keywords = "scons, cons, make, build tool, make tool, software build tool, software construction tool"
 
 arguments = {
     'name'             : "scons",
     'version'          : "__VERSION__",
-    'description'      : "an Open Source software construction tool",
-    'long_description' : description,
-    'author'           : "Steven Knight",
-    'author_email'     : "knight@scons.org",
-    'url'              : "http://www.scons.org/",
-    'license'          : "MIT, freely distributable",
     'keywords'         : keywords,
     'packages'         : ["SCons",
                           "SCons.Node",