Codebase list rust-stfu8 / c6709bf
Update docs Ximin Luo 4 years ago
3 changed file(s) with 52 addition(s) and 48 deletion(s). Raw diff Collapse all Expand all
5555 REALVER=<old-version> ./update.sh <rust-crate-name> # then
5656 REALVER=<old-version> ./release.sh <rust-crate-name>
5757
58 Repackaging the existing revision
59 ---------------------------------
60
61 In order to build a package A already in ``debcargo-conf/src``
62 in the exact version which is present here, do the following::
63
64 $ ./repackage.sh A
65 $ cd build
66 $ ./build.sh A
67
68 If this package is already in the archive and you want to recreate that
69 exactly, you will need to use the exact same version of debcargo that was
70 used previously. This version is mentioned in ``debian/changelog``.
71
5872
5973 Repository structure
6074 ====================
7185 cd build && [SOURCEONLY=1] ./build.sh <rust-crate-name> [<old-version>]
7286
7387 omitting or not omitting the stuff in [] as needed.
88
89
90 Build environment
91 =================
92
93 To set up a suitable build environment for ``./build.sh``::
94
95 $ sudo apt-get install devscripts reprepro debootstrap sbuild dh-cargo
96 $ sudo sbuild-createchroot --include=eatmydata,ccache,gnupg,dh-cargo,cargo,lintian,perl-openssl-defaults \
97 --chroot-prefix debcargo-unstable unstable \
98 /srv/chroot/debcargo-unstable-amd64-sbuild http://deb.debian.org/debian
99
100 Normally, ``./build.sh`` will fail early if not all the build dependencies are
101 available in your local apt cache. If you are packaging a large dependency tree
102 however, to avoid many round-trips through NEW it is possible to bypass this
103 check and build all the packages together. Suppose package B depends on package
104 A, then you can run something like::
105
106 $ export IGNORE_MISSING_BUILD_DEPS=1
107 $ ./release.sh A
108 $ ( cd build && ./build.sh A )
109 # push pending and checkout master
110 $ ./release.sh B
111 $ ( cd build && ./build.sh B librust-A*.deb )
112
113 The extra arguments after ``./build.sh B <args>`` is extra deb files to pass to
114 sbuild to use as dependencies. In this case, ``librust-A*.deb`` should have
115 been built by the previous step.
116
117 After everything is built successfully, you can ``dput`` all of them and then
118 push all the ``pending-*`` branches as normal.
74119
75120
76121 General packaging tips
187232 to be updated, you should instead name the patch ``update-dep-<crate>.patch``
188233 and add both the ``Cargo.toml`` and the source code changes to it. Use
189234 ``quilt rename`` if that helps you.
190
191
192 DD instructions
193 ===============
194
195 To set up a suitable build environment for ``./build.sh``::
196
197 $ sudo apt-get install devscripts reprepro debootstrap sbuild dh-cargo
198 $ sudo sbuild-createchroot --include=eatmydata,ccache,gnupg,dh-cargo,cargo,lintian,perl-openssl-defaults \
199 --chroot-prefix debcargo-unstable unstable \
200 /srv/chroot/debcargo-unstable-amd64-sbuild http://deb.debian.org/debian
201
202 Normally, ``./build.sh`` will fail early if not all the build dependencies are
203 available in your local apt cache. If you are packaging a large dependency tree
204 however, to avoid many round-trips through NEW it is possible to bypass this
205 check and build all the packages together. Suppose package B depends on package
206 A, then you can run something like::
207
208 $ export IGNORE_MISSING_BUILD_DEPS=1
209 $ ./release.sh A
210 $ ( cd build && ./build.sh A )
211 # push pending and checkout master
212 $ ./release.sh B
213 $ ( cd build && ./build.sh B librust-A*.deb )
214
215 The extra arguments after ``./build.sh B <args>`` is extra deb files to pass to
216 sbuild to use as dependencies. In this case, ``librust-A*.deb`` should have
217 been built by the previous step.
218
219 After everything is built successfully, you can ``dput`` all of them and then
220 push all the ``pending-*`` branches as normal.
221
222 Packaging the existing revision
223 ===============================
224
225 In order to build a package A already in ``debcargo-conf/src``
226 in the exact version which is present here, do the following::
227
228 $ ./repackage.sh A
229 $ cd build
230 $ ./build.sh A
231
232 If this package is already in the archive and you want to recreate that, you
233 will need to use the exact same version of debcargo that was used previously.
5050
5151 if head -n1 "$PKGDIR/debian/changelog" | grep -qv UNRELEASED-FIXME-AUTOGENERATED-DEBCARGO; then
5252 git checkout "$PREVBRANCH"
53 abort 0 "Package already released on branch $RELBRANCH. If that was a mistake then run:\ngit branch -D $RELBRANCH\nAnd re-run this script ($0 $*). You might have to delete the remote branch too:\ngit push --delete origin $RELBRANCH"
53 abort 0 "Package already released on branch $RELBRANCH. If that was a mistake then run:" \
54 " git branch -D $RELBRANCH" \
55 "And re-run this script ($0 $*). You might have to delete the remote branch too:" \
56 " git push --delete origin $RELBRANCH"
5457 fi
5558
5659 ( cd "$PKGDIR"
114117
115118 cd build && ./build.sh $CRATE $VER && dput ${DEBSRC}_${DEBVER}_${DEB_HOST_ARCH}.changes
116119
117 This assumes you followed the "DD instructions" in README.rst, for setting up
118 a build environment for release.
120 This assumes you followed the "Build environment" instructions in README.rst,
121 for setting up a build environment for release.
119122
120123 If the build fails e.g. due to missing Build-Dependencies you should revert
121124 what I did (see below) and package those missing Build-Dependencies first.
8686
8787 cd build && ./build.sh $CRATE $VER
8888
89 This assumes that you have set up sbuild; see "DD instructions" in README.rst
89 This assumes that you have set up sbuild; see "Build environment" in README.rst
9090 for details. Try to fix any lintian errors, but note that some errors are due
9191 to lintian being out-of-date and/or are expected at this stage of the process
9292 (e.g. bad-distribution-in-changes-file). Ask on IRC when in doubt.