How to rebuild rpm for centos4 / el4

in order to rebuild rpm package for centos4 or RHEL4 equivalent..

Step :
1. create the directory structure as required for building rpm.

You may already have one in /usr/src/RPM, but as rebuilding package as root is evil, we recommend that you create one to a place where your normal user account allows you to write, such as your home directory. This build tree should have the following structure:

|-- RPMS
|   |-- i386
|   |-- i586
|   `-- noarch
`-- tmp

2. create simple rpm-macro ..for a normal user.

because compiling using root is devil. hahahaha.

Now you need to do some rpm configuration. A simple ~/.rpmmacros with the following contents should be enough:

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

%packager       Firstname Lastname <[email protected]>
%distribution JPackage
%vendor JPackage Project

# Uncomment to have built RPMs land in RPMS/ instead of RPMS/<arch>/
#%_rpmfilename  %%{NAME}-%%{VERSION}-%%{RELEASE}.%%{ARCH}.rpm

# Uncomment for signing your packages with GPG
#%_gpg_name FirstName LastName <email address>
#%_gpg_path /path/to/keys

Of course, substitute your own name to the above. Note that all macros are only default values for tags not explicitly filled in spec files.

3.get the source tgz or rpm.

4. rpmbuild -ba source-<version>-.tgz


rpm -i source-<version>.rpm

this one will create the spec into SPECS folder.


Normal command for rebuilding a standard source package (.src.rpm) is:
rpmbuild --rebuild foo-x.y.z-wjpp.src.rpm If you are using an older (pre-4.0.2?) version of rpm, substitute rpmbuild with rpm in the command. Note that rpmbuild is usually part of the rpm-build package.

Further, packages from non-free section are actually .nosrc.rpm, meaning that they don’t contain all sources due to legal issues (prohibited redistribution). So, you’ll have to proceed in several steps here.

  1. Install the source package:
    rpm -i foo-x.y.z-wjpp.nosrc.rpm
  2. Get the missing sources from their original location. File names and base URLs can be found in the spec file, installed into rpm/SPECS/foo.spec by the above command.
  3. Put the sources you’ve downloaded to rpm/SOURCES.
  4. Build package from spec file:
    rpmbuild -ba rpm/SPECS/foo.spec
    (again, substituting rpmbuild with rpm if necessary)

Unless something fails in the process, you should obtain the source package in rpm/SRPMS and binary package in relevant subdirectory of rpm/RPMS.

5. rebuild for SPECS.

rpmbuild -ba SPECS/source-<version>.spec

6. create a repos directory folder which will hold all the file that you want to publish.

let say /home/user/repos

copy all the necessary rpms and SRPMS into this folder..

if want to divide by the architecture also can.

so that we will have something like /home/user/repos/i386/

will all the RPMs and SRPMs.

7. now create all necessary file to make it as a valid yum/repos

cd /home/user/repos/i386

yum-arch .

createrepo .

Basically is done.

8. publish it into your ftp folder.

cd /home/user/repos/i386

ftp -i

cd public_html/repository/i386

mkdir repodata

mkdir headers

mput *.rpm

cd headerslcd headers

mput *

lcd ../repodata

cd ../repodata

mput * create some repos conf.

name=CentOS.namran-EL$releasever - Stable

10 . so that the end user

can just ..

cd /e tc/y um.repos.d/

“wget” http://my.

References :



Get Free Email Updates!

Signup now and receive an email once I publish new content.

I will never give away, trade or sell your email address. You can unsubscribe at any time.


Related Post

