Phil Edwards Posted September 16, 2009 Report Share Posted September 16, 2009 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? :-) Quote Link to comment Share on other sites More sharing options...
Guest G. Allard Posted October 15, 2009 Report Share Posted October 15, 2009 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 Quote Link to comment Share on other sites More sharing options...
Phil Edwards Posted October 15, 2009 Author Report Share Posted October 15, 2009 Thank you very much, that has solved the problem for me. Quote Link to comment Share on other sites More sharing options...
Phil Edwards Posted October 15, 2009 Author Report Share Posted October 15, 2009 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... Quote Link to comment Share on other sites More sharing options...
ianw1974 Posted October 15, 2009 Report Share Posted October 15, 2009 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 :) Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.