News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

RPM Spec file is ready

Started by TheTuxKeeper, October 16, 2005, 11:42:39 AM

Previous topic - Next topic

TheTuxKeeper

Here is the first release of my Specfile. Since it's my first Spec it's a minimalistic one, but I want to add subpackages in the next time.

Here is a little Howto for building the rpm :
1. You need a fresh CVS version, no ./bootstrap or anything else should be done before in this directory !
2. rename the rootdirectory (the one with bootstrap and so on) to codeblocks-1.0
3. add the directory codeblocks-1.0 to an tar.gz or tar.bz2 archive named codeblocks-1.0-cvs.tar.gz (or .bz2)
tar -czf codeblocks-1.0-cvs.tar.gz codeblocks-1.0 # gzip tar archive or
tar -cjf codeblocks-1.0-cvs.tar.bz2 codeblocks-1.0 # bzip2 tar archive

If you want to use a tar.bz2 archive you also have to edit the "Source:" line to %{name}-%{version}-%{release}.tar.bz2
4. copy the archive in the directory /usr/src/packages/SOURCES and the Specfile to /usr/src/packages/SPECS/codeblocks.spec
5. build the binary package as root with rpmbuild -bb /usr/src/packages/SPECS/codeblocks.spec
6. the package will be in one of the subdirectories of /usr/src/packages/RPMS/

Please contact me when there is any problem.

Daniel

EDIT: In the moment the package version is "1.0" and the release "cvs" so the complete version string will be 1.0-cvs and that's not good when you want to update later. You can edit the Release string perhaps to cvs.20051016 (no dashes "-" allowed!). But then the archive has to be renamed too. The package name must have the form %{name}-%{version}-%{release}.tar.gz in this example codeblocks-1.0-cvs.20051016.tar.gz

[attachment deleted by admin]
Nightly builds for openSUSE

mandrav

Be patient!
This bug will be fixed soon...

hongxing

I am a newbie, what the usage of spec file? can you explain it for me?
I have compiled the cvs-head codeblocks sucessfully, how can I buid rpm from it?

thanks!

mandrav

Quote from: hongxing on October 16, 2005, 04:13:53 PM
I am a newbie, what the usage of spec file? can you explain it for me?
I have compiled the cvs-head codeblocks sucessfully, how can I buid rpm from it?

thanks!

Why don't you read Daniel's post? He has written in detail what you have to do...
Be patient!
This bug will be fixed soon...

hongxing

thanks, I make the rpm successfully on my SuSE Linux 9

afecelis

#5
Great! fantastic! outstanding!!!!  First time I ever get Codeblocks to run under linux!!!  :D :D Thank you Daniel!!! It also taught me how to build an rpm package. It worked perfectly for Suse 10. I had never been able to compile the source so this is by far a huge success for me!!!

The RPM package I built can be downloaded here:
http://www.danielpatton.com/afecelis/Codeblocks/codeblocks-1.0-cvs.i586.rpm

ps. Mandrav, many thanks for the Irrlicht project template!!  :D

TheTuxKeeper

I added a new article in the wiki with the current Specfile.
-> Compiling Code::Blocks in RPM based distributions

Happy codeblocking  :D

Daniel
Nightly builds for openSUSE

fiammy