3 Responses

  1. HawkEYE says:

    Increase Your Google Adsense Earnings – Competitive Ad Filter
    rate or flag this page

    By Mrvoodoo

    Possibly the most important thing you can do to increase your Adsense earnings:

    Now there are many things you can do in order to fully optimise your web content in order to reap maximum Adsense revenue from your online work. Write quality content, good SEO strategies, link building, getting involved in social media, etc etc. all of which are extremely important in increasing your online earnings.

    However, just as important as writing quality content and spending days/weeks/years finding ways in which to bring in traffic to your site is to take full advantage of that traffic once it’s reached your content.

    Making the most of what you’ve got:

    There are a number of techniques through which you can increase your click through rate and Adsense earnings, the most important being through making your Adsense ads more appealing to visitors. This can be done through optimising Adsense unit placement, e.g visitors are far more likely to click on an ad unit placed above the fold of the screen (i.e. before a user needs to scroll down to read more) then an ad unit say at the bottom right of the screen. Another method of increasing the Adsense click through rate (CTR) and Adsense earnings is through ad unit colour palette optimisation. Successful Adsense units usually follow one of two methods, the Adsense units are blended into the site utilising a similar colour palette to the site itself, or they may use a completely contrasting colour palette, in order to make the Adsense ad units stand out from the rest of the content.

    But possibly the most important method through which to increase your Adsense CTR and Adsense earnings; is through taking full advantage of the Adsense competitive ad filter.

    Designed to enable Adsense publishers to block adverts advertising their competitors the Adsense competitive ad filter allows any Adsense publisher to block any unwanted ads from appearing within their content simply be typing in the URL or web address of the offending ad.

    Why is this useful?

    Let’s say that I’d created a website or written a Hubpage, etc. about PC file extensions, lots of people were searching for the file extension information I’d published, and with a few links built I had a fairly decent amount of traffic coming in. However despite all this traffic I had an extremely low click through rate and wasn’t making much money at all, why?

    After a few visits to my site I noticed that most of the ads being served to my content were for things like ‘loft extensions’ and ‘ring-binder files’, things that were totally unrelated to the needs of my visitors. Google Adsense works contextually, which means that it searches your content for the most common words or themes, compares that to its database of advertisers, and serves up ads accordingly.

    It’s possible that an ad for a loft extension might have a higher click through value than an ad for a file extension utility, but the chances of anyone currently searching for file extension information clicking on it are slim. By making the ads that appear within your content as relevant as possible you will surprised at how much this can increase your CTR and Adsense earnings. By spending just a few days visiting one page with relatively good traffic and blocking the irrelevant ads I managed to increase Adsense earnings from that page ten-fold.

    So how do I go about doing this?

    In order to increase your Adsense CTR and adsene earnings by using the competitive ad filter you first need to take note of which ads you would like to block. Visit your site/page/hub/etc. and see what’s being displayed within your content.

    Biting the hand that feeds you:

    ‘IMPORTANT’ – Never ever click on your own ads, this is the number one guaranteed way to get booted from the Adsense program, you are not smarter than Google, you will be caught, and once you’re out there is very little you can do to ever get back in.

    So jot down the URL or web address of the adverts publisher if you can see it or if you can’t:

    – Right-click on the ad title and select either ‘copy shortcut’ (using Internet explorer) or ‘copy link location’ (using Netscape).

    · Open a text editor, such as Notepad, and paste the selection into the text editor. To paste, select Paste from the text editor’s Edit menu.

    · The destination URL of the ad is the text between ‘adurl=’ and ‘&’. As an example, the copied URL will appear as follows (the example has been shortened with ellipses):…)&adurl=


    The destination URL in the examples above is

    How to use the Adsense competitive ad filter:

    Now that you know the URLs of the Adsense publishers you’ve decided to block you need to visit your Adsense account and log in. Next click on the tab at the top named ‘Adsense setup’, just below the main tabs you will find a link titled ‘competitive ad filter, this is what you’re looking for so click it. You will now find yourself faced with some brief instructions and a large textbox within which you can enter the URLs of those unwanted ads. You do not need to include the ‘www.’ Part of the URL i.e. instead of entering ‘’ you would simply enter ‘’.

    Enter the URLs of the ads you want to block and then click on ‘save changes’, it will usually take a few hours or so before the unwanted ads begin to vanish from your site, but once they’ve gone, in theory, and usually in practise, you should be left with far more relevant targeted ads which will in turn increase your Adsense click through rate and Adsense earnings.

    To fully optimise on this strategy to increase your Adsense earnings it is worth revisiting your site/content every couple of days or so just to see what’s being displayed, and if necessary block ads that aren’t relevant.

    · It is important to consider your entire portfolio of online content when utilising the competitive filter method to increase your Adsense earnings. Do not block ads for say ‘cheap holiday flights’ if for some reason they mistakenly appear on a low traffic page, if you have a high traffic page elsewhere about bargain holidays abroad. Blocking an ad using the Adsense competitive ad filter will block that ad from appearing across your whole online content portfolio.

  2. HawkEYE says: is a unique project designed to enable you to dramatically reduce the amount of MFA (made for ads) and LCPC (low cost per click) sites which appear through the use of PPC systems such as Google Adsense™, Yahoo Publisher Network™ and Chitika eMiniMalls™

  3. green coffee extract weight loss says:

    Oh my goodness! Amazing article dude! Thanks, However I am
    encountering problems with your RSS. I don’t understand the reason why I cannot join it. Is there anybody else having similar RSS issues? Anyone that knows the answer will you kindly respond? Thanks!!


Anything to add?