Lukas Vrabec cb2fee
## Purpose
Lukas Vrabec cb2fee
Lukas Vrabec cb2fee
SELinux Fedora Policy is a large patch off the mainline. The [fedora-selinux/selinux-policy](https://github.com/selinux-policy/selinux-policy.git) makes Fedora Policy packaging more simple and transparent for developers, upstream developers and users. It is used for applying downstream Fedora fixes, for communication about proposed/committed changes, for communication with upstream and the community. It reflects upstream repository structure to make submitting patches to upstream easy.
Lukas Vrabec cb2fee
Lukas Vrabec cb2fee
## Structure
Lukas Vrabec cb2fee
Lukas Vrabec cb2fee
### github
Lukas Vrabec cb2fee
On GitHub, we have two repositories (selinux-policy and selinux-policy-contrib ) for dist-git repository.
Lukas Vrabec cb2fee
Lukas Vrabec cb2fee
    $ cd selinux-policy
Lukas Vrabec cb2fee
    $ git remote -v
Lukas Vrabec cb2fee
    origin	git@github.com:fedora-selinux/selinux-policy.git (fetch)
Lukas Vrabec cb2fee
Lukas Vrabec cb2fee
Lukas Vrabec cb2fee
    $ git branch -r
Lukas Vrabec cb2fee
    origin/HEAD -> origin/master
Lukas Vrabec cb2fee
    origin/f27
Lukas Vrabec cb2fee
    origin/f28
Lukas Vrabec cb2fee
    origin/master
Lukas Vrabec cb2fee
    origin/rawhide
Lukas Vrabec cb2fee
Lukas Vrabec cb2fee
    $ cd selinux-policy-contrib
Lukas Vrabec cb2fee
    $ git remote -v 
Lukas Vrabec cb2fee
    origin	git@github.com:fedora-selinux/selinux-policy-contrib.git (fetch)
Lukas Vrabec cb2fee
Lukas Vrabec cb2fee
    $ git branch -r
Lukas Vrabec cb2fee
    origin/HEAD -> origin/master
Lukas Vrabec cb2fee
    origin/f27
Lukas Vrabec cb2fee
    origin/f28
Lukas Vrabec cb2fee
    origin/master
Lukas Vrabec cb2fee
    origin/rawhide
Lukas Vrabec cb2fee
Lukas Vrabec cb2fee
Note: _master_ branch on GitHub does not reflect master branch in dist-git. For this purpose, we created the _rawhide github branches in both selinux-policy and selinux-policy-contrib repositories.
Lukas Vrabec cb2fee
Lukas Vrabec cb2fee
### dist-git
Lukas Vrabec cb2fee
Package sources in dist-git are generally composed from a _selinux-policy and _selinux-policy-contrib repository snapshots tarballs and from other config files.
Lukas Vrabec cb2fee
Lukas Vrabec cb2fee
## Build process
Lukas Vrabec cb2fee
Lukas Vrabec cb2fee
1. clone [fedora-selinux/selinux-policy](https://github.com/fedora-selinux/selinux-policy) repository
Lukas Vrabec cb2fee
	
Lukas Vrabec cb2fee
		$ cd ~/devel/github
Lukas Vrabec cb2fee
		$ git clone git@github.com:fedora-selinux/selinux-policy.git
Lukas Vrabec cb2fee
		$ cd selinux-policy
Lukas Vrabec cb2fee
Lukas Vrabec cb2fee
2. clone [fedora-selinux/selinux-policy-contrib](https://github.com/fedora-selinux/selinux-policy-contrib) repository
Lukas Vrabec cb2fee
	
Lukas Vrabec cb2fee
		$ cd ~/devel/github
Lukas Vrabec cb2fee
		$ git clone git@github.com:fedora-selinux/selinux-policy-contrib.git
Lukas Vrabec cb2fee
		$ cd selinux-policy-contrib
Lukas Vrabec cb2fee
Lukas Vrabec cb2fee
3. create, backport, cherry-pick needed changes to a particular branch and push them
Lukas Vrabec cb2fee
Lukas Vrabec cb2fee
4. clone **selinux-policy** dist-git repository
Lukas Vrabec cb2fee
Lukas Vrabec cb2fee
		$ cd ~/devel/dist-git
Lukas Vrabec cb2fee
		$ fedpkg clone selinux-policy 
Lukas Vrabec cb2fee
		$ cd selinux-policy
Lukas Vrabec cb2fee
Lukas Vrabec cb2fee
4. Download the latest snaphots from selinux-policy and selinux-policy-contrib github repositories
Lukas Vrabec cb2fee
Lukas Vrabec cb2fee
        $ ./make-rhat-patches.sh
Lukas Vrabec cb2fee
Lukas Vrabec cb2fee
5. add changes to the dist-git repository, bump release, create a changelog entry, commit and push
Lukas Vrabec cb2fee
6. build the package
Lukas Vrabec cb2fee
	
Lukas Vrabec cb2fee
         $ fedpkg build
Lukas Vrabec cb2fee