Jump to content

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                                                                

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

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

%build
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]

%install
python setup.py install --root=$RPM_BUILD_ROOT

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

%files
%defattr(-,root,root,0755)
%doc doc/sybase/* doc/sybase/icons/* ChangeLog LICENCE TODO
/usr/lib/python%{pyver}/site-packages/*

%changelog
* 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:

 

[phile@mdv2009-1:/home/phile/rpm/RPMS/i586]
$ 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? :-)

Link to comment
Share on other sites

  • 5 weeks later...
Guest G. Allard

Hello

 

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

Link to comment
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.

Guest
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.

Loading...
 Share

×
×
  • Create New...