It works, but (yes, there's always a but, not necessarily with 2 't' s :-) ) when I want to build the package on SuSE 10.0 x86_64, the system complains that the paths for the libaries aren't right. On 64-bit systems, the 'lib' directory is replaced with a 'lib64'. I don't know if it is possible to autodetect the 'lib' path on the system?

else, great script. Thanks. It's simple enough to show me how to do a .rpm setup for my own projects, and still it had enough features to make it really usefull.

Thanks.

baboo

#8
Hello
I installed all the prerequisites for the RPM and this is what i ran:

[root@srv]# rpm -i codeblocks-1.0-cvs.i586.rpm
error: unpacking of archive failed: cpio: Bad magic


Any ideas why? I didnt build the rpm on my machine. It is downloaded from the address from the first post.

Thank you.

I am running Fedora Core 4 on an Athlon 2600+/ 512MB/ 40GB.


TheTuxKeeper

Quote from: baboo on November 03, 2005, 05:08:42 PM
[root@srv]# rpm -i codeblocks-1.0-cvs.i586.rpm
error: unpacking of archive failed: cpio: Bad magic


Any ideas why? I didnt build the rpm on my machine. It is downloaded from the address from the first post.

Thank you.

I am running Fedora Core 4 on an Athlon 2600+/ 512MB/ 40GB.
Don't even try to use binary RPM's compiled for other distribution  :twisted:  Even RPM's of Suse 9.2 doesn't work in Suse 9.3 in many cases. :(

The file are linked to different lib's with different versions and features.

So it's better using the source RPM from the download page and build it yourself. ;)


Quote from: fiammy on November 03, 2005, 03:44:08 PM
It works, but (yes, there's always a but, not necessarily with 2 't' s :-) ) when I want to build the package on SuSE 10.0 x86_64, the system complains that the paths for the libaries aren't right. On 64-bit systems, the 'lib' directory is replaced with a 'lib64'. I don't know if it is possible to autodetect the 'lib' path on the system?
Oh, that's a bug in my Specfile !!!

I didn't set the lib path manually. So it's always /usr/lib but your lib path is /usr/lib64.

Add the red marked line to the Specfile:
Quote%build
  ./bootstrap
  ./configure \
     --prefix=%{_prefix} \
     --libdir=%{_libdir}\
     --exec-prefix=%{_exec_prefix} \
     --datadir=%{_datadir} \
     --sysconfdir=%{_sysconfdir} \
     --with-docdir=%{_docdir} \
     CXXFLAGS="$RPM_OPT_FLAGS" \
     CFLAGS="$RPM_OPT_FLAGS"
  make

When you use the source RPM just install it as root:
rpm -i codeblocks-1.0-rc2.src.rpm

The Specfile will be in /usr/src/packages/SPECS (codeblocks-rc2.spec).

Thank you
Nightly builds for openSUSE

baboo

>Don't even try to use binary RPM's compiled for other distribution    Even RPM's of Suse 9.2 doesn't work in Suse 9.3 in many cases. 
>The file are linked to different lib's with different versions and features.
>So it's better using the source RPM from the download page and build it yourself.

Well, i tried to build it from sources... i got lost in a makefile.unix thing...
please give me a clue what is happening.

thank you.

TheTuxKeeper

@baboo: Take the source RPM from the Download section and compile it with:
rpmbuild --rebuild codeblocks-1.0-rc2.src.rpm
To compile it, on your fedora has to be installed wxGTK2-devel, wxGTK2-xrc-devel + non devel packages (should be installed automatically because of the dependencies). I think these are the right package names, but it can also be wxGTK without the "2" instead.

It's also described in the wiki: Compiling Code::Blocks in RPM based distributions

Daniel
Nightly builds for openSUSE

baboo

Hello,
I tried to
rpmbuild --rebuild codeblocks-1.0-rc2.src.rpm

and this is the error:

cbthreadpool.cpp:253: error: 'wxUSleep' was not declared in this scope
make[4]: *** [cbthreadpool.lo] Error 1
make[4]: Leaving directory `/usr/src/redhat/BUILD/codeblocks-1.0rc2/src/sdk'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/usr/src/redhat/BUILD/codeblocks-1.0rc2/src/sdk'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/usr/src/redhat/BUILD/codeblocks-1.0rc2/src/sdk'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/usr/src/redhat/BUILD/codeblocks-1.0rc2/src'
make: *** [all-recursive] Error 1
error: Bad exit status from /var/tmp/rpm-tmp.86085 (%build)

RPM build errors:
    user daniel does not exist - using root
    user daniel does not exist - using root
    Bad exit status from /var/tmp/rpm-tmp.86085 (%build)


Please tell me why and how can I fix it.
Thank you a lot.

TheTuxKeeper

It the same error like here: http://forums.next.codeblocks.org/index.php/topic,1146.0.html

To fix it do these steps as root:

1. Extract the sources and the specfilerpm -i codeblocks-1.0-rc2.src.rpm
2. move (not only copy) the sources ( /usr/src/packages/SOURCES/codeblocks-1.0rc2.tgz ) to another place, perhaps to the home directory
3. go to the home directory and extract the sources with tar -xzf codeblocks-1.0rc2.tgz
4. go in the directory codeblocks-1.0rc2/src/sdk of the extracted sources
5. edit in the lines 253 and 268 of cbthreadpool.cpp "wxUSleep" to "wxUsleep" ( uppercase 'S' to lowercase 's')
6. go back to the home directory
7. create a new archive in the directory where the old ones were with tar -czf /usr/src/packages/SOURCES/codeblocks-1.0rc2.tgz codeblocks-1.0rc2
8. build the rpm by using the specfile: rpmbuild -bb /usr/src/packages/SPECS/codeblocks-rc2.spec
9. when everything goes right the binary RPM should be in one of the subdirectories of /usr/src/packages/RPMS (normally i586 or i686)

Puh, I hope that works and I've no typo ;)

Daniel
Nightly builds for openSUSE

killerbot

I got the same problem (suse 10) as baboo, then tried out your new method Daniel, but I get errors :
configure.in:61: error: possibly undefined macro: AM_OPTIONS_WXCONFIG
      If this token and others are legitimate, please use m4_pattern_allow.
      See the Autoconf documentation.
configure.in:62: error: possibly undefined macro: AM_PATH_WXCONFIG
error: Bad exit status from /var/tmp/rpm-tmp.933 (%build)


RPM build errors:
    Bad exit status from /var/tmp/rpm-tmp.933 (%build)


Lieven