···8585 |- another-pkgname/
8686 |- another-pkgname.1.0.0/
8787 | |- opam
8888- | |- files/
8989- | |- fix1.patch
9090- | |- fix2.patch
9188 |- another-pkgname.1.0.1/
9289 |- opam
9390|- ...
···109106```
110107we recommend using more than one checksum and at least sha256 or stronger. Opam currently supports only md5, sha256 and sha512.
111108112112-Optionally you might want to integrate files (such as patches) in the repository.
113113-To do so, create a `files` directory in the directory of your package
109109+Optionally you might want to integrate external files (such as patches). You will need to host them on your server, or https://gist.github.com, or https://github.com/ocaml/opam-source-archives.
110110+111111+Add the file you uploaded to the [extra-source](https://opam.ocaml.org/doc/Manual.html#opamsection-extra-sources) section of the opam file as follow:
114112```
115115-mkdir packages/pkgname/pkgname.version/files/
113113+extra-source "the-filename" {
114114+ src: "https://my-server/my-file"
115115+ checksum: [
116116+ "sha256=the-checksum-for-my-file"
117117+ ]
118118+}
116119```
117117-then add the files you want to add to this directory. Note that large files are forbidden and the [extra-source](https://opam.ocaml.org/doc/Manual.html#opamsection-extra-sources) section should be used instead.
118120119119-Each time you add a file to the `files` directory, you must edit the associated opam file to add the file to the `extra-files` field as follow:
121121+If you like to have this file being applied as a patch to the source tree after unpacking, you also need to specify in the opam file:
120122```
121121-extra-files: [
122122- ["the-filename" "md5=the-checksum-for-that-file"]
123123- ...
124124-]
123123+patches: [ "the-filename" ]
125124```
126125127127-Once all that is done, you need to create a new git branch, commit your change, push it to your own fork
126126+If you don't specify it as `patches`, the file will be copied to the source directory after unpacking - and be available when building the package.
127127+128128+Once all that is done, you need to create a new git branch, commit your change, push it to your own fork
128129```
129130git switch -c release-yourpkg-version
130131git add packages/yourpkg/yourpkg.version/
···161162162163#### Patches
163164164164-To fix packages, patches might sometimes be useful. This can be given to a package through the [patches field](https://opam.ocaml.org/doc/Manual.html#opamfield-patches), and either added through the [extra-source section](https://opam.ocaml.org/doc/Manual.html#opamsection-extra-sources) or the [extra-files field and the files/ subdirectory](https://opam.ocaml.org/doc/Manual.html#opamfield-extra-files) (`extra-source` is preferred to avoid making opam-repository too big).
165165+To fix packages, patches might sometimes be useful. This can be given to a package through the [patches field](https://opam.ocaml.org/doc/Manual.html#opamfield-patches), and added through the [extra-source section](https://opam.ocaml.org/doc/Manual.html#opamsection-extra-sources).
165166166167As a rule of thumb, unless urgent, the patch should go through upstream first and only if the maintainer is not responding in a reasonable timeframe, we can then think about including the patch in opam-repository, the focus should be for upstream to do a new release.
167168