Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
setuptools
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
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jérome Perrin
setuptools
Commits
cde132ac
Commit
cde132ac
authored
Sep 10, 2000
by
Greg Ward
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added --python and --fix-python options for better control over what
interpreter the .spec file refers to. Cosmetic tweaks.
parent
fdee9cba
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
33 additions
and
16 deletions
+33
-16
command/bdist_rpm.py
command/bdist_rpm.py
+33
-16
No files found.
command/bdist_rpm.py
View file @
cde132ac
...
...
@@ -7,7 +7,7 @@ distributions)."""
__revision__
=
"$Id$"
import
os
,
string
import
sys
,
os
,
string
import
glob
from
types
import
*
from
distutils.core
import
Command
,
DEBUG
...
...
@@ -28,6 +28,12 @@ class bdist_rpm (Command):
(
'dist-dir='
,
'd'
,
"directory to put final RPM files in "
"(and .spec files if --spec-only)"
),
(
'python='
,
None
,
"path to Python interpreter to hard-code in the .spec file "
"(default:
\
"
python
\
"
)"
),
(
'fix-python'
,
None
,
"hard-code the exact path to the current Python interpreter in "
"the .spec file"
),
(
'spec-only'
,
None
,
"only regenerate spec file"
),
(
'source-only'
,
None
,
...
...
@@ -114,6 +120,8 @@ class bdist_rpm (Command):
self
.
bdist_base
=
None
self
.
rpm_base
=
None
self
.
dist_dir
=
None
self
.
python
=
None
self
.
fix_python
=
None
self
.
spec_only
=
None
self
.
binary_only
=
None
self
.
source_only
=
None
...
...
@@ -159,6 +167,15 @@ class bdist_rpm (Command):
"you must specify --rpm-base in RPM 2 mode"
self
.
rpm_base
=
os
.
path
.
join
(
self
.
bdist_base
,
"rpm"
)
if
self
.
python
is
None
:
if
self
.
fix_python
:
self
.
python
=
sys
.
executable
else
:
self
.
python
=
"python"
elif
self
.
fix_python
:
raise
DistutilsOptionError
,
\
"--python and --fix-python are mutually exclusive options"
if
os
.
name
!=
'posix'
:
raise
DistutilsPlatformError
,
\
(
"don't know how to create RPM "
...
...
@@ -275,21 +292,21 @@ class bdist_rpm (Command):
# build package
self
.
announce
(
'
B
uilding RPMs'
)
rpm_
args
=
[
'rpm'
,
]
self
.
announce
(
'
b
uilding RPMs'
)
rpm_
cmd
=
[
'rpm'
]
if
self
.
source_only
:
# what kind of RPMs?
rpm_
args
.
append
(
'-bs'
)
rpm_
cmd
.
append
(
'-bs'
)
elif
self
.
binary_only
:
rpm_
args
.
append
(
'-bb'
)
rpm_
cmd
.
append
(
'-bb'
)
else
:
rpm_
args
.
append
(
'-ba'
)
rpm_
cmd
.
append
(
'-ba'
)
if
self
.
rpm3_mode
:
rpm_
args
.
extend
([
'--define'
,
rpm_
cmd
.
extend
([
'--define'
,
'_topdir %s/%s'
%
(
os
.
getcwd
(),
self
.
rpm_base
),])
if
self
.
clean
:
rpm_
args
.
append
(
'--clean'
)
rpm_
args
.
append
(
spec_path
)
self
.
spawn
(
rpm_
args
)
rpm_
cmd
.
append
(
'--clean'
)
rpm_
cmd
.
append
(
spec_path
)
self
.
spawn
(
rpm_
cmd
)
# XXX this is a nasty hack -- we really should have a proper way to
# find out the names of the RPM files created; also, this assumes
...
...
@@ -398,10 +415,10 @@ class bdist_rpm (Command):
# rpm scripts
# figure out default build script
def_build
=
"%s setup.py build"
%
self
.
python
if
self
.
use_rpm_opt_flags
:
def_build
=
'env CFLAGS="$RPM_OPT_FLAGS" python setup.py build'
else
:
def_build
=
'python setup.py build'
def_build
=
'env CFLAGS="$RPM_OPT_FLAGS" '
+
def_build
# insert contents of files
# XXX this is kind of misleading: user-supplied options are files
...
...
@@ -412,9 +429,9 @@ class bdist_rpm (Command):
(
'prep'
,
'prep_script'
,
"%setup"
),
(
'build'
,
'build_script'
,
def_build
),
(
'install'
,
'install_script'
,
"python
setup.py install "
"--root=$RPM_BUILD_ROOT "
"--record=INSTALLED_FILES"
),
(
"%s
setup.py install "
"--root=$RPM_BUILD_ROOT "
"--record=INSTALLED_FILES"
)
%
self
.
python
),
(
'clean'
,
'clean_script'
,
"rm -rf $RPM_BUILD_ROOT"
),
(
'pre'
,
'pre_install'
,
None
),
(
'post'
,
'post_install'
,
None
),
...
...
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