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]
[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. ;)
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:
%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
@baboo: Take the source RPM from the Download section (http://www.codeblocks.org/downloads.shtml) 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 (http://wiki.codeblocks.org/index.php/Compiling_Code::Blocks_in_RPM_based_distributions)
Daniel
It the same error like here: http://forums.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