Jump to content
Sign in to follow this  
Phil Edwards

MDV2009.1 RPM Build Problem [solved]

Recommended Posts

I've built several RPMs for previous versions of Mandriva up to and including 2008.1. I've recently upgraded to 2009.1 and I'm having a minor problem building an RPM which I can't seem to resolve. The package being built is a python-sybase module to allow access to Sybase and MS-SQL databases from a Python script. My spec file looks like this:


%define name python-sybase                                                                                    
%define version 0.39                                                                                          
%define release 1                                                                                             

%define pyver %(python -c "import sys; print '%s.%s' % sys.version_info[0:2]")

Name: %{name}
Summary: Python Sybase RDBMS access module
Version: %{version}                       
Release: %{release}                       
Source0: http://downloads.sourceforge.net/python-sybase/python-sybase-%{version}.tar.bz2
Source1: http://python-sybase.sourceforge.net/download/python-sybase-docs-%{version}.tar.bz2
Patch1: python-sybase-%{version}.patch                                                      
URL: http://python-sybase.sourceforge.net/                                                  
Group: Development/Python                                                                   
BuildRoot: %{_tmppath}/%{name}-buildroot                                                    
License: BSD-Style license                                                                  
Requires: python >= %{pyver}                                                                
BuildRequires: libfreetds-devel, libfreetds0, libltdl-devel, libunixODBC-devel, libpython%{pyver}-devel, python-setuptools, python-pkg-resources, latex2html                                                                

Provides a Python interface to the Sybase relational database system. The
Sybase package supports all of the Python Database API, version 2.0 with 

[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}
%setup -n python-sybase-%{version}
%setup -D -T -a 1
%patch1 -p1

python setup.py build_ext -D HAVE_FREETDS -U WANT_BULKCOPY

#builddir is [/home/phile/rpm/BUILD]
#buildroot is [/home/phile/rpm/BUILDROOT/python-sybase-0.39-1.i386]
#_datadir is [/usr/share]
#_defaultdocdir is [%_datadir/doc]

python setup.py install --root=$RPM_BUILD_ROOT

[ "%{buildroot}" != "/" ] && rm -rf %{buildroot}

%doc doc/sybase/* doc/sybase/icons/* ChangeLog LICENCE TODO

* Tue Sep 15 2009 Phil Edwards <phil@linux2000.com> 0.39-1pke
- Initial RPM build for Mandriva 2009.1


I have the following entries in my ~/.rpmmacros file:


%_topdir                %(echo $HOME)/rpm
%_tmppath               %(echo $HOME)/rpm/tmp

# If you want your packages to be GPG signed automatically, add these three lines
# replacing 'Mandrivalinux' with your GPG name. You may also use rpm --resign
# to sign the packages later.
%_signature             gpg
%_gpg_name              Phil Edwards
%_gpg_path              ~/.gnupg

# Add your name and e-mail into the %packager field below. You may also want to
# also replace vendor with yourself.
%packager               Phil Edwards <phil@linux2000.com>
%distribution           Mandriva Linux
%vendor                 Mandriva

# If you want your packages to have your own distsuffix instead of mdv, add it
# here like this
%distsuffix             pke

%debug_package          %{nil}


The package builds correctly with no errors. When the resulting RPM files get written, my distsuffix parameter is being ignored:


$ ls -l
total 216
-rw-r--r-- 1 phile phile 102711 2009-09-16 09:15 python-sybase-0.39-1.i586.rpm


The name I am expecting to see for my package is python-sybase-0.39-1pke.i586.rpm - I can make this happen by changing the '%define release' line in the spec file, but I have always been able to set this in my .rpmmacros file in the past.


Has something changed in the way rpmbuild works in 2009.1 or have I made some stupid mistake? :-)

Share this post

Link to post
Share on other sites
Guest G. Allard



The problem you have is in the definition of "release" ( %define release 1 ) : you should use "%define release %mkrel 1" instead

If you have a look to the output of "rpm --showrc" you will see that "distsuffix" is used in "mkrel" Rpm macro and only there

By the way: be sure "mkrel" macro definition is present in the result of "rpm --showrc"


Hope this will help. Good luck

Share this post

Link to post
Share on other sites

I can't see any obvious way to edit the title of this topic to add '[solved]'. Prior to the 'new look' on the board, you just had to edit your original post, but that doesn't give me an option to change the topic title any more...

Share this post

Link to post
Share on other sites

Yes you can, you have to edit first post and then click use full editor and then you can edit the title. It defaults to quick edit.


However, I did it for you :)

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Create New...