From Fedora Project Wiki

Line 70: Line 70:
<pre>
<pre>
#!/usr/bin/env bash
#!/usr/bin/env bash
echo -e "\033[31mUpdate Fedora 13 repos:\033[0m"
fasLogin=bioinfornatics
cd ~/repos/fedora-13
repoLocalDir=~/repos
for dir in *; do cd $dir; createrepo ./; cd ..; done
repoName=D
echo -e "\033[34m\t* i386:\033[0m"
declare -a branch=(fedora-13 fedora-14)
rsync -avtz --delete ~/repos/fedora-13/i386/*    bioinfornatics@fedorapeople.org:/srv/repos/bioinfornatics/D/fedora-13/i386
declare -a rpmdir=(i386 x86_64 noarch SRPMS)
echo -e "\033[34m\t* x86_64:\033[0m"
declare -a rsyncParam=(-avtz --delete)
rsync -avtz --delete ~/repos/fedora-13/x86_64/*  bioinfornatics@fedorapeople.org:/srv/repos/bioinfornatics/D/fedora-13/x86_64
echo -e "\033[34m\t* SRPMS:\033[0m"
rsync -avtz --delete ~/repos/fedora-13/SRPMS/*  bioinfornatics@fedorapeople.org:/srv/repos/bioinfornatics/D/fedora-13/SRPMS
echo -e "\033[34m\t* noarch:\033[0m"
rsync -avtz --delete ~/repos/fedora-13/noarch/*  bioinfornatics@fedorapeople.org:/srv/repos/bioinfornatics/D/fedora-13/noarch
 
echo -e "\033[31mUpdate Fedora 14 repos:\033[0m"
cd ~/repos/fedora-14
for dir in *; do cd $dir; createrepo ./; cd ..; done
echo -e "\033[34m\t* i386:\033[0m"
rsync -avtz --delete ~/repos/fedora-14/i386/*    bioinfornatics@fedorapeople.org:/srv/repos/bioinfornatics/D/fedora-14/i386
echo -e "\033[34m\t* x86_64:\033[0m"
rsync -avtz --delete ~/repos/fedora-14/x86_64/*  bioinfornatics@fedorapeople.org:/srv/repos/bioinfornatics/D/fedora-14/x86_64
echo -e "\033[34m\t* SRPMS:\033[0m"
rsync -avtz --delete ~/repos/fedora-14/SRPMS/*  bioinfornatics@fedorapeople.org:/srv/repos/bioinfornatics/D/fedora-14/SRPMS
echo -e "\033[34m\t* noarch:\033[0m"
rsync -avtz --delete ~/repos/fedora-14/noarch/*  bioinfornatics@fedorapeople.org:/srv/repos/bioinfornatics/D/fedora-14/noarch
 


for dir1 in $repoLocalDir
do
    cd $dir1
    for dir2 in ${branch[*]}
    do
        echo -e "\033[31mUpdate $dir2 repos:\033[0m"
        cd $dir2
        for dir3 in ${rpmdir[*]}
        do
            echo -e "\033[34m\t* $dir3:\033[0m"
            cd $dir3
            createrepo ./
            rsync $rsyncParam ./* $fasLogin@fedorapeople.org:/srv/repos/$fasLogin/$repoName/$dir2/$dir3
            cd ..
        done
        cd ..
    done
    cd ..
done
</pre>
</pre>


In my example i put all fedora branch in ~/repos directory so maybe you need modify this. You can use sed for quick replace as:
In my example i put all fedora branch in ~/repos directory so maybe you need modify this. You can use sed for quick replace as:
<pre>
<pre>
$ sed -i "s|repos|newDirName|"
$ sed -i "s|repoLocalDir=~/repos|repoLocalDir=newDirName|"
</pre>
</pre>


And you need replace bioinfornatics by to own fas login
And you need replace bioinfornatics by to own fas login
<pre>
<pre>
$ sed -i "s|bioinfornatics|fasLoginName|"
$ sed -i "s|fasLogin=bioinfornatics|fasLogin=fasLoginName|"
</pre>
</pre>


In last my repos is named D so you need replace this to:
In last my repos is named D so you need replace this to:
<pre>
<pre>
$ sed -i "s|/D/|/myRepoName/|"
$ sed -i "s|repoName=D|repoName=myRepoName|"
</pre>
</pre>


[[Category: Package Maintainers]]
[[Category: Package Maintainers]]

Revision as of 15:49, 19 August 2010

Fedora People Repos

Fedora Packagers looking to create a repo at http://repos.fedorapeople.org/ should follow the directions below. These repos should only be used for packages that are intended for end-user non-transient use. For example:

  • Bring a major release version to an older Fedora release
  • Testing out new software before putting it in rawhide
  • Alternate packages already available (different compile options for example)

Things it should _not_ be used for include:

Create repo

Create Repo Layout

Log in to fedorapeople.org and run:

$ new_repo

And follow the directions.

Local Repo

You must create all repodata locally on your workstation, not on fedorapeople.org. If you compiled via koji --scratch builds, download those builds and follow the example below (nagios, nagios-debuginfo and nagios-devel had already been downloaded to ~/)

$ mkdir /tmp/myrepo
$ cd /tmp/myrepo
$ mkdir i386 x86_64 SRPMS
$ cp ~/nagios*3.1.2-2.fc12.i386.rpm ./i386
$ cp ~/nagios*3.1.2-2.fc12.x86_64.rpm ./x86_64
$ cp ~/nagios-3.1.2-2.fc12.src.rpm ./SRPMS
$ for dir in *; do cd $dir; createrepo ./; cd ..; done

You now have 3 local yum repos in your i386, x86_64 and SRPMS directory

It is recommended to use a dist tag when creating rpms to avoid confusion

Upload Repos

Note: to complete this step you need the REPO_PATH from the "Create Repo Layout" above.

$ rsync -avz * fas_name@fedorapeople.org:$REPO_PATH

Accessing new repo

Your new repo should now be listed at:

http://repos.fedorapeople.org/repos/

A cron job will be run regularly to add it to the list of known repos at:

http://repos.fedorapeople.org/

Delete repo

To delete a path, just use REPO_PATH from above and remove it:

rm -rf /srv/repo/mmcgrath/nagios

Script for easy repo update

#!/usr/bin/env bash
fasLogin=bioinfornatics
repoLocalDir=~/repos
repoName=D
declare -a branch=(fedora-13 fedora-14)
declare -a rpmdir=(i386 x86_64 noarch SRPMS)
declare -a rsyncParam=(-avtz --delete)

for dir1 in $repoLocalDir
do
    cd $dir1
    for dir2 in ${branch[*]}
    do
        echo -e "\033[31mUpdate $dir2 repos:\033[0m"
        cd $dir2
        for dir3 in ${rpmdir[*]}
        do
            echo -e "\033[34m\t* $dir3:\033[0m"
            cd $dir3
            createrepo ./
            rsync $rsyncParam ./* $fasLogin@fedorapeople.org:/srv/repos/$fasLogin/$repoName/$dir2/$dir3
            cd ..
        done
        cd ..
    done
    cd ..
done

In my example i put all fedora branch in ~/repos directory so maybe you need modify this. You can use sed for quick replace as:

$ sed -i "s|repoLocalDir=~/repos|repoLocalDir=newDirName|"

And you need replace bioinfornatics by to own fas login

$ sed -i "s|fasLogin=bioinfornatics|fasLogin=fasLoginName|"

In last my repos is named D so you need replace this to:

$ sed -i "s|repoName=D|repoName=myRepoName|"