Commits

Steven Knight  committed 4f75a7d

Roll our own RPM package generation.

  • Participants
  • Parent commits dfc9c9b

Comments (0)

Files changed (5)

                                 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,
     );
     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.

File rpm/.aeignore

+*,D
+.*.swp
+.consign

File rpm/scons.spec

+%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

File src/MANIFEST.in

-os_spawnv_fix.diff

File src/setup.py

                 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",